From 80082c73c4b7e2fb50967ec1505df36588f9d867 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Wed, 2 Feb 2022 07:50:45 +0100 Subject: [PATCH 001/111] Typescript-fetch: date is only converted to javascript date with runtime checks enabled (#11481) * date is only converted to javascript date with runtime checks enabled * fix test * fix test --- .../codegen/languages/TypeScriptFetchClientCodegen.java | 5 ++--- .../codegen/typescript/fetch/TypeScriptFetchModelTest.java | 1 + .../builds/without-runtime-checks/src/models/index.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 8924e3b0b62f..0d47cdcd7ac6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -85,9 +85,6 @@ public TypeScriptFetchClientCodegen() { this.addExtraReservedWords(); - typeMapping.put("date", "Date"); - typeMapping.put("DateTime", "Date"); - supportModelPropertyNaming(CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.camelCase); this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); @@ -231,6 +228,8 @@ public void processOpts() { if (!withoutRuntimeChecks) { this.modelTemplateFiles.put("models.mustache", ".ts"); + typeMapping.put("date", "Date"); + typeMapping.put("DateTime", "Date"); } if (additionalProperties.containsKey(SAGAS_AND_RECORDS)) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java index 8b43b94a8ce9..9bc7c709487a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java @@ -61,6 +61,7 @@ public void simpleModelTest() { .addRequiredItem("name"); final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); + codegen.processOpts(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/index.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/index.ts index 8d8f621b1ba5..8eef2399cc20 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/index.ts @@ -70,10 +70,10 @@ export interface Order { quantity?: number; /** * - * @type {Date} + * @type {string} * @memberof Order */ - shipDate?: Date; + shipDate?: string; /** * Order Status * @type {string} From dc1df25f29791724a0f187e6a6d7886de315652c Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Thu, 3 Feb 2022 09:52:01 +0100 Subject: [PATCH 002/111] [typescript-rxjs] add rxjs 7 support (#9958) * feat(typescript-rxjs): add support for rxjs 7.2.0, use type imports * feat(typescript-rxjs): regenerate samples * feat(typescript-rxjs): use generic T instead of any in BaseAPI * feat(typescript-rxjs): regenerate samples --- .../resources/typescript-rxjs/apis.mustache | 12 +++-- .../typescript-rxjs/modelAllOf.mustache | 2 +- .../typescript-rxjs/modelGeneric.mustache | 2 +- .../typescript-rxjs/modelOneOf.mustache | 2 +- .../typescript-rxjs/package.mustache | 4 +- .../typescript-rxjs/paramNamePartial.mustache | 2 +- .../typescript-rxjs/runtime.mustache | 47 ++++++------------- .../typescript-rxjs/servers.mustache | 8 ++-- .../builds/default/apis/PetApi.ts | 40 ++++++++-------- .../builds/default/apis/StoreApi.ts | 24 +++++----- .../builds/default/apis/UserApi.ts | 40 ++++++++-------- .../builds/default/models/Pet.ts | 2 +- .../typescript-rxjs/builds/default/runtime.ts | 47 ++++++------------- .../typescript-rxjs/builds/default/servers.ts | 8 ++-- .../builds/es6-target/apis/PetApi.ts | 40 ++++++++-------- .../builds/es6-target/apis/StoreApi.ts | 24 +++++----- .../builds/es6-target/apis/UserApi.ts | 40 ++++++++-------- .../builds/es6-target/models/Pet.ts | 2 +- .../builds/es6-target/package.json | 4 +- .../builds/es6-target/runtime.ts | 47 ++++++------------- .../builds/es6-target/servers.ts | 8 ++-- .../builds/with-npm-version/apis/PetApi.ts | 40 ++++++++-------- .../builds/with-npm-version/apis/StoreApi.ts | 24 +++++----- .../builds/with-npm-version/apis/UserApi.ts | 40 ++++++++-------- .../builds/with-npm-version/models/Pet.ts | 2 +- .../builds/with-npm-version/package.json | 4 +- .../builds/with-npm-version/runtime.ts | 47 ++++++------------- .../builds/with-npm-version/servers.ts | 8 ++-- .../with-progress-subscriber/apis/PetApi.ts | 40 ++++++++-------- .../with-progress-subscriber/apis/StoreApi.ts | 24 +++++----- .../with-progress-subscriber/apis/UserApi.ts | 40 ++++++++-------- .../with-progress-subscriber/models/Pet.ts | 2 +- .../with-progress-subscriber/runtime.ts | 47 ++++++------------- .../with-progress-subscriber/servers.ts | 8 ++-- 34 files changed, 331 insertions(+), 400 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache index ff7594b46bd9..3133d6e72ea5 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache @@ -1,9 +1,11 @@ // tslint:disable {{>licenseInfo}} -import { Observable } from 'rxjs'; -import { BaseAPI{{#hasHttpHeaders}}, HttpHeaders{{/hasHttpHeaders}}{{#hasQueryParams}}, HttpQuery{{/hasQueryParams}}{{#hasRequiredParams}}, throwIfNullOrUndefined{{/hasRequiredParams}}{{#hasPathParams}}, encodeURI{{/hasPathParams}}{{#hasListContainers}}, COLLECTION_FORMATS{{/hasListContainers}}, OperationOpts, RawAjaxResponse } from '../runtime'; +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI{{#hasRequiredParams}}, throwIfNullOrUndefined{{/hasRequiredParams}}{{#hasPathParams}}, encodeURI{{/hasPathParams}}{{#hasListContainers}}, COLLECTION_FORMATS{{/hasListContainers}} } from '../runtime'; +import type { OperationOpts{{#hasHttpHeaders}}, HttpHeaders{{/hasHttpHeaders}}{{#hasQueryParams}}, HttpQuery{{/hasQueryParams}} } from '../runtime'; {{#imports.0}} -import { +import type { {{#imports}} {{className}}, {{/imports}} @@ -41,8 +43,8 @@ export class {{classname}} extends BaseAPI { {{#withProgressSubscriber}} {{nickname}}({{#allParams.0}}{ {{#allParams}}{{paramName}}{{#vendorExtensions.x-param-name-alternative}}: {{vendorExtensions.x-param-name-alternative}}{{/vendorExtensions.x-param-name-alternative}}{{^-last}}, {{/-last}}{{/allParams}} }: {{operationIdCamelCase}}Request, {{/allParams.0}}opts?: Pick): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{/withProgressSubscriber}} - {{nickname}}({{#allParams.0}}{ {{#allParams}}{{paramName}}{{#vendorExtensions.x-param-name-alternative}}: {{vendorExtensions.x-param-name-alternative}}{{/vendorExtensions.x-param-name-alternative}}{{^-last}}, {{/-last}}{{/allParams}} }: {{operationIdCamelCase}}Request, {{/allParams.0}}opts?: OperationOpts): Observable<{{#returnType}}RawAjaxResponse<{{{.}}}>{{/returnType}}{{^returnType}}void | RawAjaxResponse{{/returnType}}> - {{nickname}}({{#allParams.0}}{ {{#allParams}}{{paramName}}{{#vendorExtensions.x-param-name-alternative}}: {{vendorExtensions.x-param-name-alternative}}{{/vendorExtensions.x-param-name-alternative}}{{^-last}}, {{/-last}}{{/allParams}} }: {{operationIdCamelCase}}Request, {{/allParams.0}}opts?: OperationOpts): Observable<{{#returnType}}{{{returnType}}} | RawAjaxResponse<{{{returnType}}}>{{/returnType}}{{^returnType}}void | RawAjaxResponse{{/returnType}}> { + {{nickname}}({{#allParams.0}}{ {{#allParams}}{{paramName}}{{#vendorExtensions.x-param-name-alternative}}: {{vendorExtensions.x-param-name-alternative}}{{/vendorExtensions.x-param-name-alternative}}{{^-last}}, {{/-last}}{{/allParams}} }: {{operationIdCamelCase}}Request, {{/allParams.0}}opts?: OperationOpts): Observable<{{#returnType}}AjaxResponse<{{{.}}}>{{/returnType}}{{^returnType}}void | AjaxResponse{{/returnType}}> + {{nickname}}({{#allParams.0}}{ {{#allParams}}{{paramName}}{{#vendorExtensions.x-param-name-alternative}}: {{vendorExtensions.x-param-name-alternative}}{{/vendorExtensions.x-param-name-alternative}}{{^-last}}, {{/-last}}{{/allParams}} }: {{operationIdCamelCase}}Request, {{/allParams.0}}opts?: OperationOpts): Observable<{{#returnType}}{{{returnType}}} | AjaxResponse<{{{returnType}}}>{{/returnType}}{{^returnType}}void | AjaxResponse{{/returnType}}> { {{#hasParams}} {{#allParams}} {{#required}} diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/modelAllOf.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelAllOf.mustache index c38e8ab9372c..252b1510bc66 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/modelAllOf.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelAllOf.mustache @@ -1,5 +1,5 @@ {{#hasImports}} -import { +import type { {{#imports}} {{{.}}}, {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelGeneric.mustache index ddeaf2898c36..a12ceb35c3dc 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelGeneric.mustache @@ -1,5 +1,5 @@ {{#hasImports}} -import { +import type { {{#imports}} {{{.}}}, {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelOneOf.mustache index bdd72c001937..08294385f3a2 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/modelOneOf.mustache @@ -1,5 +1,5 @@ {{#hasImports}} -import { +import type { {{#imports}} {{{.}}}, {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/package.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/package.mustache index 26c1529a3a2d..57e2b7f4bd62 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/package.mustache @@ -10,10 +10,10 @@ "prepare": "npm run build" }, "dependencies": { - "rxjs": "^6.3.3" + "rxjs": "^7.2.0" }, "devDependencies": { - "typescript": "^3.7" + "typescript": "^4.0" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig": { diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/paramNamePartial.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/paramNamePartial.mustache index 7315bcd2b7d8..1c3b1bd63650 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/paramNamePartial.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/paramNamePartial.mustache @@ -1,2 +1,2 @@ -{{! helper to output the alias of a parameter if provided and to not clutter the main template }} +{{! helper to output the alias of a parameter if provided and to not clutter the main template }} {{#vendorExtensions.x-param-name-alternative}}{{vendorExtensions.x-param-name-alternative}}{{/vendorExtensions.x-param-name-alternative}}{{^vendorExtensions.x-param-name-alternative}}{{paramName}}{{/vendorExtensions.x-param-name-alternative}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache index ac29358b9a3d..c5f5edc6a0dd 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache @@ -1,7 +1,9 @@ // tslint:disable {{>licenseInfo}} -import { Observable, of{{#withProgressSubscriber}}, Subscriber{{/withProgressSubscriber}} } from 'rxjs'; -import { ajax, AjaxRequest, AjaxResponse } from 'rxjs/ajax'; +import { of } from 'rxjs'; +import type { Observable{{#withProgressSubscriber}}, Subscriber{{/withProgressSubscriber}} } from 'rxjs'; +import { ajax } from 'rxjs/ajax'; +import type { AjaxConfig, AjaxResponse } from 'rxjs/ajax'; import { map, concatMap } from 'rxjs/operators'; import { servers } from './servers'; @@ -69,9 +71,9 @@ export class BaseAPI { this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request(requestOpts: RequestOpts): Observable - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { - return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { + return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { const { status, response } = res; if (status >= 200 && status < 300) { @@ -82,7 +84,7 @@ export class BaseAPI { ); } - private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType{{#withProgressSubscriber}}, progressSubscriber{{/withProgressSubscriber}} }: RequestOpts): RequestArgs => { + private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType{{#withProgressSubscriber}}, progressSubscriber{{/withProgressSubscriber}} }: RequestOpts): AjaxConfig => { // only add the queryString to the URL if there are query parameters. // this is done to avoid urls ending with a '?' character which buggy webservers // do not handle correctly sometimes. @@ -100,14 +102,14 @@ export class BaseAPI { }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: AjaxConfig): Observable> => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); return request; }), concatMap((args) => - ajax(args).pipe( + ajax(args).pipe( map((response) => { this.middleware.filter((item) => item.post).forEach((mw) => (response = mw.post!(response))); return response; @@ -145,13 +147,13 @@ export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export interface RequestOpts extends AjaxRequest { +export interface RequestOpts extends AjaxConfig { + // TODO: replace custom 'query' prop with 'queryParams' query?: HttpQuery; // additional prop // the following props have improved types over AjaxRequest method: HttpMethod; headers?: HttpHeaders; body?: HttpBody; - responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; {{#withProgressSubscriber}} progressSubscriber?: Subscriber; {{/withProgressSubscriber}} @@ -168,11 +170,6 @@ export interface OperationOpts { responseOpts?: ResponseOpts; } -// AjaxResponse with typed response -export interface RawAjaxResponse extends AjaxResponse { - response: T; -} - export const encodeURI = (value: any) => encodeURIComponent(`${value}`); const queryString = (params: HttpQuery): string => Object.entries(params) @@ -182,29 +179,13 @@ const queryString = (params: HttpQuery): string => Object.entries(params) ) .join('&'); -// alias fallback for not being a breaking change -export const querystring = queryString; - -/** - * @deprecated - */ -export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] == null) { - throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); - } -}; - export const throwIfNullOrUndefined = (value: any, paramName: string, nickname: string) => { if (value == null) { throw new Error(`Parameter "${paramName}" was null or undefined when calling "${nickname}".`); } }; -// alias for easier importing -export interface RequestArgs extends AjaxRequest {} -export interface ResponseArgs extends AjaxResponse {} - export interface Middleware { - pre?(request: RequestArgs): RequestArgs; - post?(response: ResponseArgs): ResponseArgs; + pre?(request: AjaxConfig): AjaxConfig; + post?(response: AjaxResponse): AjaxResponse; } diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/servers.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/servers.mustache index 27eab229a4fb..84ef1435f3ab 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/servers.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/servers.mustache @@ -17,11 +17,11 @@ export class ServerConfiguration { } public getConfiguration(): T { - return this.variableConfiguration + return this.variableConfiguration; } public getDescription(): string { - return this.description + return this.description; } /** @@ -34,12 +34,12 @@ export class ServerConfiguration { var re = new RegExp("{" + key + "}","g"); replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]); } - return replacedUrl + return replacedUrl; } } {{#servers}} -const server{{-index}} = new ServerConfiguration<{ {{#variables}} "{{name}}": {{#enumValues}}"{{.}}"{{^-last}} | {{/-last}}{{/enumValues}}{{^enumValues}}string{{/enumValues}}{{^-last}},{{/-last}} {{/variables}} }>("{{url}}", { {{#variables}} "{{name}}": "{{defaultValue}}" {{^-last}},{{/-last}}{{/variables}} }, "{{description}}") +const server{{-index}} = new ServerConfiguration<{ {{#variables}} "{{name}}": {{#enumValues}}"{{.}}"{{^-last}} | {{/-last}}{{/enumValues}}{{^enumValues}}string{{/enumValues}}{{^-last}},{{/-last}} {{/variables}} }>("{{url}}", { {{#variables}} "{{name}}": "{{defaultValue}}" {{^-last}},{{/-last}}{{/variables}} }, "{{description}}"); {{/servers}} export const servers = [{{#servers}}server{{-index}}{{^-last}}, {{/-last}}{{/servers}}]; diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts index 026381b12b2b..7745f081c8bb 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS } from '../runtime'; +import type { OperationOpts, HttpHeaders, HttpQuery } from '../runtime'; +import type { ApiResponse, Pet, } from '../models'; @@ -64,8 +66,8 @@ export class PetApi extends BaseAPI { * Add a new pet to the store */ addPet({ body }: AddPetRequest): Observable - addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> - addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> { + addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> + addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'addPet'); const headers: HttpHeaders = { @@ -91,8 +93,8 @@ export class PetApi extends BaseAPI { * Deletes a pet */ deletePet({ petId, apiKey }: DeletePetRequest): Observable - deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> - deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> { + deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> + deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'deletePet'); const headers: HttpHeaders = { @@ -118,8 +120,8 @@ export class PetApi extends BaseAPI { * Finds Pets by status */ findPetsByStatus({ status }: FindPetsByStatusRequest): Observable> - findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable>> - findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { + findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable>> + findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable | AjaxResponse>> { throwIfNullOrUndefined(status, 'status', 'findPetsByStatus'); const headers: HttpHeaders = { @@ -149,8 +151,8 @@ export class PetApi extends BaseAPI { * Finds Pets by tags */ findPetsByTags({ tags }: FindPetsByTagsRequest): Observable> - findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable>> - findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { + findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable>> + findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable | AjaxResponse>> { throwIfNullOrUndefined(tags, 'tags', 'findPetsByTags'); const headers: HttpHeaders = { @@ -180,8 +182,8 @@ export class PetApi extends BaseAPI { * Find pet by ID */ getPetById({ petId }: GetPetByIdRequest): Observable - getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> - getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> { + getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> + getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'getPetById'); const headers: HttpHeaders = { @@ -199,8 +201,8 @@ export class PetApi extends BaseAPI { * Update an existing pet */ updatePet({ body }: UpdatePetRequest): Observable - updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> - updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> { + updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> + updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'updatePet'); const headers: HttpHeaders = { @@ -226,8 +228,8 @@ export class PetApi extends BaseAPI { * Updates a pet in the store with form data */ updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest): Observable - updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> - updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> { + updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> + updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'updatePetWithForm'); const headers: HttpHeaders = { @@ -256,8 +258,8 @@ export class PetApi extends BaseAPI { * uploads an image */ uploadFile({ petId, additionalMetadata, file }: UploadFileRequest): Observable - uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> - uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> { + uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> + uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'uploadFile'); const headers: HttpHeaders = { diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts index 5575fe6c3d64..4b41b2501af4 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI } from '../runtime'; +import type { OperationOpts, HttpHeaders } from '../runtime'; +import type { Order, } from '../models'; @@ -39,8 +41,8 @@ export class StoreApi extends BaseAPI { * Delete purchase order by ID */ deleteOrder({ orderId }: DeleteOrderRequest): Observable - deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> - deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> { + deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> + deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(orderId, 'orderId', 'deleteOrder'); return this.request({ @@ -54,8 +56,8 @@ export class StoreApi extends BaseAPI { * Returns pet inventories by status */ getInventory(): Observable<{ [key: string]: number; }> - getInventory(opts?: OperationOpts): Observable> - getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | RawAjaxResponse<{ [key: string]: number; }>> { + getInventory(opts?: OperationOpts): Observable> + getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | AjaxResponse<{ [key: string]: number; }>> { const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; @@ -72,8 +74,8 @@ export class StoreApi extends BaseAPI { * Find purchase order by ID */ getOrderById({ orderId }: GetOrderByIdRequest): Observable - getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> - getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> { + getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> + getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(orderId, 'orderId', 'getOrderById'); return this.request({ @@ -86,8 +88,8 @@ export class StoreApi extends BaseAPI { * Place an order for a pet */ placeOrder({ body }: PlaceOrderRequest): Observable - placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> - placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> { + placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> + placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'placeOrder'); const headers: HttpHeaders = { diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts index 5f08fdfd6580..dd1507f0c25a 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI } from '../runtime'; +import type { OperationOpts, HttpHeaders, HttpQuery } from '../runtime'; +import type { User, } from '../models'; @@ -57,8 +59,8 @@ export class UserApi extends BaseAPI { * Create user */ createUser({ body }: CreateUserRequest): Observable - createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> - createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> { + createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> + createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUser'); const headers: HttpHeaders = { @@ -77,8 +79,8 @@ export class UserApi extends BaseAPI { * Creates list of users with given input array */ createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest): Observable - createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> - createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> { + createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> + createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUsersWithArrayInput'); const headers: HttpHeaders = { @@ -97,8 +99,8 @@ export class UserApi extends BaseAPI { * Creates list of users with given input array */ createUsersWithListInput({ body }: CreateUsersWithListInputRequest): Observable - createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> - createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> { + createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> + createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUsersWithListInput'); const headers: HttpHeaders = { @@ -118,8 +120,8 @@ export class UserApi extends BaseAPI { * Delete user */ deleteUser({ username }: DeleteUserRequest): Observable - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'deleteUser'); return this.request({ @@ -132,8 +134,8 @@ export class UserApi extends BaseAPI { * Get user by user name */ getUserByName({ username }: GetUserByNameRequest): Observable - getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> - getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> { + getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> + getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'getUserByName'); return this.request({ @@ -146,8 +148,8 @@ export class UserApi extends BaseAPI { * Logs user into the system */ loginUser({ username, password }: LoginUserRequest): Observable - loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> - loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> { + loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> + loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'loginUser'); throwIfNullOrUndefined(password, 'password', 'loginUser'); @@ -167,8 +169,8 @@ export class UserApi extends BaseAPI { * Logs out current logged in user session */ logoutUser(): Observable - logoutUser(opts?: OperationOpts): Observable> - logoutUser(opts?: OperationOpts): Observable> { + logoutUser(opts?: OperationOpts): Observable> + logoutUser(opts?: OperationOpts): Observable> { return this.request({ url: '/user/logout', method: 'GET', @@ -180,8 +182,8 @@ export class UserApi extends BaseAPI { * Updated user */ updateUser({ username, body }: UpdateUserRequest): Observable - updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> - updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> { + updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> + updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'updateUser'); throwIfNullOrUndefined(body, 'body', 'updateUser'); diff --git a/samples/client/petstore/typescript-rxjs/builds/default/models/Pet.ts b/samples/client/petstore/typescript-rxjs/builds/default/models/Pet.ts index 972ae15fe062..3d20bc0a87d9 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/models/Pet.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/models/Pet.ts @@ -11,7 +11,7 @@ * Do not edit the class manually. */ -import { +import type { Category, Tag, } from './'; diff --git a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts index f321aca52357..88a1393472c3 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts @@ -11,8 +11,10 @@ * Do not edit the class manually. */ -import { Observable, of } from 'rxjs'; -import { ajax, AjaxRequest, AjaxResponse } from 'rxjs/ajax'; +import { of } from 'rxjs'; +import type { Observable } from 'rxjs'; +import { ajax } from 'rxjs/ajax'; +import type { AjaxConfig, AjaxResponse } from 'rxjs/ajax'; import { map, concatMap } from 'rxjs/operators'; import { servers } from './servers'; @@ -80,9 +82,9 @@ export class BaseAPI { this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request(requestOpts: RequestOpts): Observable - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { - return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { + return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { const { status, response } = res; if (status >= 200 && status < 300) { @@ -93,7 +95,7 @@ export class BaseAPI { ); } - private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType }: RequestOpts): RequestArgs => { + private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType }: RequestOpts): AjaxConfig => { // only add the queryString to the URL if there are query parameters. // this is done to avoid urls ending with a '?' character which buggy webservers // do not handle correctly sometimes. @@ -108,14 +110,14 @@ export class BaseAPI { }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: AjaxConfig): Observable> => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); return request; }), concatMap((args) => - ajax(args).pipe( + ajax(args).pipe( map((response) => { this.middleware.filter((item) => item.post).forEach((mw) => (response = mw.post!(response))); return response; @@ -153,13 +155,13 @@ export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export interface RequestOpts extends AjaxRequest { +export interface RequestOpts extends AjaxConfig { + // TODO: replace custom 'query' prop with 'queryParams' query?: HttpQuery; // additional prop // the following props have improved types over AjaxRequest method: HttpMethod; headers?: HttpHeaders; body?: HttpBody; - responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; } export interface ResponseOpts { @@ -170,11 +172,6 @@ export interface OperationOpts { responseOpts?: ResponseOpts; } -// AjaxResponse with typed response -export interface RawAjaxResponse extends AjaxResponse { - response: T; -} - export const encodeURI = (value: any) => encodeURIComponent(`${value}`); const queryString = (params: HttpQuery): string => Object.entries(params) @@ -184,29 +181,13 @@ const queryString = (params: HttpQuery): string => Object.entries(params) ) .join('&'); -// alias fallback for not being a breaking change -export const querystring = queryString; - -/** - * @deprecated - */ -export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] == null) { - throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); - } -}; - export const throwIfNullOrUndefined = (value: any, paramName: string, nickname: string) => { if (value == null) { throw new Error(`Parameter "${paramName}" was null or undefined when calling "${nickname}".`); } }; -// alias for easier importing -export interface RequestArgs extends AjaxRequest {} -export interface ResponseArgs extends AjaxResponse {} - export interface Middleware { - pre?(request: RequestArgs): RequestArgs; - post?(response: ResponseArgs): ResponseArgs; + pre?(request: AjaxConfig): AjaxConfig; + post?(response: AjaxResponse): AjaxResponse; } diff --git a/samples/client/petstore/typescript-rxjs/builds/default/servers.ts b/samples/client/petstore/typescript-rxjs/builds/default/servers.ts index cdf621ce87d8..b6598faed3d3 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/servers.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/servers.ts @@ -17,11 +17,11 @@ export class ServerConfiguration { } public getConfiguration(): T { - return this.variableConfiguration + return this.variableConfiguration; } public getDescription(): string { - return this.description + return this.description; } /** @@ -34,10 +34,10 @@ export class ServerConfiguration { var re = new RegExp("{" + key + "}","g"); replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]); } - return replacedUrl + return replacedUrl; } } -const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, "") +const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, ""); export const servers = [server1]; diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts index 026381b12b2b..7745f081c8bb 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS } from '../runtime'; +import type { OperationOpts, HttpHeaders, HttpQuery } from '../runtime'; +import type { ApiResponse, Pet, } from '../models'; @@ -64,8 +66,8 @@ export class PetApi extends BaseAPI { * Add a new pet to the store */ addPet({ body }: AddPetRequest): Observable - addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> - addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> { + addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> + addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'addPet'); const headers: HttpHeaders = { @@ -91,8 +93,8 @@ export class PetApi extends BaseAPI { * Deletes a pet */ deletePet({ petId, apiKey }: DeletePetRequest): Observable - deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> - deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> { + deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> + deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'deletePet'); const headers: HttpHeaders = { @@ -118,8 +120,8 @@ export class PetApi extends BaseAPI { * Finds Pets by status */ findPetsByStatus({ status }: FindPetsByStatusRequest): Observable> - findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable>> - findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { + findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable>> + findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable | AjaxResponse>> { throwIfNullOrUndefined(status, 'status', 'findPetsByStatus'); const headers: HttpHeaders = { @@ -149,8 +151,8 @@ export class PetApi extends BaseAPI { * Finds Pets by tags */ findPetsByTags({ tags }: FindPetsByTagsRequest): Observable> - findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable>> - findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { + findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable>> + findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable | AjaxResponse>> { throwIfNullOrUndefined(tags, 'tags', 'findPetsByTags'); const headers: HttpHeaders = { @@ -180,8 +182,8 @@ export class PetApi extends BaseAPI { * Find pet by ID */ getPetById({ petId }: GetPetByIdRequest): Observable - getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> - getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> { + getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> + getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'getPetById'); const headers: HttpHeaders = { @@ -199,8 +201,8 @@ export class PetApi extends BaseAPI { * Update an existing pet */ updatePet({ body }: UpdatePetRequest): Observable - updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> - updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> { + updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> + updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'updatePet'); const headers: HttpHeaders = { @@ -226,8 +228,8 @@ export class PetApi extends BaseAPI { * Updates a pet in the store with form data */ updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest): Observable - updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> - updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> { + updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> + updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'updatePetWithForm'); const headers: HttpHeaders = { @@ -256,8 +258,8 @@ export class PetApi extends BaseAPI { * uploads an image */ uploadFile({ petId, additionalMetadata, file }: UploadFileRequest): Observable - uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> - uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> { + uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> + uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'uploadFile'); const headers: HttpHeaders = { diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts index 5575fe6c3d64..4b41b2501af4 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI } from '../runtime'; +import type { OperationOpts, HttpHeaders } from '../runtime'; +import type { Order, } from '../models'; @@ -39,8 +41,8 @@ export class StoreApi extends BaseAPI { * Delete purchase order by ID */ deleteOrder({ orderId }: DeleteOrderRequest): Observable - deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> - deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> { + deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> + deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(orderId, 'orderId', 'deleteOrder'); return this.request({ @@ -54,8 +56,8 @@ export class StoreApi extends BaseAPI { * Returns pet inventories by status */ getInventory(): Observable<{ [key: string]: number; }> - getInventory(opts?: OperationOpts): Observable> - getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | RawAjaxResponse<{ [key: string]: number; }>> { + getInventory(opts?: OperationOpts): Observable> + getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | AjaxResponse<{ [key: string]: number; }>> { const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; @@ -72,8 +74,8 @@ export class StoreApi extends BaseAPI { * Find purchase order by ID */ getOrderById({ orderId }: GetOrderByIdRequest): Observable - getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> - getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> { + getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> + getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(orderId, 'orderId', 'getOrderById'); return this.request({ @@ -86,8 +88,8 @@ export class StoreApi extends BaseAPI { * Place an order for a pet */ placeOrder({ body }: PlaceOrderRequest): Observable - placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> - placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> { + placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> + placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'placeOrder'); const headers: HttpHeaders = { diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts index 5f08fdfd6580..dd1507f0c25a 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI } from '../runtime'; +import type { OperationOpts, HttpHeaders, HttpQuery } from '../runtime'; +import type { User, } from '../models'; @@ -57,8 +59,8 @@ export class UserApi extends BaseAPI { * Create user */ createUser({ body }: CreateUserRequest): Observable - createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> - createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> { + createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> + createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUser'); const headers: HttpHeaders = { @@ -77,8 +79,8 @@ export class UserApi extends BaseAPI { * Creates list of users with given input array */ createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest): Observable - createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> - createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> { + createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> + createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUsersWithArrayInput'); const headers: HttpHeaders = { @@ -97,8 +99,8 @@ export class UserApi extends BaseAPI { * Creates list of users with given input array */ createUsersWithListInput({ body }: CreateUsersWithListInputRequest): Observable - createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> - createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> { + createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> + createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUsersWithListInput'); const headers: HttpHeaders = { @@ -118,8 +120,8 @@ export class UserApi extends BaseAPI { * Delete user */ deleteUser({ username }: DeleteUserRequest): Observable - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'deleteUser'); return this.request({ @@ -132,8 +134,8 @@ export class UserApi extends BaseAPI { * Get user by user name */ getUserByName({ username }: GetUserByNameRequest): Observable - getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> - getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> { + getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> + getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'getUserByName'); return this.request({ @@ -146,8 +148,8 @@ export class UserApi extends BaseAPI { * Logs user into the system */ loginUser({ username, password }: LoginUserRequest): Observable - loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> - loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> { + loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> + loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'loginUser'); throwIfNullOrUndefined(password, 'password', 'loginUser'); @@ -167,8 +169,8 @@ export class UserApi extends BaseAPI { * Logs out current logged in user session */ logoutUser(): Observable - logoutUser(opts?: OperationOpts): Observable> - logoutUser(opts?: OperationOpts): Observable> { + logoutUser(opts?: OperationOpts): Observable> + logoutUser(opts?: OperationOpts): Observable> { return this.request({ url: '/user/logout', method: 'GET', @@ -180,8 +182,8 @@ export class UserApi extends BaseAPI { * Updated user */ updateUser({ username, body }: UpdateUserRequest): Observable - updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> - updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> { + updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> + updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'updateUser'); throwIfNullOrUndefined(body, 'body', 'updateUser'); diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/models/Pet.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/models/Pet.ts index 972ae15fe062..3d20bc0a87d9 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/models/Pet.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/models/Pet.ts @@ -11,7 +11,7 @@ * Do not edit the class manually. */ -import { +import type { Category, Tag, } from './'; diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/package.json b/samples/client/petstore/typescript-rxjs/builds/es6-target/package.json index 69a56b7d42b5..66e8036cfdf8 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/package.json @@ -10,10 +10,10 @@ "prepare": "npm run build" }, "dependencies": { - "rxjs": "^6.3.3" + "rxjs": "^7.2.0" }, "devDependencies": { - "typescript": "^3.7" + "typescript": "^4.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts index f321aca52357..88a1393472c3 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts @@ -11,8 +11,10 @@ * Do not edit the class manually. */ -import { Observable, of } from 'rxjs'; -import { ajax, AjaxRequest, AjaxResponse } from 'rxjs/ajax'; +import { of } from 'rxjs'; +import type { Observable } from 'rxjs'; +import { ajax } from 'rxjs/ajax'; +import type { AjaxConfig, AjaxResponse } from 'rxjs/ajax'; import { map, concatMap } from 'rxjs/operators'; import { servers } from './servers'; @@ -80,9 +82,9 @@ export class BaseAPI { this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request(requestOpts: RequestOpts): Observable - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { - return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { + return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { const { status, response } = res; if (status >= 200 && status < 300) { @@ -93,7 +95,7 @@ export class BaseAPI { ); } - private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType }: RequestOpts): RequestArgs => { + private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType }: RequestOpts): AjaxConfig => { // only add the queryString to the URL if there are query parameters. // this is done to avoid urls ending with a '?' character which buggy webservers // do not handle correctly sometimes. @@ -108,14 +110,14 @@ export class BaseAPI { }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: AjaxConfig): Observable> => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); return request; }), concatMap((args) => - ajax(args).pipe( + ajax(args).pipe( map((response) => { this.middleware.filter((item) => item.post).forEach((mw) => (response = mw.post!(response))); return response; @@ -153,13 +155,13 @@ export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export interface RequestOpts extends AjaxRequest { +export interface RequestOpts extends AjaxConfig { + // TODO: replace custom 'query' prop with 'queryParams' query?: HttpQuery; // additional prop // the following props have improved types over AjaxRequest method: HttpMethod; headers?: HttpHeaders; body?: HttpBody; - responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; } export interface ResponseOpts { @@ -170,11 +172,6 @@ export interface OperationOpts { responseOpts?: ResponseOpts; } -// AjaxResponse with typed response -export interface RawAjaxResponse extends AjaxResponse { - response: T; -} - export const encodeURI = (value: any) => encodeURIComponent(`${value}`); const queryString = (params: HttpQuery): string => Object.entries(params) @@ -184,29 +181,13 @@ const queryString = (params: HttpQuery): string => Object.entries(params) ) .join('&'); -// alias fallback for not being a breaking change -export const querystring = queryString; - -/** - * @deprecated - */ -export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] == null) { - throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); - } -}; - export const throwIfNullOrUndefined = (value: any, paramName: string, nickname: string) => { if (value == null) { throw new Error(`Parameter "${paramName}" was null or undefined when calling "${nickname}".`); } }; -// alias for easier importing -export interface RequestArgs extends AjaxRequest {} -export interface ResponseArgs extends AjaxResponse {} - export interface Middleware { - pre?(request: RequestArgs): RequestArgs; - post?(response: ResponseArgs): ResponseArgs; + pre?(request: AjaxConfig): AjaxConfig; + post?(response: AjaxResponse): AjaxResponse; } diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/servers.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/servers.ts index cdf621ce87d8..b6598faed3d3 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/servers.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/servers.ts @@ -17,11 +17,11 @@ export class ServerConfiguration { } public getConfiguration(): T { - return this.variableConfiguration + return this.variableConfiguration; } public getDescription(): string { - return this.description + return this.description; } /** @@ -34,10 +34,10 @@ export class ServerConfiguration { var re = new RegExp("{" + key + "}","g"); replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]); } - return replacedUrl + return replacedUrl; } } -const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, "") +const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, ""); export const servers = [server1]; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts index 026381b12b2b..7745f081c8bb 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS } from '../runtime'; +import type { OperationOpts, HttpHeaders, HttpQuery } from '../runtime'; +import type { ApiResponse, Pet, } from '../models'; @@ -64,8 +66,8 @@ export class PetApi extends BaseAPI { * Add a new pet to the store */ addPet({ body }: AddPetRequest): Observable - addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> - addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> { + addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> + addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'addPet'); const headers: HttpHeaders = { @@ -91,8 +93,8 @@ export class PetApi extends BaseAPI { * Deletes a pet */ deletePet({ petId, apiKey }: DeletePetRequest): Observable - deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> - deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> { + deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> + deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'deletePet'); const headers: HttpHeaders = { @@ -118,8 +120,8 @@ export class PetApi extends BaseAPI { * Finds Pets by status */ findPetsByStatus({ status }: FindPetsByStatusRequest): Observable> - findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable>> - findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { + findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable>> + findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable | AjaxResponse>> { throwIfNullOrUndefined(status, 'status', 'findPetsByStatus'); const headers: HttpHeaders = { @@ -149,8 +151,8 @@ export class PetApi extends BaseAPI { * Finds Pets by tags */ findPetsByTags({ tags }: FindPetsByTagsRequest): Observable> - findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable>> - findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { + findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable>> + findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable | AjaxResponse>> { throwIfNullOrUndefined(tags, 'tags', 'findPetsByTags'); const headers: HttpHeaders = { @@ -180,8 +182,8 @@ export class PetApi extends BaseAPI { * Find pet by ID */ getPetById({ petId }: GetPetByIdRequest): Observable - getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> - getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> { + getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> + getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'getPetById'); const headers: HttpHeaders = { @@ -199,8 +201,8 @@ export class PetApi extends BaseAPI { * Update an existing pet */ updatePet({ body }: UpdatePetRequest): Observable - updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> - updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> { + updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> + updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'updatePet'); const headers: HttpHeaders = { @@ -226,8 +228,8 @@ export class PetApi extends BaseAPI { * Updates a pet in the store with form data */ updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest): Observable - updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> - updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> { + updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> + updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'updatePetWithForm'); const headers: HttpHeaders = { @@ -256,8 +258,8 @@ export class PetApi extends BaseAPI { * uploads an image */ uploadFile({ petId, additionalMetadata, file }: UploadFileRequest): Observable - uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> - uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> { + uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> + uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'uploadFile'); const headers: HttpHeaders = { diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts index 5575fe6c3d64..4b41b2501af4 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI } from '../runtime'; +import type { OperationOpts, HttpHeaders } from '../runtime'; +import type { Order, } from '../models'; @@ -39,8 +41,8 @@ export class StoreApi extends BaseAPI { * Delete purchase order by ID */ deleteOrder({ orderId }: DeleteOrderRequest): Observable - deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> - deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> { + deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> + deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(orderId, 'orderId', 'deleteOrder'); return this.request({ @@ -54,8 +56,8 @@ export class StoreApi extends BaseAPI { * Returns pet inventories by status */ getInventory(): Observable<{ [key: string]: number; }> - getInventory(opts?: OperationOpts): Observable> - getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | RawAjaxResponse<{ [key: string]: number; }>> { + getInventory(opts?: OperationOpts): Observable> + getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | AjaxResponse<{ [key: string]: number; }>> { const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; @@ -72,8 +74,8 @@ export class StoreApi extends BaseAPI { * Find purchase order by ID */ getOrderById({ orderId }: GetOrderByIdRequest): Observable - getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> - getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> { + getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> + getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(orderId, 'orderId', 'getOrderById'); return this.request({ @@ -86,8 +88,8 @@ export class StoreApi extends BaseAPI { * Place an order for a pet */ placeOrder({ body }: PlaceOrderRequest): Observable - placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> - placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> { + placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> + placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'placeOrder'); const headers: HttpHeaders = { diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts index 5f08fdfd6580..dd1507f0c25a 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI } from '../runtime'; +import type { OperationOpts, HttpHeaders, HttpQuery } from '../runtime'; +import type { User, } from '../models'; @@ -57,8 +59,8 @@ export class UserApi extends BaseAPI { * Create user */ createUser({ body }: CreateUserRequest): Observable - createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> - createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> { + createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> + createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUser'); const headers: HttpHeaders = { @@ -77,8 +79,8 @@ export class UserApi extends BaseAPI { * Creates list of users with given input array */ createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest): Observable - createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> - createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> { + createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> + createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUsersWithArrayInput'); const headers: HttpHeaders = { @@ -97,8 +99,8 @@ export class UserApi extends BaseAPI { * Creates list of users with given input array */ createUsersWithListInput({ body }: CreateUsersWithListInputRequest): Observable - createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> - createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> { + createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> + createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUsersWithListInput'); const headers: HttpHeaders = { @@ -118,8 +120,8 @@ export class UserApi extends BaseAPI { * Delete user */ deleteUser({ username }: DeleteUserRequest): Observable - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'deleteUser'); return this.request({ @@ -132,8 +134,8 @@ export class UserApi extends BaseAPI { * Get user by user name */ getUserByName({ username }: GetUserByNameRequest): Observable - getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> - getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> { + getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> + getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'getUserByName'); return this.request({ @@ -146,8 +148,8 @@ export class UserApi extends BaseAPI { * Logs user into the system */ loginUser({ username, password }: LoginUserRequest): Observable - loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> - loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> { + loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> + loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'loginUser'); throwIfNullOrUndefined(password, 'password', 'loginUser'); @@ -167,8 +169,8 @@ export class UserApi extends BaseAPI { * Logs out current logged in user session */ logoutUser(): Observable - logoutUser(opts?: OperationOpts): Observable> - logoutUser(opts?: OperationOpts): Observable> { + logoutUser(opts?: OperationOpts): Observable> + logoutUser(opts?: OperationOpts): Observable> { return this.request({ url: '/user/logout', method: 'GET', @@ -180,8 +182,8 @@ export class UserApi extends BaseAPI { * Updated user */ updateUser({ username, body }: UpdateUserRequest): Observable - updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> - updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> { + updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> + updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'updateUser'); throwIfNullOrUndefined(body, 'body', 'updateUser'); diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/models/Pet.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/models/Pet.ts index 972ae15fe062..3d20bc0a87d9 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/models/Pet.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/models/Pet.ts @@ -11,7 +11,7 @@ * Do not edit the class manually. */ -import { +import type { Category, Tag, } from './'; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/package.json b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/package.json index 69a56b7d42b5..66e8036cfdf8 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/package.json @@ -10,10 +10,10 @@ "prepare": "npm run build" }, "dependencies": { - "rxjs": "^6.3.3" + "rxjs": "^7.2.0" }, "devDependencies": { - "typescript": "^3.7" + "typescript": "^4.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts index f321aca52357..88a1393472c3 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts @@ -11,8 +11,10 @@ * Do not edit the class manually. */ -import { Observable, of } from 'rxjs'; -import { ajax, AjaxRequest, AjaxResponse } from 'rxjs/ajax'; +import { of } from 'rxjs'; +import type { Observable } from 'rxjs'; +import { ajax } from 'rxjs/ajax'; +import type { AjaxConfig, AjaxResponse } from 'rxjs/ajax'; import { map, concatMap } from 'rxjs/operators'; import { servers } from './servers'; @@ -80,9 +82,9 @@ export class BaseAPI { this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request(requestOpts: RequestOpts): Observable - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { - return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { + return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { const { status, response } = res; if (status >= 200 && status < 300) { @@ -93,7 +95,7 @@ export class BaseAPI { ); } - private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType }: RequestOpts): RequestArgs => { + private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType }: RequestOpts): AjaxConfig => { // only add the queryString to the URL if there are query parameters. // this is done to avoid urls ending with a '?' character which buggy webservers // do not handle correctly sometimes. @@ -108,14 +110,14 @@ export class BaseAPI { }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: AjaxConfig): Observable> => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); return request; }), concatMap((args) => - ajax(args).pipe( + ajax(args).pipe( map((response) => { this.middleware.filter((item) => item.post).forEach((mw) => (response = mw.post!(response))); return response; @@ -153,13 +155,13 @@ export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export interface RequestOpts extends AjaxRequest { +export interface RequestOpts extends AjaxConfig { + // TODO: replace custom 'query' prop with 'queryParams' query?: HttpQuery; // additional prop // the following props have improved types over AjaxRequest method: HttpMethod; headers?: HttpHeaders; body?: HttpBody; - responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; } export interface ResponseOpts { @@ -170,11 +172,6 @@ export interface OperationOpts { responseOpts?: ResponseOpts; } -// AjaxResponse with typed response -export interface RawAjaxResponse extends AjaxResponse { - response: T; -} - export const encodeURI = (value: any) => encodeURIComponent(`${value}`); const queryString = (params: HttpQuery): string => Object.entries(params) @@ -184,29 +181,13 @@ const queryString = (params: HttpQuery): string => Object.entries(params) ) .join('&'); -// alias fallback for not being a breaking change -export const querystring = queryString; - -/** - * @deprecated - */ -export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] == null) { - throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); - } -}; - export const throwIfNullOrUndefined = (value: any, paramName: string, nickname: string) => { if (value == null) { throw new Error(`Parameter "${paramName}" was null or undefined when calling "${nickname}".`); } }; -// alias for easier importing -export interface RequestArgs extends AjaxRequest {} -export interface ResponseArgs extends AjaxResponse {} - export interface Middleware { - pre?(request: RequestArgs): RequestArgs; - post?(response: ResponseArgs): ResponseArgs; + pre?(request: AjaxConfig): AjaxConfig; + post?(response: AjaxResponse): AjaxResponse; } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/servers.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/servers.ts index cdf621ce87d8..b6598faed3d3 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/servers.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/servers.ts @@ -17,11 +17,11 @@ export class ServerConfiguration { } public getConfiguration(): T { - return this.variableConfiguration + return this.variableConfiguration; } public getDescription(): string { - return this.description + return this.description; } /** @@ -34,10 +34,10 @@ export class ServerConfiguration { var re = new RegExp("{" + key + "}","g"); replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]); } - return replacedUrl + return replacedUrl; } } -const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, "") +const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, ""); export const servers = [server1]; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/PetApi.ts index 0fc16a28bbfb..1fd55eca4bcf 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/PetApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS } from '../runtime'; +import type { OperationOpts, HttpHeaders, HttpQuery } from '../runtime'; +import type { ApiResponse, Pet, } from '../models'; @@ -65,8 +67,8 @@ export class PetApi extends BaseAPI { */ addPet({ body }: AddPetRequest): Observable addPet({ body }: AddPetRequest, opts?: Pick): Observable - addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> - addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> { + addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> + addPet({ body }: AddPetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'addPet'); const headers: HttpHeaders = { @@ -94,8 +96,8 @@ export class PetApi extends BaseAPI { */ deletePet({ petId, apiKey }: DeletePetRequest): Observable deletePet({ petId, apiKey }: DeletePetRequest, opts?: Pick): Observable - deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> - deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> { + deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> + deletePet({ petId, apiKey }: DeletePetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'deletePet'); const headers: HttpHeaders = { @@ -123,8 +125,8 @@ export class PetApi extends BaseAPI { */ findPetsByStatus({ status }: FindPetsByStatusRequest): Observable> findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: Pick): Observable> - findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable>> - findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { + findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable>> + findPetsByStatus({ status }: FindPetsByStatusRequest, opts?: OperationOpts): Observable | AjaxResponse>> { throwIfNullOrUndefined(status, 'status', 'findPetsByStatus'); const headers: HttpHeaders = { @@ -156,8 +158,8 @@ export class PetApi extends BaseAPI { */ findPetsByTags({ tags }: FindPetsByTagsRequest): Observable> findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: Pick): Observable> - findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable>> - findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { + findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable>> + findPetsByTags({ tags }: FindPetsByTagsRequest, opts?: OperationOpts): Observable | AjaxResponse>> { throwIfNullOrUndefined(tags, 'tags', 'findPetsByTags'); const headers: HttpHeaders = { @@ -189,8 +191,8 @@ export class PetApi extends BaseAPI { */ getPetById({ petId }: GetPetByIdRequest): Observable getPetById({ petId }: GetPetByIdRequest, opts?: Pick): Observable - getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> - getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> { + getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> + getPetById({ petId }: GetPetByIdRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'getPetById'); const headers: HttpHeaders = { @@ -210,8 +212,8 @@ export class PetApi extends BaseAPI { */ updatePet({ body }: UpdatePetRequest): Observable updatePet({ body }: UpdatePetRequest, opts?: Pick): Observable - updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> - updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> { + updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> + updatePet({ body }: UpdatePetRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'updatePet'); const headers: HttpHeaders = { @@ -239,8 +241,8 @@ export class PetApi extends BaseAPI { */ updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest): Observable updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: Pick): Observable - updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> - updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> { + updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> + updatePetWithForm({ petId, name, status }: UpdatePetWithFormRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'updatePetWithForm'); const headers: HttpHeaders = { @@ -271,8 +273,8 @@ export class PetApi extends BaseAPI { */ uploadFile({ petId, additionalMetadata, file }: UploadFileRequest): Observable uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: Pick): Observable - uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> - uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> { + uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> + uploadFile({ petId, additionalMetadata, file }: UploadFileRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(petId, 'petId', 'uploadFile'); const headers: HttpHeaders = { diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/StoreApi.ts index 55672fd90697..fc5c271bc0ff 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/StoreApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI } from '../runtime'; +import type { OperationOpts, HttpHeaders } from '../runtime'; +import type { Order, } from '../models'; @@ -40,8 +42,8 @@ export class StoreApi extends BaseAPI { */ deleteOrder({ orderId }: DeleteOrderRequest): Observable deleteOrder({ orderId }: DeleteOrderRequest, opts?: Pick): Observable - deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> - deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> { + deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> + deleteOrder({ orderId }: DeleteOrderRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(orderId, 'orderId', 'deleteOrder'); return this.request({ @@ -57,8 +59,8 @@ export class StoreApi extends BaseAPI { */ getInventory(): Observable<{ [key: string]: number; }> getInventory(opts?: Pick): Observable<{ [key: string]: number; }> - getInventory(opts?: OperationOpts): Observable> - getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | RawAjaxResponse<{ [key: string]: number; }>> { + getInventory(opts?: OperationOpts): Observable> + getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | AjaxResponse<{ [key: string]: number; }>> { const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; @@ -77,8 +79,8 @@ export class StoreApi extends BaseAPI { */ getOrderById({ orderId }: GetOrderByIdRequest): Observable getOrderById({ orderId }: GetOrderByIdRequest, opts?: Pick): Observable - getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> - getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> { + getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> + getOrderById({ orderId }: GetOrderByIdRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(orderId, 'orderId', 'getOrderById'); return this.request({ @@ -93,8 +95,8 @@ export class StoreApi extends BaseAPI { */ placeOrder({ body }: PlaceOrderRequest): Observable placeOrder({ body }: PlaceOrderRequest, opts?: Pick): Observable - placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> - placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> { + placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> + placeOrder({ body }: PlaceOrderRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'placeOrder'); const headers: HttpHeaders = { diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/UserApi.ts index 1b216533a2fb..e7ad80b2769d 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/UserApi.ts @@ -11,9 +11,11 @@ * Do not edit the class manually. */ -import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; -import { +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI } from '../runtime'; +import type { OperationOpts, HttpHeaders, HttpQuery } from '../runtime'; +import type { User, } from '../models'; @@ -58,8 +60,8 @@ export class UserApi extends BaseAPI { */ createUser({ body }: CreateUserRequest): Observable createUser({ body }: CreateUserRequest, opts?: Pick): Observable - createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> - createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> { + createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> + createUser({ body }: CreateUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUser'); const headers: HttpHeaders = { @@ -80,8 +82,8 @@ export class UserApi extends BaseAPI { */ createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest): Observable createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: Pick): Observable - createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> - createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> { + createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> + createUsersWithArrayInput({ body }: CreateUsersWithArrayInputRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUsersWithArrayInput'); const headers: HttpHeaders = { @@ -102,8 +104,8 @@ export class UserApi extends BaseAPI { */ createUsersWithListInput({ body }: CreateUsersWithListInputRequest): Observable createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: Pick): Observable - createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> - createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> { + createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> + createUsersWithListInput({ body }: CreateUsersWithListInputRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(body, 'body', 'createUsersWithListInput'); const headers: HttpHeaders = { @@ -125,8 +127,8 @@ export class UserApi extends BaseAPI { */ deleteUser({ username }: DeleteUserRequest): Observable deleteUser({ username }: DeleteUserRequest, opts?: Pick): Observable - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'deleteUser'); return this.request({ @@ -141,8 +143,8 @@ export class UserApi extends BaseAPI { */ getUserByName({ username }: GetUserByNameRequest): Observable getUserByName({ username }: GetUserByNameRequest, opts?: Pick): Observable - getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> - getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> { + getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> + getUserByName({ username }: GetUserByNameRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'getUserByName'); return this.request({ @@ -157,8 +159,8 @@ export class UserApi extends BaseAPI { */ loginUser({ username, password }: LoginUserRequest): Observable loginUser({ username, password }: LoginUserRequest, opts?: Pick): Observable - loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> - loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> { + loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> + loginUser({ username, password }: LoginUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'loginUser'); throwIfNullOrUndefined(password, 'password', 'loginUser'); @@ -180,8 +182,8 @@ export class UserApi extends BaseAPI { */ logoutUser(): Observable logoutUser(opts?: Pick): Observable - logoutUser(opts?: OperationOpts): Observable> - logoutUser(opts?: OperationOpts): Observable> { + logoutUser(opts?: OperationOpts): Observable> + logoutUser(opts?: OperationOpts): Observable> { return this.request({ url: '/user/logout', method: 'GET', @@ -195,8 +197,8 @@ export class UserApi extends BaseAPI { */ updateUser({ username, body }: UpdateUserRequest): Observable updateUser({ username, body }: UpdateUserRequest, opts?: Pick): Observable - updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> - updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> { + updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> + updateUser({ username, body }: UpdateUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'updateUser'); throwIfNullOrUndefined(body, 'body', 'updateUser'); diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/models/Pet.ts b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/models/Pet.ts index 972ae15fe062..3d20bc0a87d9 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/models/Pet.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/models/Pet.ts @@ -11,7 +11,7 @@ * Do not edit the class manually. */ -import { +import type { Category, Tag, } from './'; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/runtime.ts index 7238c7b78293..7133ac675b69 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/runtime.ts @@ -11,8 +11,10 @@ * Do not edit the class manually. */ -import { Observable, of, Subscriber } from 'rxjs'; -import { ajax, AjaxRequest, AjaxResponse } from 'rxjs/ajax'; +import { of } from 'rxjs'; +import type { Observable, Subscriber } from 'rxjs'; +import { ajax } from 'rxjs/ajax'; +import type { AjaxConfig, AjaxResponse } from 'rxjs/ajax'; import { map, concatMap } from 'rxjs/operators'; import { servers } from './servers'; @@ -80,9 +82,9 @@ export class BaseAPI { this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request(requestOpts: RequestOpts): Observable - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> - protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { - return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { + return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { const { status, response } = res; if (status >= 200 && status < 300) { @@ -93,7 +95,7 @@ export class BaseAPI { ); } - private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType, progressSubscriber }: RequestOpts): RequestArgs => { + private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType, progressSubscriber }: RequestOpts): AjaxConfig => { // only add the queryString to the URL if there are query parameters. // this is done to avoid urls ending with a '?' character which buggy webservers // do not handle correctly sometimes. @@ -109,14 +111,14 @@ export class BaseAPI { }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: AjaxConfig): Observable> => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); return request; }), concatMap((args) => - ajax(args).pipe( + ajax(args).pipe( map((response) => { this.middleware.filter((item) => item.post).forEach((mw) => (response = mw.post!(response))); return response; @@ -154,13 +156,13 @@ export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export interface RequestOpts extends AjaxRequest { +export interface RequestOpts extends AjaxConfig { + // TODO: replace custom 'query' prop with 'queryParams' query?: HttpQuery; // additional prop // the following props have improved types over AjaxRequest method: HttpMethod; headers?: HttpHeaders; body?: HttpBody; - responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; progressSubscriber?: Subscriber; } @@ -173,11 +175,6 @@ export interface OperationOpts { responseOpts?: ResponseOpts; } -// AjaxResponse with typed response -export interface RawAjaxResponse extends AjaxResponse { - response: T; -} - export const encodeURI = (value: any) => encodeURIComponent(`${value}`); const queryString = (params: HttpQuery): string => Object.entries(params) @@ -187,29 +184,13 @@ const queryString = (params: HttpQuery): string => Object.entries(params) ) .join('&'); -// alias fallback for not being a breaking change -export const querystring = queryString; - -/** - * @deprecated - */ -export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] == null) { - throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); - } -}; - export const throwIfNullOrUndefined = (value: any, paramName: string, nickname: string) => { if (value == null) { throw new Error(`Parameter "${paramName}" was null or undefined when calling "${nickname}".`); } }; -// alias for easier importing -export interface RequestArgs extends AjaxRequest {} -export interface ResponseArgs extends AjaxResponse {} - export interface Middleware { - pre?(request: RequestArgs): RequestArgs; - post?(response: ResponseArgs): ResponseArgs; + pre?(request: AjaxConfig): AjaxConfig; + post?(response: AjaxResponse): AjaxResponse; } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/servers.ts b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/servers.ts index cdf621ce87d8..b6598faed3d3 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/servers.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/servers.ts @@ -17,11 +17,11 @@ export class ServerConfiguration { } public getConfiguration(): T { - return this.variableConfiguration + return this.variableConfiguration; } public getDescription(): string { - return this.description + return this.description; } /** @@ -34,10 +34,10 @@ export class ServerConfiguration { var re = new RegExp("{" + key + "}","g"); replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]); } - return replacedUrl + return replacedUrl; } } -const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, "") +const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, ""); export const servers = [server1]; From 4d9a500c952761177e2c41236b083a318be9a97c Mon Sep 17 00:00:00 2001 From: Justin Black Date: Thu, 3 Feb 2022 10:27:52 -0600 Subject: [PATCH 003/111] Adds inline composition examples to python-experimental (#11420) * Adds component with composition in property example * Adds endpoint parameter examples * Adds request body examples * Adds inpline composition example in response body * Fixes UNKNOWNBASETYPE import bug * Updates allof inline schemas to be type object with minProperties * Removes newline * Adds test_ObjectWithInlineCompositionProperty * Updates inline schema to be type string, adds partial test_inline_composition * Fixes accept_content_types input value * Adds test_ObjectWithInlineCompositionProperty, adds test_inline_composition and starts deserialization of multipart * Fixes test_inline_composition, adds simple multipat/form-data deserialization --- .../PythonExperimentalClientCodegen.java | 71 ++- .../python-experimental/api_client.handlebars | 18 + ...odels-for-testing-with-http-signature.yaml | 63 +- .../.openapi-generator/FILES | 4 + .../petstore/python-experimental/README.md | 3 + .../docs/CompositionInProperty.md | 10 + .../python-experimental/docs/FakeApi.md | 131 +++++ .../ObjectWithInlineCompositionProperty.md | 10 + .../petstore_api/api/fake_api.py | 2 + .../fake_api_endpoints/inline_composition.py | 554 ++++++++++++++++++ .../petstore_api/api_client.py | 18 + .../model/composition_in_property.py | 132 +++++ ...object_with_inline_composition_property.py | 132 +++++ .../petstore_api/models/__init__.py | 2 + .../test/test_composition_in_property.py | 35 ++ .../python-experimental/test/test_fake_api.py | 7 + ...object_with_inline_composition_property.py | 35 ++ .../tests_manual/test_fake_api.py | 115 +++- ...object_with_inline_composition_property.py | 33 ++ 19 files changed, 1370 insertions(+), 5 deletions(-) create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/CompositionInProperty.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ObjectWithInlineCompositionProperty.md create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composition_in_property.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_object_with_inline_composition_property.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_inline_composition_property.py diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index 5424080f0d7b..3eca491d66f5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -919,6 +919,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S * With this customization, we ensure that when schemas are passed to getSchemaType * - if they have ref in them they are a model * - if they do not have ref in them they are not a model + * and code is also customized to allow anyType request body schemas * * @param codegenParameter the body parameter * @param name model schema ref key in components @@ -936,7 +937,75 @@ protected void addBodyModelSchema(CodegenParameter codegenParameter, String name forceSimpleRef = true; } } - super.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, forceSimpleRef); + + CodegenModel codegenModel = null; + if (StringUtils.isNotBlank(name)) { + schema.setName(name); + codegenModel = fromModel(name, schema); + } + if (codegenModel != null) { + codegenParameter.isModel = true; + } + + if (codegenModel != null && (codegenModel.hasVars || forceSimpleRef)) { + if (StringUtils.isEmpty(bodyParameterName)) { + codegenParameter.baseName = codegenModel.classname; + } else { + codegenParameter.baseName = bodyParameterName; + } + codegenParameter.paramName = toParamName(codegenParameter.baseName); + codegenParameter.baseType = codegenModel.classname; + codegenParameter.dataType = getTypeDeclaration(codegenModel.classname); + codegenParameter.description = codegenModel.description; + codegenParameter.isNullable = codegenModel.isNullable; + imports.add(codegenParameter.baseType); + } else { + CodegenProperty codegenProperty = fromProperty("property", schema); + + if (codegenProperty != null && codegenProperty.getComplexType() != null && codegenProperty.getComplexType().contains(" | ")) { + List parts = Arrays.asList(codegenProperty.getComplexType().split(" \\| ")); + imports.addAll(parts); + String codegenModelName = codegenProperty.getComplexType(); + codegenParameter.baseName = codegenModelName; + codegenParameter.paramName = toParamName(codegenParameter.baseName); + codegenParameter.baseType = codegenParameter.baseName; + codegenParameter.dataType = getTypeDeclaration(codegenModelName); + codegenParameter.description = codegenProperty.getDescription(); + codegenParameter.isNullable = codegenProperty.isNullable; + } else { + if (ModelUtils.isMapSchema(schema)) {// http body is map + LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue."); + } else if (codegenProperty != null) { + String codegenModelName, codegenModelDescription; + + if (codegenModel != null) { + codegenModelName = codegenModel.classname; + codegenModelDescription = codegenModel.description; + } else { + codegenModelName = "anyType"; + codegenModelDescription = ""; + } + + if (StringUtils.isEmpty(bodyParameterName)) { + codegenParameter.baseName = codegenModelName; + } else { + codegenParameter.baseName = bodyParameterName; + } + + codegenParameter.paramName = toParamName(codegenParameter.baseName); + codegenParameter.baseType = codegenModelName; + codegenParameter.dataType = getTypeDeclaration(codegenModelName); + codegenParameter.description = codegenModelDescription; + + if (codegenProperty.complexType != null) { + imports.add(codegenProperty.complexType); + } + } + } + + // set nullable + setParameterNullable(codegenParameter, codegenProperty); + } } diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars index 4dfc613aae22..ac1ed1743a57 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars @@ -4,6 +4,7 @@ from dataclasses import dataclass from decimal import Decimal import enum +import email import json import os import io @@ -777,6 +778,20 @@ class OpenApiResponse: else: return response.data + @staticmethod + def __deserialize_multipart_form_data( + response: urllib3.HTTPResponse + ) -> typing.Dict[str, typing.Any]: + msg = email.message_from_bytes(response.data) + return { + part.get_param("name", header="Content-Disposition"): part.get_payload( + decode=True + ).decode(part.get_content_charset()) + if part.get_content_charset() + else part.get_payload() + for part in msg.get_payload() + } + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: content_type = response.getheader('content-type') deserialized_body = unset @@ -786,6 +801,9 @@ class OpenApiResponse: body_data = self.__deserialize_json(response) elif content_type == 'application/octet-stream': body_data = self.__deserialize_application_octet_stream(response) + elif content_type.startswith('multipart/form-data'): + body_data = self.__deserialize_multipart_form_data(response) + content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) body_schema = self.content[content_type].schema diff --git a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 7fcdb42c7b39..5db730b756a1 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1436,6 +1436,60 @@ paths: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' + /fake/inlineComposition/: + post: + tags: + - fake + summary: testing composed schemas at inline locations + operationId: inlineComposition + parameters: + - name: compositionAtRoot + in: query + schema: + allOf: + - type: string + minLength: 1 + - name: compositionInProperty + in: query + schema: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 + requestBody: + content: + application/json: + schema: + allOf: + - type: string + minLength: 1 + multipart/form-data: + schema: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 + responses: + 200: + description: success + content: + application/json: + schema: + allOf: + - type: string + minLength: 1 + multipart/form-data: + schema: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -2681,4 +2735,11 @@ components: type: string format: number cost: - $ref: '#/components/schemas/Money' \ No newline at end of file + $ref: '#/components/schemas/Money' + ObjectWithInlineCompositionProperty: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES index fdc3984d899e..48127260f213 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -41,6 +41,7 @@ docs/ComposedNumber.md docs/ComposedObject.md docs/ComposedOneOfDifferentTypes.md docs/ComposedString.md +docs/CompositionInProperty.md docs/Currency.md docs/DanishPig.md docs/DateTimeTest.md @@ -95,6 +96,7 @@ docs/ObjectInterface.md docs/ObjectModelWithRefProps.md docs/ObjectWithDecimalProperties.md docs/ObjectWithDifficultlyNamedProps.md +docs/ObjectWithInlineCompositionProperty.md docs/ObjectWithValidations.md docs/Order.md docs/ParentPet.md @@ -179,6 +181,7 @@ petstore_api/model/composed_number.py petstore_api/model/composed_object.py petstore_api/model/composed_one_of_different_types.py petstore_api/model/composed_string.py +petstore_api/model/composition_in_property.py petstore_api/model/currency.py petstore_api/model/danish_pig.py petstore_api/model/date_time_test.py @@ -230,6 +233,7 @@ petstore_api/model/object_interface.py petstore_api/model/object_model_with_ref_props.py petstore_api/model/object_with_decimal_properties.py petstore_api/model/object_with_difficultly_named_props.py +petstore_api/model/object_with_inline_composition_property.py petstore_api/model/object_with_validations.py petstore_api/model/order.py petstore_api/model/parent_pet.py diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index a849a36ae20c..eaf9a932d09c 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint *FakeApi* | [**group_parameters**](docs/FakeApi.md#group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**inline_additional_properties**](docs/FakeApi.md#inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**inline_composition**](docs/FakeApi.md#inline_composition) | **POST** /fake/inlineComposition/ | testing composed schemas at inline locations *FakeApi* | [**json_form_data**](docs/FakeApi.md#json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**mammal**](docs/FakeApi.md#mammal) | **POST** /fake/refs/mammal | *FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | @@ -172,6 +173,7 @@ Class | Method | HTTP request | Description - [ComposedObject](docs/ComposedObject.md) - [ComposedOneOfDifferentTypes](docs/ComposedOneOfDifferentTypes.md) - [ComposedString](docs/ComposedString.md) + - [CompositionInProperty](docs/CompositionInProperty.md) - [Currency](docs/Currency.md) - [DanishPig](docs/DanishPig.md) - [DateTimeTest](docs/DateTimeTest.md) @@ -223,6 +225,7 @@ Class | Method | HTTP request | Description - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - [ObjectWithDecimalProperties](docs/ObjectWithDecimalProperties.md) - [ObjectWithDifficultlyNamedProps](docs/ObjectWithDifficultlyNamedProps.md) + - [ObjectWithInlineCompositionProperty](docs/ObjectWithInlineCompositionProperty.md) - [ObjectWithValidations](docs/ObjectWithValidations.md) - [Order](docs/Order.md) - [ParentPet](docs/ParentPet.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CompositionInProperty.md b/samples/openapi3/client/petstore/python-experimental/docs/CompositionInProperty.md new file mode 100644 index 000000000000..12441fe99ec1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/CompositionInProperty.md @@ -0,0 +1,10 @@ +# CompositionInProperty + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProp** | **object** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index 45fdc4a5c1c3..ddb0b6f2c8e7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -18,6 +18,7 @@ Method | HTTP request | Description [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint [**group_parameters**](FakeApi.md#group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**inline_additional_properties**](FakeApi.md#inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**inline_composition**](FakeApi.md#inline_composition) | **POST** /fake/inlineComposition/ | testing composed schemas at inline locations [**json_form_data**](FakeApi.md#json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data [**mammal**](FakeApi.md#mammal) | **POST** /fake/refs/mammal | [**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number | @@ -1408,6 +1409,136 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **inline_composition** +> object inline_composition() + +testing composed schemas at inline locations + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.composition_in_property import CompositionInProperty +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example passing only optional values + query_params = { + 'compositionAtRoot': , + 'compositionInProperty': dict( + some_prop=, + ), + } + body = + try: + # testing composed schemas at inline locations + api_response = api_instance.inline_composition( + query_params=query_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->inline_composition: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | +query_params | RequestQueryParams | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', 'multipart/form-data', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +#### SchemaForRequestBodyMultipartFormData + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProp** | **object** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +compositionAtRoot | CompositionAtRootSchema | | optional +compositionInProperty | CompositionInPropertySchema | | optional + + +#### CompositionAtRootSchema + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +#### CompositionInPropertySchema +Type | Description | Notes +------------- | ------------- | ------------- +[**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}**](CompositionInProperty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, SchemaFor200ResponseBodyMultipartFormData, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +#### SchemaFor200ResponseBodyMultipartFormData + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProp** | **object** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + + +**object** + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **json_form_data** > json_form_data() diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithInlineCompositionProperty.md b/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithInlineCompositionProperty.md new file mode 100644 index 000000000000..f83f69a567d5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithInlineCompositionProperty.md @@ -0,0 +1,10 @@ +# ObjectWithInlineCompositionProperty + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProp** | **object** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py index 7a81465ef0f9..521ac4a08173 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -24,6 +24,7 @@ from petstore_api.api.fake_api_endpoints.fake_health_get import FakeHealthGet from petstore_api.api.fake_api_endpoints.group_parameters import GroupParameters from petstore_api.api.fake_api_endpoints.inline_additional_properties import InlineAdditionalProperties +from petstore_api.api.fake_api_endpoints.inline_composition import InlineComposition from petstore_api.api.fake_api_endpoints.json_form_data import JsonFormData from petstore_api.api.fake_api_endpoints.mammal import Mammal from petstore_api.api.fake_api_endpoints.number_with_validations import NumberWithValidations @@ -52,6 +53,7 @@ class FakeApi( FakeHealthGet, GroupParameters, InlineAdditionalProperties, + InlineComposition, JsonFormData, Mammal, NumberWithValidations, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py new file mode 100644 index 000000000000..5a595a3fb3e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py @@ -0,0 +1,554 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.composition_in_property import CompositionInProperty + +# query params + + +class CompositionAtRootSchema( + ComposedSchema +): + + @classmethod + @property + def _composed_schemas(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + + + class allOf_0( + _SchemaValidator( + min_length=1, + ), + StrSchema + ): + pass + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'CompositionAtRootSchema': + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +class CompositionInPropertySchema( + DictSchema +): + + + class someProp( + ComposedSchema + ): + + @classmethod + @property + def _composed_schemas(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + + + class allOf_0( + _SchemaValidator( + min_length=1, + ), + StrSchema + ): + pass + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'someProp': + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + someProp: typing.Union[someProp, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'CompositionInPropertySchema': + return super().__new__( + cls, + *args, + someProp=someProp, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + 'compositionAtRoot': CompositionAtRootSchema, + 'compositionInProperty': CompositionInPropertySchema, + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_composition_at_root = api_client.QueryParameter( + name="compositionAtRoot", + style=api_client.ParameterStyle.FORM, + schema=CompositionAtRootSchema, + explode=True, +) +request_query_composition_in_property = api_client.QueryParameter( + name="compositionInProperty", + style=api_client.ParameterStyle.FORM, + schema=CompositionInPropertySchema, + explode=True, +) +# body param + + +class SchemaForRequestBodyApplicationJson( + ComposedSchema +): + + @classmethod + @property + def _composed_schemas(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + + + class allOf_0( + _SchemaValidator( + min_length=1, + ), + StrSchema + ): + pass + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +class SchemaForRequestBodyMultipartFormData( + DictSchema +): + + + class someProp( + ComposedSchema + ): + + @classmethod + @property + def _composed_schemas(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + + + class allOf_0( + _SchemaValidator( + min_length=1, + ), + StrSchema + ): + pass + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'someProp': + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + someProp: typing.Union[someProp, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaForRequestBodyMultipartFormData': + return super().__new__( + cls, + *args, + someProp=someProp, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_any_type = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + 'multipart/form-data': api_client.MediaType( + schema=SchemaForRequestBodyMultipartFormData), + }, +) +_path = '/fake/inlineComposition/' +_method = 'POST' + + +class SchemaFor200ResponseBodyApplicationJson( + ComposedSchema +): + + @classmethod + @property + def _composed_schemas(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + + + class allOf_0( + _SchemaValidator( + min_length=1, + ), + StrSchema + ): + pass + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +class SchemaFor200ResponseBodyMultipartFormData( + DictSchema +): + + + class someProp( + ComposedSchema + ): + + @classmethod + @property + def _composed_schemas(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + + + class allOf_0( + _SchemaValidator( + min_length=1, + ), + StrSchema + ): + pass + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'someProp': + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + someProp: typing.Union[someProp, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaFor200ResponseBodyMultipartFormData': + return super().__new__( + cls, + *args, + someProp=someProp, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + SchemaFor200ResponseBodyMultipartFormData, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + 'multipart/form-data': api_client.MediaType( + schema=SchemaFor200ResponseBodyMultipartFormData), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', + 'multipart/form-data', +) + + +class InlineComposition(api_client.Api): + + def inline_composition( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, SchemaForRequestBodyMultipartFormData, Unset] = unset, + query_params: RequestQueryParams = frozendict(), + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + testing composed schemas at inline locations + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + + _query_params = [] + for parameter in ( + request_query_composition_at_root, + request_query_composition_in_property, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_any_type.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + query_params=tuple(_query_params), + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index adad78a8e847..3aa0d288d589 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -11,6 +11,7 @@ from dataclasses import dataclass from decimal import Decimal import enum +import email import json import os import io @@ -781,6 +782,20 @@ def __deserialize_application_octet_stream( else: return response.data + @staticmethod + def __deserialize_multipart_form_data( + response: urllib3.HTTPResponse + ) -> typing.Dict[str, typing.Any]: + msg = email.message_from_bytes(response.data) + return { + part.get_param("name", header="Content-Disposition"): part.get_payload( + decode=True + ).decode(part.get_content_charset()) + if part.get_content_charset() + else part.get_payload() + for part in msg.get_payload() + } + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: content_type = response.getheader('content-type') deserialized_body = unset @@ -790,6 +805,9 @@ def deserialize(self, response: urllib3.HTTPResponse, configuration: Configurati body_data = self.__deserialize_json(response) elif content_type == 'application/octet-stream': body_data = self.__deserialize_application_octet_stream(response) + elif content_type.startswith('multipart/form-data'): + body_data = self.__deserialize_multipart_form_data(response) + content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) body_schema = self.content[content_type].schema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py new file mode 100644 index 000000000000..38f4fb948ac5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class CompositionInProperty( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class someProp( + ComposedSchema + ): + + @classmethod + @property + def _composed_schemas(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + + + class allOf_0( + _SchemaValidator( + min_length=1, + ), + StrSchema + ): + pass + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'someProp': + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + someProp: typing.Union[someProp, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'CompositionInProperty': + return super().__new__( + cls, + *args, + someProp=someProp, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py new file mode 100644 index 000000000000..ca57f8edd0c4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ObjectWithInlineCompositionProperty( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class someProp( + ComposedSchema + ): + + @classmethod + @property + def _composed_schemas(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + + + class allOf_0( + _SchemaValidator( + min_length=1, + ), + StrSchema + ): + pass + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'someProp': + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + someProp: typing.Union[someProp, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'ObjectWithInlineCompositionProperty': + return super().__new__( + cls, + *args, + someProp=someProp, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py index 07e026d2c2f0..fd3e6fa8d148 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -49,6 +49,7 @@ from petstore_api.model.composed_object import ComposedObject from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes from petstore_api.model.composed_string import ComposedString +from petstore_api.model.composition_in_property import CompositionInProperty from petstore_api.model.currency import Currency from petstore_api.model.danish_pig import DanishPig from petstore_api.model.date_time_test import DateTimeTest @@ -100,6 +101,7 @@ from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps from petstore_api.model.object_with_decimal_properties import ObjectWithDecimalProperties from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps +from petstore_api.model.object_with_inline_composition_property import ObjectWithInlineCompositionProperty from petstore_api.model.object_with_validations import ObjectWithValidations from petstore_api.model.order import Order from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composition_in_property.py b/samples/openapi3/client/petstore/python-experimental/test/test_composition_in_property.py new file mode 100644 index 000000000000..adddcae8b758 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composition_in_property.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import petstore_api +from petstore_api.model.composition_in_property import CompositionInProperty + + +class TestCompositionInProperty(unittest.TestCase): + """CompositionInProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_CompositionInProperty(self): + """Test CompositionInProperty""" + # FIXME: construct object with mandatory attributes with example values + # model = CompositionInProperty() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py index abe26cc6c4da..ecf7f950429d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -116,6 +116,13 @@ def test_inline_additional_properties(self): """ pass + def test_inline_composition(self): + """Test case for inline_composition + + testing composed schemas at inline locations # noqa: E501 + """ + pass + def test_json_form_data(self): """Test case for json_form_data diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_inline_composition_property.py new file mode 100644 index 000000000000..442195d94d73 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_inline_composition_property.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import petstore_api +from petstore_api.model.object_with_inline_composition_property import ObjectWithInlineCompositionProperty + + +class TestObjectWithInlineCompositionProperty(unittest.TestCase): + """ObjectWithInlineCompositionProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ObjectWithInlineCompositionProperty(self): + """Test ObjectWithInlineCompositionProperty""" + # FIXME: construct object with mandatory attributes with example values + # model = ObjectWithInlineCompositionProperty() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py index c053cee62fbc..42c4714476c5 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py @@ -8,7 +8,8 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ - +from email.mime import multipart +from email.mime import nonmultipart import io import sys import unittest @@ -20,11 +21,18 @@ from urllib3._collections import HTTPHeaderDict import petstore_api -from petstore_api import api_client, schemas +from petstore_api import api_client, schemas, exceptions from petstore_api.api.fake_api import FakeApi # noqa: E501 from petstore_api.rest import RESTClientObject +class MIMEFormdata(nonmultipart.MIMENonMultipart): + def __init__(self, keyname, *args, **kwargs): + super(MIMEFormdata, self).__init__(*args, **kwargs) + self.add_header( + "Content-Disposition", "form-data; name=\"%s\"" % keyname) + + class TestFakeApi(unittest.TestCase): """FakeApi unit test stubs""" json_content_type = 'application/json' @@ -67,6 +75,7 @@ def __assert_request_called_with( fields: typing.Optional[tuple[api_client.RequestField, ...]] = None, accept_content_type: str = 'application/json', stream: bool = False, + query_params: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None ): mock_request.assert_called_with( 'POST', @@ -79,7 +88,7 @@ def __assert_request_called_with( } ), body=body, - query_params=None, + query_params=query_params, fields=fields, stream=stream, timeout=None, @@ -570,6 +579,106 @@ def test_upload_files(self): ) self.assertEqual(api_response.body, response_json) + @staticmethod + def __encode_multipart_formdata(fields: typing.Dict[str, typing.Any]) -> multipart.MIMEMultipart: + m = multipart.MIMEMultipart("form-data") + + for field, value in fields.items(): + data = MIMEFormdata(field, "text", "plain") + # data.set_payload(value, charset='us-ascii') + data.set_payload(value) + m.attach(data) + + return m + + @patch.object(RESTClientObject, 'request') + def test_inline_composition(self, mock_request): + """Test case for inline_composition + + testing composed schemas at inline locations # noqa: E501 + """ + single_char_str = 'a' + json_bytes = self.__json_bytes(single_char_str) + + # tx and rx json with composition at root level of schema for request + response body + content_type = 'application/json' + mock_request.return_value = self.__response( + json_bytes + ) + api_response = self.api.inline_composition( + body=single_char_str, + query_params={ + 'compositionAtRoot': single_char_str, + 'compositionInProperty': {'someProp': single_char_str} + }, + accept_content_types=(content_type,) + ) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/inlineComposition/', + accept_content_type=content_type, + content_type=content_type, + query_params=(('compositionAtRoot', 'a'), ('someProp', 'a')), + body=json_bytes + ) + self.assertEqual(api_response.body, single_char_str) + self.assertTrue(isinstance(api_response.body, schemas.StrSchema)) + + # tx and rx json with composition at property level of schema for request + response body + content_type = 'multipart/form-data' + multipart_response = self.__encode_multipart_formdata(fields={'someProp': single_char_str}) + mock_request.return_value = self.__response( + bytes(multipart_response), + content_type=multipart_response.get_content_type() + ) + api_response = self.api.inline_composition( + body={'someProp': single_char_str}, + query_params={ + 'compositionAtRoot': single_char_str, + 'compositionInProperty': {'someProp': single_char_str} + }, + content_type=content_type, + accept_content_types=(content_type,) + ) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/inlineComposition/', + accept_content_type=content_type, + content_type=content_type, + query_params=(('compositionAtRoot', 'a'), ('someProp', 'a')), + fields=( + api_client.RequestField( + name='someProp', + data=single_char_str, + headers={'Content-Type': 'text/plain'} + ), + ), + ) + self.assertEqual(api_response.body, {'someProp': single_char_str}) + self.assertTrue(isinstance(api_response.body.someProp, schemas.StrSchema)) + + # error thrown when a str is input which doesn't meet the composed schema length constraint + invalid_value = '' + variable_locations = 4 + for invalid_index in range(variable_locations): + values = [single_char_str]*variable_locations + values[invalid_index] = invalid_value + with self.assertRaises(exceptions.ApiValueError): + multipart_response = self.__encode_multipart_formdata(fields={'someProp': values[0]}) + mock_request.return_value = self.__response( + bytes(multipart_response), + content_type=multipart_response.get_content_type() + ) + self.api.inline_composition( + body={'someProp': values[1]}, + query_params={ + 'compositionAtRoot': values[2], + 'compositionInProperty': {'someProp': values[3]} + }, + content_type=content_type, + accept_content_types=(content_type,) + ) + if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_inline_composition_property.py new file mode 100644 index 000000000000..98b902a01e63 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_inline_composition_property.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +from petstore_api import schemas, exceptions +from petstore_api.model.object_with_inline_composition_property import ObjectWithInlineCompositionProperty + + +class TestObjectWithInlineCompositionProperty(unittest.TestCase): + """ObjectWithInlineCompositionProperty unit test stubs""" + + def test_ObjectWithInlineCompositionProperty(self): + """Test ObjectWithInlineCompositionProperty""" + model = ObjectWithInlineCompositionProperty(someProp='a') + self.assertTrue(isinstance(model.someProp, ObjectWithInlineCompositionProperty.someProp)) + self.assertTrue(isinstance(model.someProp, schemas.StrSchema)) + + # error thrown on length < 1 + with self.assertRaises(exceptions.ApiValueError): + ObjectWithInlineCompositionProperty(someProp='') + + +if __name__ == '__main__': + unittest.main() From 7843a45b89ef3e241e5971df5032257739360878 Mon Sep 17 00:00:00 2001 From: y-tomida Date: Fri, 4 Feb 2022 16:04:51 +0900 Subject: [PATCH 004/111] [TypeScript] Fix type array with uniqueItems (#11515) * fix type mapping * add missing primitive type Set * add testcase * generate new samples * update typescript generator document * regenerate samples and documents --- bin/configs/typescript-with-unique-items.yaml | 4 + docs/generators/typescript.md | 1 + .../languages/TypeScriptClientCodegen.java | 5 +- .../TypeScriptClientCodegenTest.java | 21 ++ .../3_0/typescript/unique_items.yaml | 31 +++ .../builds/with-unique-items/.gitignore | 1 + .../.openapi-generator-ignore | 23 ++ .../.openapi-generator/FILES | 24 ++ .../.openapi-generator/VERSION | 1 + .../builds/with-unique-items/DefaultApi.md | 57 +++++ .../builds/with-unique-items/README.md | 30 +++ .../with-unique-items/apis/DefaultApi.ts | 73 ++++++ .../builds/with-unique-items/apis/baseapi.ts | 37 +++ .../with-unique-items/apis/exception.ts | 15 ++ .../builds/with-unique-items/auth/auth.ts | 52 ++++ .../builds/with-unique-items/configuration.ts | 66 +++++ .../builds/with-unique-items/git_push.sh | 51 ++++ .../builds/with-unique-items/http/http.ts | 236 ++++++++++++++++++ .../http/isomorphic-fetch.ts | 32 +++ .../builds/with-unique-items/index.ts | 11 + .../builds/with-unique-items/middleware.ts | 66 +++++ .../models/ObjectSerializer.ts | 218 ++++++++++++++++ .../with-unique-items/models/Response.ts | 42 ++++ .../builds/with-unique-items/models/all.ts | 1 + .../builds/with-unique-items/package.json | 27 ++ .../builds/with-unique-items/rxjsStub.ts | 27 ++ .../builds/with-unique-items/servers.ts | 53 ++++ .../builds/with-unique-items/tsconfig.json | 29 +++ .../with-unique-items/types/ObjectParamAPI.ts | 27 ++ .../with-unique-items/types/ObservableAPI.ts | 45 ++++ .../with-unique-items/types/PromiseAPI.ts | 31 +++ .../builds/with-unique-items/util.ts | 37 +++ 32 files changed, 1373 insertions(+), 1 deletion(-) create mode 100644 bin/configs/typescript-with-unique-items.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/typescript/unique_items.yaml create mode 100644 samples/client/others/typescript/builds/with-unique-items/.gitignore create mode 100644 samples/client/others/typescript/builds/with-unique-items/.openapi-generator-ignore create mode 100644 samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES create mode 100644 samples/client/others/typescript/builds/with-unique-items/.openapi-generator/VERSION create mode 100644 samples/client/others/typescript/builds/with-unique-items/DefaultApi.md create mode 100644 samples/client/others/typescript/builds/with-unique-items/README.md create mode 100644 samples/client/others/typescript/builds/with-unique-items/apis/DefaultApi.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/apis/baseapi.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/apis/exception.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/auth/auth.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/configuration.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/git_push.sh create mode 100644 samples/client/others/typescript/builds/with-unique-items/http/http.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/http/isomorphic-fetch.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/index.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/middleware.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/models/Response.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/models/all.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/package.json create mode 100644 samples/client/others/typescript/builds/with-unique-items/rxjsStub.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/servers.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/tsconfig.json create mode 100644 samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts create mode 100644 samples/client/others/typescript/builds/with-unique-items/util.ts diff --git a/bin/configs/typescript-with-unique-items.yaml b/bin/configs/typescript-with-unique-items.yaml new file mode 100644 index 000000000000..ee21407df535 --- /dev/null +++ b/bin/configs/typescript-with-unique-items.yaml @@ -0,0 +1,4 @@ +generatorName: typescript +outputDir: samples/client/others/typescript/builds/with-unique-items +inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript/unique_items.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index 4ce5f1ba11a5..9d0e683f41a3 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -66,6 +66,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • Long
  • Map
  • Object
  • +
  • Set
  • String
  • any
  • boolean
  • diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java index 51cc382c09d8..f6fa5c0050d6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java @@ -143,7 +143,8 @@ public TypeScriptClientCodegen() { "any", "File", "Error", - "Map" + "Map", + "Set" )); languageGenericTypes = new HashSet<>(Arrays.asList( @@ -169,6 +170,8 @@ public TypeScriptClientCodegen() { typeMapping.put("integer", "number"); typeMapping.put("Map", "any"); typeMapping.put("map", "any"); + typeMapping.put("Set", "Set"); + typeMapping.put("set", "Set"); typeMapping.put("date", "string"); typeMapping.put("DateTime", "Date"); typeMapping.put("binary", "any"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java index 55c7b3b5efaa..3f632714d7ee 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java @@ -4,7 +4,9 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.media.*; +import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.TypeScriptClientCodegen; import org.openapitools.codegen.utils.ModelUtils; @@ -54,4 +56,23 @@ public void testComposedSchemasImportTypesIndividually() { Assert.assertEquals(operation.imports, Sets.newHashSet("Cat", "Dog")); } + @Test + public void testArrayWithUniqueItems() { + final Schema uniqueArray = new ArraySchema() + .items(new StringSchema()) + .uniqueItems(true); + final Schema model = new ObjectSchema() + .description("an object has an array with uniqueItems") + .addProperties("uniqueArray", uniqueArray) + .addRequiredItem("uniqueArray"); + + final DefaultCodegen codegen = new TypeScriptClientCodegen(); + final OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + codegen.setOpenAPI(openAPI); + + final CodegenModel codegenModel = codegen.fromModel("sample", model); + + Assert.assertFalse(codegenModel.imports.contains("Set")); + } + } diff --git a/modules/openapi-generator/src/test/resources/3_0/typescript/unique_items.yaml b/modules/openapi-generator/src/test/resources/3_0/typescript/unique_items.yaml new file mode 100644 index 000000000000..63512a20b432 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/typescript/unique_items.yaml @@ -0,0 +1,31 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample for uniqueItems +servers: + - url: http://localhost:3000 +paths: + /unique-items: + get: + operationId: unique_items + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Response' +components: + schemas: + Response: + type: object + properties: + non-unique-array: + type: array + items: + type: string + unique-array: + type: array + uniqueItems: true + items: + type: string diff --git a/samples/client/others/typescript/builds/with-unique-items/.gitignore b/samples/client/others/typescript/builds/with-unique-items/.gitignore new file mode 100644 index 000000000000..1521c8b7652b --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/.gitignore @@ -0,0 +1 @@ +dist diff --git a/samples/client/others/typescript/builds/with-unique-items/.openapi-generator-ignore b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES new file mode 100644 index 000000000000..c1e2d850dd8b --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES @@ -0,0 +1,24 @@ +.gitignore +DefaultApi.md +README.md +apis/DefaultApi.ts +apis/baseapi.ts +apis/exception.ts +auth/auth.ts +configuration.ts +git_push.sh +http/http.ts +http/isomorphic-fetch.ts +index.ts +middleware.ts +models/ObjectSerializer.ts +models/Response.ts +models/all.ts +package.json +rxjsStub.ts +servers.ts +tsconfig.json +types/ObjectParamAPI.ts +types/ObservableAPI.ts +types/PromiseAPI.ts +util.ts diff --git a/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/VERSION b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/VERSION new file mode 100644 index 000000000000..5f68295fc196 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/others/typescript/builds/with-unique-items/DefaultApi.md b/samples/client/others/typescript/builds/with-unique-items/DefaultApi.md new file mode 100644 index 000000000000..8c21f808c3db --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/DefaultApi.md @@ -0,0 +1,57 @@ +# .DefaultApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**uniqueItems**](DefaultApi.md#uniqueItems) | **GET** /unique-items | + + +# **uniqueItems** +> Response uniqueItems() + + +### Example + + +```typescript +import { } from ''; +import * as fs from 'fs'; + +const configuration = .createConfiguration(); +const apiInstance = new .DefaultApi(configuration); + +let body:any = {}; + +apiInstance.uniqueItems(body).then((data:any) => { + console.log('API called successfully. Returned data: ' + data); +}).catch((error:any) => console.error(error)); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +**Response** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/client/others/typescript/builds/with-unique-items/README.md b/samples/client/others/typescript/builds/with-unique-items/README.md new file mode 100644 index 000000000000..55d394653b91 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/README.md @@ -0,0 +1,30 @@ +## @ + +This generator creates TypeScript/JavaScript client that utilizes fetch-api. + +### Building + +To build and compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run ```npm publish``` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install @ --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save diff --git a/samples/client/others/typescript/builds/with-unique-items/apis/DefaultApi.ts b/samples/client/others/typescript/builds/with-unique-items/apis/DefaultApi.ts new file mode 100644 index 000000000000..8a5468e0d621 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/apis/DefaultApi.ts @@ -0,0 +1,73 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { Response } from '../models/Response'; + +/** + * no description + */ +export class DefaultApiRequestFactory extends BaseAPIRequestFactory { + + /** + */ + public async uniqueItems(_options?: Configuration): Promise { + let _config = _options || this.configuration; + + // Path Params + const localVarPath = '/unique-items'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class DefaultApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to uniqueItems + * @throws ApiException if the response code was not in [200, 299] + */ + public async uniqueItems(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: Response = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Response", "" + ) as Response; + return body; + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: Response = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Response", "" + ) as Response; + return body; + } + + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + } + +} diff --git a/samples/client/others/typescript/builds/with-unique-items/apis/baseapi.ts b/samples/client/others/typescript/builds/with-unique-items/apis/baseapi.ts new file mode 100644 index 000000000000..ce1e2dbc47e1 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/apis/baseapi.ts @@ -0,0 +1,37 @@ +import { Configuration } from '../configuration' + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPIRequestFactory { + + constructor(protected configuration: Configuration) { + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public api: string, public method: string, public field: string) { + super("Required parameter " + field + " was null or undefined when calling " + api + "." + method + "."); + } +} diff --git a/samples/client/others/typescript/builds/with-unique-items/apis/exception.ts b/samples/client/others/typescript/builds/with-unique-items/apis/exception.ts new file mode 100644 index 000000000000..9365d33a8f7e --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/apis/exception.ts @@ -0,0 +1,15 @@ +/** + * Represents an error caused by an api call i.e. it has attributes for a HTTP status code + * and the returned body object. + * + * Example + * API returns a ErrorMessageObject whenever HTTP status code is not in [200, 299] + * => ApiException(404, someErrorMessageObject) + * + */ +export class ApiException extends Error { + public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) { + super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " + + JSON.stringify(headers)) + } +} diff --git a/samples/client/others/typescript/builds/with-unique-items/auth/auth.ts b/samples/client/others/typescript/builds/with-unique-items/auth/auth.ts new file mode 100644 index 000000000000..49340932e11b --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/auth/auth.ts @@ -0,0 +1,52 @@ +// typings for btoa are incorrect +import { RequestContext } from "../http/http"; + +/** + * Interface authentication schemes. + */ +export interface SecurityAuthentication { + /* + * @return returns the name of the security authentication as specified in OAI + */ + getName(): string; + + /** + * Applies the authentication scheme to the request context + * + * @params context the request context which should use this authentication scheme + */ + applySecurityAuthentication(context: RequestContext): void | Promise; +} + +export interface TokenProvider { + getToken(): Promise | string; +} + + +export type AuthMethods = { + "default"?: SecurityAuthentication, +} + +export type ApiKeyConfiguration = string; +export type HttpBasicConfiguration = { "username": string, "password": string }; +export type HttpBearerConfiguration = { tokenProvider: TokenProvider }; +export type OAuth2Configuration = { accessToken: string }; + +export type AuthMethodsConfiguration = { + "default"?: SecurityAuthentication, +} + +/** + * Creates the authentication methods from a swagger description. + * + */ +export function configureAuthMethods(config: AuthMethodsConfiguration | undefined): AuthMethods { + let authMethods: AuthMethods = {} + + if (!config) { + return authMethods; + } + authMethods["default"] = config["default"] + + return authMethods; +} \ No newline at end of file diff --git a/samples/client/others/typescript/builds/with-unique-items/configuration.ts b/samples/client/others/typescript/builds/with-unique-items/configuration.ts new file mode 100644 index 000000000000..b78d85972a4a --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/configuration.ts @@ -0,0 +1,66 @@ +import { HttpLibrary } from "./http/http"; +import { Middleware, PromiseMiddleware, PromiseMiddlewareWrapper } from "./middleware"; +import { IsomorphicFetchHttpLibrary as DefaultHttpLibrary } from "./http/isomorphic-fetch"; +import { BaseServerConfiguration, server1 } from "./servers"; +import { configureAuthMethods, AuthMethods, AuthMethodsConfiguration } from "./auth/auth"; + +export interface Configuration { + readonly baseServer: BaseServerConfiguration; + readonly httpApi: HttpLibrary; + readonly middleware: Middleware[]; + readonly authMethods: AuthMethods; +} + + +/** + * Interface with which a configuration object can be configured. + */ +export interface ConfigurationParameters { + /** + * Default server to use + */ + baseServer?: BaseServerConfiguration; + /** + * HTTP library to use e.g. IsomorphicFetch + */ + httpApi?: HttpLibrary; + /** + * The middlewares which will be applied to requests and responses + */ + middleware?: Middleware[]; + /** + * Configures all middlewares using the promise api instead of observables (which Middleware uses) + */ + promiseMiddleware?: PromiseMiddleware[]; + /** + * Configuration for the available authentication methods + */ + authMethods?: AuthMethodsConfiguration +} + +/** + * Configuration factory function + * + * If a property is not included in conf, a default is used: + * - baseServer: server1 + * - httpApi: IsomorphicFetchHttpLibrary + * - middleware: [] + * - promiseMiddleware: [] + * - authMethods: {} + * + * @param conf partial configuration + */ +export function createConfiguration(conf: ConfigurationParameters = {}): Configuration { + const configuration: Configuration = { + baseServer: conf.baseServer !== undefined ? conf.baseServer : server1, + httpApi: conf.httpApi || new DefaultHttpLibrary(), + middleware: conf.middleware || [], + authMethods: configureAuthMethods(conf.authMethods) + }; + if (conf.promiseMiddleware) { + conf.promiseMiddleware.forEach( + m => configuration.middleware.push(new PromiseMiddlewareWrapper(m)) + ); + } + return configuration; +} \ No newline at end of file diff --git a/samples/client/others/typescript/builds/with-unique-items/git_push.sh b/samples/client/others/typescript/builds/with-unique-items/git_push.sh new file mode 100644 index 000000000000..b253029754ed --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/git_push.sh @@ -0,0 +1,51 @@ +#!/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" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + 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://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@github.com/${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://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/others/typescript/builds/with-unique-items/http/http.ts b/samples/client/others/typescript/builds/with-unique-items/http/http.ts new file mode 100644 index 000000000000..f19e206b19ff --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/http/http.ts @@ -0,0 +1,236 @@ +// typings of url-parse are incorrect... +// @ts-ignore +import * as URLParse from "url-parse"; +import { Observable, from } from '../rxjsStub'; + +export * from './isomorphic-fetch'; + +/** + * Represents an HTTP method. + */ +export enum HttpMethod { + GET = "GET", + HEAD = "HEAD", + POST = "POST", + PUT = "PUT", + DELETE = "DELETE", + CONNECT = "CONNECT", + OPTIONS = "OPTIONS", + TRACE = "TRACE", + PATCH = "PATCH" +} + +/** + * Represents an HTTP file which will be transferred from or to a server. + */ +export type HttpFile = Blob & { readonly name: string }; + + +export class HttpException extends Error { + public constructor(msg: string) { + super(msg); + } +} + +/** + * Represents the body of an outgoing HTTP request. + */ +export type RequestBody = undefined | string | FormData | URLSearchParams; + +/** + * Represents an HTTP request context + */ +export class RequestContext { + private headers: { [key: string]: string } = {}; + private body: RequestBody = undefined; + private url: URLParse; + + /** + * Creates the request context using a http method and request resource url + * + * @param url url of the requested resource + * @param httpMethod http method + */ + public constructor(url: string, private httpMethod: HttpMethod) { + this.url = new URLParse(url, true); + } + + /* + * Returns the url set in the constructor including the query string + * + */ + public getUrl(): string { + return this.url.toString(); + } + + /** + * Replaces the url set in the constructor with this url. + * + */ + public setUrl(url: string) { + this.url = new URLParse(url, true); + } + + /** + * Sets the body of the http request either as a string or FormData + * + * Note that setting a body on a HTTP GET, HEAD, DELETE, CONNECT or TRACE + * request is discouraged. + * https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#rfc.section.7.3.1 + * + * @param body the body of the request + */ + public setBody(body: RequestBody) { + this.body = body; + } + + public getHttpMethod(): HttpMethod { + return this.httpMethod; + } + + public getHeaders(): { [key: string]: string } { + return this.headers; + } + + public getBody(): RequestBody { + return this.body; + } + + public setQueryParam(name: string, value: string) { + let queryObj = this.url.query; + queryObj[name] = value; + this.url.set("query", queryObj); + } + + /** + * Sets a cookie with the name and value. NO check for duplicate cookies is performed + * + */ + public addCookie(name: string, value: string): void { + if (!this.headers["Cookie"]) { + this.headers["Cookie"] = ""; + } + this.headers["Cookie"] += name + "=" + value + "; "; + } + + public setHeaderParam(key: string, value: string): void { + this.headers[key] = value; + } +} + +export interface ResponseBody { + text(): Promise; + binary(): Promise; +} + +/** + * Helper class to generate a `ResponseBody` from binary data + */ +export class SelfDecodingBody implements ResponseBody { + constructor(private dataSource: Promise) {} + + binary(): Promise { + return this.dataSource; + } + + async text(): Promise { + const data: Blob = await this.dataSource; + // @ts-ignore + if (data.text) { + // @ts-ignore + return data.text(); + } + + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.addEventListener("load", () => resolve(reader.result as string)); + reader.addEventListener("error", () => reject(reader.error)); + reader.readAsText(data); + }); + } +} + +export class ResponseContext { + public constructor( + public httpStatusCode: number, + public headers: { [key: string]: string }, + public body: ResponseBody + ) {} + + /** + * Parse header value in the form `value; param1="value1"` + * + * E.g. for Content-Type or Content-Disposition + * Parameter names are converted to lower case + * The first parameter is returned with the key `""` + */ + public getParsedHeader(headerName: string): { [parameter: string]: string } { + const result: { [parameter: string]: string } = {}; + if (!this.headers[headerName]) { + return result; + } + + const parameters = this.headers[headerName].split(";"); + for (const parameter of parameters) { + let [key, value] = parameter.split("=", 2); + key = key.toLowerCase().trim(); + if (value === undefined) { + result[""] = key; + } else { + value = value.trim(); + if (value.startsWith('"') && value.endsWith('"')) { + value = value.substring(1, value.length - 1); + } + result[key] = value; + } + } + return result; + } + + public async getBodyAsFile(): Promise { + const data = await this.body.binary(); + const fileName = this.getParsedHeader("content-disposition")["filename"] || ""; + const contentType = this.headers["content-type"] || ""; + try { + return new File([data], fileName, { type: contentType }); + } catch (error) { + /** Fallback for when the File constructor is not available */ + return Object.assign(data, { + name: fileName, + type: contentType + }); + } + } + + /** + * Use a heuristic to get a body of unknown data structure. + * Return as string if possible, otherwise as binary. + */ + public getBodyAsAny(): Promise { + try { + return this.body.text(); + } catch {} + + try { + return this.body.binary(); + } catch {} + + return Promise.resolve(undefined); + } +} + +export interface HttpLibrary { + send(request: RequestContext): Observable; +} + +export interface PromiseHttpLibrary { + send(request: RequestContext): Promise; +} + +export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLibrary { + return { + send(request: RequestContext): Observable { + return from(promiseHttpLibrary.send(request)); + } + } +} diff --git a/samples/client/others/typescript/builds/with-unique-items/http/isomorphic-fetch.ts b/samples/client/others/typescript/builds/with-unique-items/http/isomorphic-fetch.ts new file mode 100644 index 000000000000..3af85f3d902c --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/http/isomorphic-fetch.ts @@ -0,0 +1,32 @@ +import {HttpLibrary, RequestContext, ResponseContext} from './http'; +import { from, Observable } from '../rxjsStub'; +import "whatwg-fetch"; + +export class IsomorphicFetchHttpLibrary implements HttpLibrary { + + public send(request: RequestContext): Observable { + let method = request.getHttpMethod().toString(); + let body = request.getBody(); + + const resultPromise = fetch(request.getUrl(), { + method: method, + body: body as any, + headers: request.getHeaders(), + credentials: "same-origin" + }).then((resp: any) => { + const headers: { [name: string]: string } = {}; + resp.headers.forEach((value: string, name: string) => { + headers[name] = value; + }); + + const body = { + text: () => resp.text(), + binary: () => resp.blob() + }; + return new ResponseContext(resp.status, headers, body); + }); + + return from>(resultPromise); + + } +} diff --git a/samples/client/others/typescript/builds/with-unique-items/index.ts b/samples/client/others/typescript/builds/with-unique-items/index.ts new file mode 100644 index 000000000000..127f89d99723 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/index.ts @@ -0,0 +1,11 @@ +export * from "./http/http"; +export * from "./auth/auth"; +export * from "./models/all"; +export { createConfiguration } from "./configuration" +export { Configuration } from "./configuration" +export * from "./apis/exception"; +export * from "./servers"; + +export { PromiseMiddleware as Middleware } from './middleware'; +export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI'; + diff --git a/samples/client/others/typescript/builds/with-unique-items/middleware.ts b/samples/client/others/typescript/builds/with-unique-items/middleware.ts new file mode 100644 index 000000000000..524f93f016b2 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/middleware.ts @@ -0,0 +1,66 @@ +import {RequestContext, ResponseContext} from './http/http'; +import { Observable, from } from './rxjsStub'; + +/** + * Defines the contract for a middleware intercepting requests before + * they are sent (but after the RequestContext was created) + * and before the ResponseContext is unwrapped. + * + */ +export interface Middleware { + /** + * Modifies the request before the request is sent. + * + * @param context RequestContext of a request which is about to be sent to the server + * @returns an observable of the updated request context + * + */ + pre(context: RequestContext): Observable; + /** + * Modifies the returned response before it is deserialized. + * + * @param context ResponseContext of a sent request + * @returns an observable of the modified response context + */ + post(context: ResponseContext): Observable; +} + +export class PromiseMiddlewareWrapper implements Middleware { + + public constructor(private middleware: PromiseMiddleware) { + + } + + pre(context: RequestContext): Observable { + return from(this.middleware.pre(context)); + } + + post(context: ResponseContext): Observable { + return from(this.middleware.post(context)); + } + +} + +/** + * Defines the contract for a middleware intercepting requests before + * they are sent (but after the RequestContext was created) + * and before the ResponseContext is unwrapped. + * + */ +export interface PromiseMiddleware { + /** + * Modifies the request before the request is sent. + * + * @param context RequestContext of a request which is about to be sent to the server + * @returns an observable of the updated request context + * + */ + pre(context: RequestContext): Promise; + /** + * Modifies the returned response before it is deserialized. + * + * @param context ResponseContext of a sent request + * @returns an observable of the modified response context + */ + post(context: ResponseContext): Promise; +} diff --git a/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts b/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts new file mode 100644 index 000000000000..63ab4090903d --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts @@ -0,0 +1,218 @@ +export * from './Response'; + +import { Response } from './Response'; + +/* tslint:disable:no-unused-variable */ +let primitives = [ + "string", + "boolean", + "double", + "integer", + "long", + "float", + "number", + "any" + ]; + +const supportedMediaTypes: { [mediaType: string]: number } = { + "application/json": Infinity, + "application/octet-stream": 0, + "application/x-www-form-urlencoded": 0 +} + + +let enumsMap: Set = new Set([ +]); + +let typeMap: {[index: string]: any} = { + "Response": Response, +} + +export class ObjectSerializer { + public static findCorrectType(data: any, expectedType: string) { + if (data == undefined) { + return expectedType; + } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { + return expectedType; + } else if (expectedType === "Date") { + return expectedType; + } else { + if (enumsMap.has(expectedType)) { + return expectedType; + } + + if (!typeMap[expectedType]) { + return expectedType; // w/e we don't know the type + } + + // Check the discriminator + let discriminatorProperty = typeMap[expectedType].discriminator; + if (discriminatorProperty == null) { + return expectedType; // the type does not have a discriminator. use it. + } else { + if (data[discriminatorProperty]) { + var discriminatorType = data[discriminatorProperty]; + if(typeMap[discriminatorType]){ + return discriminatorType; // use the type given in the discriminator + } else { + return expectedType; // discriminator did not map to a type + } + } else { + return expectedType; // discriminator was not present (or an empty string) + } + } + } + } + + public static serialize(data: any, type: string, format: string) { + if (data == undefined) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 + let subType: string = type.replace("Array<", ""); // Array => Type> + subType = subType.substring(0, subType.length - 1); // Type> => Type + let transformedData: any[] = []; + for (let index in data) { + let date = data[index]; + transformedData.push(ObjectSerializer.serialize(date, subType, format)); + } + return transformedData; + } else if (type === "Date") { + if (format == "date") { + let month = data.getMonth()+1 + month = month < 10 ? "0" + month.toString() : month.toString() + let day = data.getDate(); + day = day < 10 ? "0" + day.toString() : day.toString(); + + return data.getFullYear() + "-" + month + "-" + day; + } else { + return data.toISOString(); + } + } else { + if (enumsMap.has(type)) { + return data; + } + if (!typeMap[type]) { // in case we dont know the type + return data; + } + + // Get the actual type of this object + type = this.findCorrectType(data, type); + + // get the map for the correct type. + let attributeTypes = typeMap[type].getAttributeTypeMap(); + let instance: {[index: string]: any} = {}; + for (let index in attributeTypes) { + let attributeType = attributeTypes[index]; + instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type, attributeType.format); + } + return instance; + } + } + + public static deserialize(data: any, type: string, format: string) { + // polymorphism may change the actual type. + type = ObjectSerializer.findCorrectType(data, type); + if (data == undefined) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 + let subType: string = type.replace("Array<", ""); // Array => Type> + subType = subType.substring(0, subType.length - 1); // Type> => Type + let transformedData: any[] = []; + for (let index in data) { + let date = data[index]; + transformedData.push(ObjectSerializer.deserialize(date, subType, format)); + } + return transformedData; + } else if (type === "Date") { + return new Date(data); + } else { + if (enumsMap.has(type)) {// is Enum + return data; + } + + if (!typeMap[type]) { // dont know the type + return data; + } + let instance = new typeMap[type](); + let attributeTypes = typeMap[type].getAttributeTypeMap(); + for (let index in attributeTypes) { + let attributeType = attributeTypes[index]; + instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type, attributeType.format); + } + return instance; + } + } + + + /** + * Normalize media type + * + * We currently do not handle any media types attributes, i.e. anything + * after a semicolon. All content is assumed to be UTF-8 compatible. + */ + public static normalizeMediaType(mediaType: string | undefined): string | undefined { + if (mediaType === undefined) { + return undefined; + } + return mediaType.split(";")[0].trim().toLowerCase(); + } + + /** + * From a list of possible media types, choose the one we can handle best. + * + * The order of the given media types does not have any impact on the choice + * made. + */ + public static getPreferredMediaType(mediaTypes: Array): string { + /** According to OAS 3 we should default to json */ + if (!mediaTypes) { + return "application/json"; + } + + const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); + let selectedMediaType: string | undefined = undefined; + let selectedRank: number = -Infinity; + for (const mediaType of normalMediaTypes) { + if (supportedMediaTypes[mediaType!] > selectedRank) { + selectedMediaType = mediaType; + selectedRank = supportedMediaTypes[mediaType!]; + } + } + + if (selectedMediaType === undefined) { + throw new Error("None of the given media types are supported: " + mediaTypes.join(", ")); + } + + return selectedMediaType!; + } + + /** + * Convert data to a string according the given media type + */ + public static stringify(data: any, mediaType: string): string { + if (mediaType === "application/json") { + return JSON.stringify(data); + } + + throw new Error("The mediaType " + mediaType + " is not supported by ObjectSerializer.stringify."); + } + + /** + * Parse data from a string according to the given media type + */ + public static parse(rawData: string, mediaType: string | undefined) { + if (mediaType === undefined) { + throw new Error("Cannot parse content. No Content-Type defined."); + } + + if (mediaType === "application/json") { + return JSON.parse(rawData); + } + + throw new Error("The mediaType " + mediaType + " is not supported by ObjectSerializer.parse."); + } +} diff --git a/samples/client/others/typescript/builds/with-unique-items/models/Response.ts b/samples/client/others/typescript/builds/with-unique-items/models/Response.ts new file mode 100644 index 000000000000..6a53fbd9f9d0 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/models/Response.ts @@ -0,0 +1,42 @@ +/** + * Sample for uniqueItems + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class Response { + 'nonUniqueArray'?: Array; + 'uniqueArray'?: Set; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "nonUniqueArray", + "baseName": "non-unique-array", + "type": "Array", + "format": "" + }, + { + "name": "uniqueArray", + "baseName": "unique-array", + "type": "Set", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Response.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/samples/client/others/typescript/builds/with-unique-items/models/all.ts b/samples/client/others/typescript/builds/with-unique-items/models/all.ts new file mode 100644 index 000000000000..1497e2a37bd1 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/models/all.ts @@ -0,0 +1 @@ +export * from './Response' diff --git a/samples/client/others/typescript/builds/with-unique-items/package.json b/samples/client/others/typescript/builds/with-unique-items/package.json new file mode 100644 index 000000000000..b5bc9412dfe3 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/package.json @@ -0,0 +1,27 @@ +{ + "name": "", + "version": "", + "description": "OpenAPI client for ", + "author": "OpenAPI-Generator Contributors", + "keywords": [ + "fetch", + "typescript", + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "build": "tsc", + "prepare": "npm run build" + }, + "dependencies": { + "whatwg-fetch": "^3.0.0", + "es6-promise": "^4.2.4", + "url-parse": "^1.4.3" + }, + "devDependencies": { + "typescript": "^3.9.3" + } +} diff --git a/samples/client/others/typescript/builds/with-unique-items/rxjsStub.ts b/samples/client/others/typescript/builds/with-unique-items/rxjsStub.ts new file mode 100644 index 000000000000..4c73715a2486 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/rxjsStub.ts @@ -0,0 +1,27 @@ +export class Observable { + constructor(private promise: Promise) {} + + toPromise() { + return this.promise; + } + + pipe(callback: (value: T) => S | Promise): Observable { + return new Observable(this.promise.then(callback)); + } +} + +export function from(promise: Promise) { + return new Observable(promise); +} + +export function of(value: T) { + return new Observable(Promise.resolve(value)); +} + +export function mergeMap(callback: (value: T) => Observable) { + return (value: T) => callback(value).toPromise(); +} + +export function map(callback: any) { + return callback; +} diff --git a/samples/client/others/typescript/builds/with-unique-items/servers.ts b/samples/client/others/typescript/builds/with-unique-items/servers.ts new file mode 100644 index 000000000000..9a2af09e84f4 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/servers.ts @@ -0,0 +1,53 @@ +import { RequestContext, HttpMethod } from "./http/http"; + +export interface BaseServerConfiguration { + makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext; +} + +/** + * + * Represents the configuration of a server including its + * url template and variable configuration based on the url. + * + */ +export class ServerConfiguration implements BaseServerConfiguration { + public constructor(private url: string, private variableConfiguration: T) {} + + /** + * Sets the value of the variables of this server. + * + * @param variableConfiguration a partial variable configuration for the variables contained in the url + */ + public setVariables(variableConfiguration: Partial) { + Object.assign(this.variableConfiguration, variableConfiguration); + } + + public getConfiguration(): T { + return this.variableConfiguration + } + + private getUrl() { + let replacedUrl = this.url; + for (const key in this.variableConfiguration) { + var re = new RegExp("{" + key + "}","g"); + replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]); + } + return replacedUrl + } + + /** + * Creates a new request context for this server using the url with variables + * replaced with their respective values and the endpoint of the request appended. + * + * @param endpoint the endpoint to be queried on the server + * @param httpMethod httpMethod to be used + * + */ + public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext { + return new RequestContext(this.getUrl() + endpoint, httpMethod); + } +} + +export const server1 = new ServerConfiguration<{ }>("http://localhost:3000", { }) + +export const servers = [server1]; diff --git a/samples/client/others/typescript/builds/with-unique-items/tsconfig.json b/samples/client/others/typescript/builds/with-unique-items/tsconfig.json new file mode 100644 index 000000000000..6576215ef877 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + /* Additional Checks */ + "noUnusedLocals": false, /* Report errors on unused locals. */ // TODO: reenable (unused imports!) + "noUnusedParameters": false, /* Report errors on unused parameters. */ // TODO: set to true again + "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "lib": [ "es6", "dom" ], + }, + "exclude": [ + "dist", + "node_modules" + ], + "filesGlob": [ + "./**/*.ts", + ] +} diff --git a/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts new file mode 100644 index 000000000000..e2a0f69d78f3 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts @@ -0,0 +1,27 @@ +import { ResponseContext, RequestContext, HttpFile } from '../http/http'; +import * as models from '../models/all'; +import { Configuration} from '../configuration' + +import { Response } from '../models/Response'; + +import { ObservableDefaultApi } from "./ObservableAPI"; +import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi"; + +export interface DefaultApiUniqueItemsRequest { +} + +export class ObjectDefaultApi { + private api: ObservableDefaultApi + + public constructor(configuration: Configuration, requestFactory?: DefaultApiRequestFactory, responseProcessor?: DefaultApiResponseProcessor) { + this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor); + } + + /** + * @param param the request object + */ + public uniqueItems(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration): Promise { + return this.api.uniqueItems( options).toPromise(); + } + +} diff --git a/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts new file mode 100644 index 000000000000..42726c3f3d1a --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts @@ -0,0 +1,45 @@ +import { ResponseContext, RequestContext, HttpFile } from '../http/http'; +import * as models from '../models/all'; +import { Configuration} from '../configuration' +import { Observable, of, from } from '../rxjsStub'; +import {mergeMap, map} from '../rxjsStub'; +import { Response } from '../models/Response'; + +import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi"; +export class ObservableDefaultApi { + private requestFactory: DefaultApiRequestFactory; + private responseProcessor: DefaultApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DefaultApiRequestFactory, + responseProcessor?: DefaultApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DefaultApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DefaultApiResponseProcessor(); + } + + /** + */ + public uniqueItems(_options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.uniqueItems(_options); + + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (let middleware of this.configuration.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (let middleware of this.configuration.middleware) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uniqueItems(rsp))); + })); + } + +} diff --git a/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts new file mode 100644 index 000000000000..6df624fc4a29 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts @@ -0,0 +1,31 @@ +import { ResponseContext, RequestContext, HttpFile } from '../http/http'; +import * as models from '../models/all'; +import { Configuration} from '../configuration' + +import { Response } from '../models/Response'; +import { ObservableDefaultApi } from './ObservableAPI'; + +import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi"; +export class PromiseDefaultApi { + private api: ObservableDefaultApi + + public constructor( + configuration: Configuration, + requestFactory?: DefaultApiRequestFactory, + responseProcessor?: DefaultApiResponseProcessor + ) { + this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor); + } + + /** + */ + public uniqueItems(_options?: Configuration): Promise { + const result = this.api.uniqueItems(_options); + return result.toPromise(); + } + + +} + + + diff --git a/samples/client/others/typescript/builds/with-unique-items/util.ts b/samples/client/others/typescript/builds/with-unique-items/util.ts new file mode 100644 index 000000000000..96ea3dfdc770 --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/util.ts @@ -0,0 +1,37 @@ +/** + * Returns if a specific http code is in a given code range + * where the code range is defined as a combination of digits + * and "X" (the letter X) with a length of 3 + * + * @param codeRange string with length 3 consisting of digits and "X" (the letter X) + * @param code the http status code to be checked against the code range + */ +export function isCodeInRange(codeRange: string, code: number): boolean { + // This is how the default value is encoded in OAG + if (codeRange === "0") { + return true; + } + if (codeRange == code.toString()) { + return true; + } else { + const codeString = code.toString(); + if (codeString.length != codeRange.length) { + return false; + } + for (let i = 0; i < codeString.length; i++) { + if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) { + return false; + } + } + return true; + } +} + +/** +* Returns if it can consume form +* +* @param consumes array +*/ +export function canConsumeForm(contentTypes: string[]): boolean { + return contentTypes.indexOf('multipart/form-data') !== -1 +} From 6cf4e79f1454c4cc4af329132e16a980c6ba8a2c Mon Sep 17 00:00:00 2001 From: Justin Black Date: Fri, 4 Feb 2022 10:47:16 -0500 Subject: [PATCH 005/111] [python-experimental] adds missing bases, performance improvements (#11517) * Adds bases for int32, int64, float32, and float64 * Samples updated * Removes print statements * When creating properties and items do not call _from_openapi_data or model __new__ * Update speed improvement * cast_to_allowed_types speeed improvements * _get_new_instance_without_conversion order swap for speed * Fixes test errors * Small fixes about path_to_schemas --- .../imports_schema_types.handlebars | 4 + .../python-experimental/schemas.handlebars | 112 ++++++++++-------- .../call_123_test_special_tags.py | 4 + .../api/default_api_endpoints/foo_get.py | 4 + ...ditional_properties_with_array_of_enums.py | 4 + .../api/fake_api_endpoints/array_model.py | 4 + .../api/fake_api_endpoints/array_of_enums.py | 4 + .../body_with_file_schema.py | 4 + .../body_with_query_params.py | 4 + .../api/fake_api_endpoints/boolean.py | 4 + .../case_sensitive_params.py | 4 + .../api/fake_api_endpoints/client_model.py | 4 + .../composed_one_of_different_types.py | 4 + .../fake_api_endpoints/endpoint_parameters.py | 4 + .../api/fake_api_endpoints/enum_parameters.py | 4 + .../api/fake_api_endpoints/fake_health_get.py | 4 + .../fake_api_endpoints/group_parameters.py | 4 + .../inline_additional_properties.py | 4 + .../fake_api_endpoints/inline_composition.py | 4 + .../api/fake_api_endpoints/json_form_data.py | 4 + .../api/fake_api_endpoints/mammal.py | 4 + .../number_with_validations.py | 4 + .../object_model_with_ref_props.py | 4 + .../parameter_collisions.py | 4 + .../query_parameter_collection_format.py | 4 + .../api/fake_api_endpoints/string.py | 4 + .../api/fake_api_endpoints/string_enum.py | 4 + .../upload_download_file.py | 4 + .../api/fake_api_endpoints/upload_file.py | 4 + .../api/fake_api_endpoints/upload_files.py | 4 + .../classname.py | 4 + .../api/pet_api_endpoints/add_pet.py | 4 + .../api/pet_api_endpoints/delete_pet.py | 4 + .../pet_api_endpoints/find_pets_by_status.py | 4 + .../pet_api_endpoints/find_pets_by_tags.py | 4 + .../api/pet_api_endpoints/get_pet_by_id.py | 4 + .../api/pet_api_endpoints/update_pet.py | 4 + .../pet_api_endpoints/update_pet_with_form.py | 4 + .../upload_file_with_required_file.py | 4 + .../api/pet_api_endpoints/upload_image.py | 4 + .../api/store_api_endpoints/delete_order.py | 4 + .../api/store_api_endpoints/get_inventory.py | 4 + .../store_api_endpoints/get_order_by_id.py | 4 + .../api/store_api_endpoints/place_order.py | 4 + .../api/user_api_endpoints/create_user.py | 4 + .../create_users_with_array_input.py | 4 + .../create_users_with_list_input.py | 4 + .../api/user_api_endpoints/delete_user.py | 4 + .../user_api_endpoints/get_user_by_name.py | 4 + .../api/user_api_endpoints/login_user.py | 4 + .../api/user_api_endpoints/logout_user.py | 4 + .../api/user_api_endpoints/update_user.py | 4 + .../model/additional_properties_class.py | 4 + ...ditional_properties_with_array_of_enums.py | 4 + .../petstore_api/model/address.py | 4 + .../petstore_api/model/animal.py | 4 + .../petstore_api/model/animal_farm.py | 4 + .../petstore_api/model/api_response.py | 4 + .../petstore_api/model/apple.py | 4 + .../petstore_api/model/apple_req.py | 4 + .../model/array_holding_any_type.py | 4 + .../model/array_of_array_of_number_only.py | 4 + .../petstore_api/model/array_of_enums.py | 4 + .../model/array_of_number_only.py | 4 + .../petstore_api/model/array_test.py | 4 + .../model/array_with_validations_in_items.py | 4 + .../petstore_api/model/banana.py | 4 + .../petstore_api/model/banana_req.py | 4 + .../petstore_api/model/bar.py | 4 + .../petstore_api/model/basque_pig.py | 4 + .../petstore_api/model/boolean.py | 4 + .../petstore_api/model/boolean_enum.py | 4 + .../petstore_api/model/capitalization.py | 4 + .../petstore_api/model/cat.py | 4 + .../petstore_api/model/cat_all_of.py | 4 + .../petstore_api/model/category.py | 4 + .../petstore_api/model/child_cat.py | 4 + .../petstore_api/model/child_cat_all_of.py | 4 + .../petstore_api/model/class_model.py | 4 + .../petstore_api/model/client.py | 4 + .../model/complex_quadrilateral.py | 4 + .../model/complex_quadrilateral_all_of.py | 4 + ...d_any_of_different_types_no_validations.py | 4 + .../petstore_api/model/composed_array.py | 4 + .../petstore_api/model/composed_bool.py | 4 + .../petstore_api/model/composed_none.py | 4 + .../petstore_api/model/composed_number.py | 4 + .../petstore_api/model/composed_object.py | 4 + .../model/composed_one_of_different_types.py | 4 + .../petstore_api/model/composed_string.py | 4 + .../model/composition_in_property.py | 4 + .../petstore_api/model/currency.py | 4 + .../petstore_api/model/danish_pig.py | 4 + .../petstore_api/model/date_time_test.py | 4 + .../model/date_time_with_validations.py | 4 + .../model/date_with_validations.py | 4 + .../petstore_api/model/decimal_payload.py | 4 + .../petstore_api/model/dog.py | 4 + .../petstore_api/model/dog_all_of.py | 4 + .../petstore_api/model/drawing.py | 4 + .../petstore_api/model/enum_arrays.py | 4 + .../petstore_api/model/enum_class.py | 4 + .../petstore_api/model/enum_test.py | 4 + .../model/equilateral_triangle.py | 4 + .../model/equilateral_triangle_all_of.py | 4 + .../petstore_api/model/file.py | 4 + .../model/file_schema_test_class.py | 4 + .../petstore_api/model/foo.py | 4 + .../petstore_api/model/format_test.py | 4 + .../petstore_api/model/fruit.py | 4 + .../petstore_api/model/fruit_req.py | 4 + .../petstore_api/model/gm_fruit.py | 4 + .../petstore_api/model/grandparent_animal.py | 4 + .../petstore_api/model/has_only_read_only.py | 4 + .../petstore_api/model/health_check_result.py | 4 + .../model/inline_response_default.py | 4 + .../petstore_api/model/integer_enum.py | 4 + .../petstore_api/model/integer_enum_big.py | 4 + .../model/integer_enum_one_value.py | 4 + .../model/integer_enum_with_default_value.py | 4 + .../petstore_api/model/integer_max10.py | 4 + .../petstore_api/model/integer_min15.py | 4 + .../petstore_api/model/isosceles_triangle.py | 4 + .../model/isosceles_triangle_all_of.py | 4 + .../petstore_api/model/mammal.py | 4 + .../petstore_api/model/map_test.py | 4 + ...perties_and_additional_properties_class.py | 4 + .../petstore_api/model/model200_response.py | 4 + .../petstore_api/model/model_return.py | 4 + .../petstore_api/model/money.py | 4 + .../petstore_api/model/name.py | 4 + .../model/no_additional_properties.py | 4 + .../petstore_api/model/nullable_class.py | 4 + .../petstore_api/model/nullable_shape.py | 4 + .../petstore_api/model/nullable_string.py | 4 + .../petstore_api/model/number.py | 4 + .../petstore_api/model/number_only.py | 4 + .../model/number_with_validations.py | 4 + .../petstore_api/model/object_interface.py | 4 + .../model/object_model_with_ref_props.py | 4 + .../model/object_with_decimal_properties.py | 4 + .../object_with_difficultly_named_props.py | 4 + ...object_with_inline_composition_property.py | 4 + .../model/object_with_validations.py | 4 + .../petstore_api/model/order.py | 4 + .../petstore_api/model/parent_pet.py | 4 + .../petstore_api/model/pet.py | 4 + .../petstore_api/model/pig.py | 4 + .../petstore_api/model/player.py | 4 + .../petstore_api/model/quadrilateral.py | 4 + .../model/quadrilateral_interface.py | 4 + .../petstore_api/model/read_only_first.py | 4 + .../petstore_api/model/scalene_triangle.py | 4 + .../model/scalene_triangle_all_of.py | 4 + .../petstore_api/model/shape.py | 4 + .../petstore_api/model/shape_or_null.py | 4 + .../model/simple_quadrilateral.py | 4 + .../model/simple_quadrilateral_all_of.py | 4 + .../petstore_api/model/some_object.py | 4 + .../petstore_api/model/special_model_name.py | 4 + .../petstore_api/model/string.py | 4 + .../petstore_api/model/string_boolean_map.py | 4 + .../petstore_api/model/string_enum.py | 4 + .../model/string_enum_with_default_value.py | 4 + .../model/string_with_validation.py | 4 + .../petstore_api/model/tag.py | 4 + .../petstore_api/model/triangle.py | 4 + .../petstore_api/model/triangle_interface.py | 4 + .../petstore_api/model/user.py | 4 + .../petstore_api/model/whale.py | 4 + .../petstore_api/model/zebra.py | 4 + .../petstore_api/schemas.py | 112 ++++++++++-------- 172 files changed, 806 insertions(+), 98 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars index 38015e350440..3225819fd14d 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars @@ -30,6 +30,10 @@ from {{packageName}}.schemas import ( # noqa: F401 NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars index 9450487cb54b..15a4b7b32156 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars @@ -58,8 +58,12 @@ def update(d: dict, u: dict): Adds u to d Where each dict is defaultdict(set) """ + if not u: + return d for k, v in u.items(): - d[k] = d[k].union(v) + if not v: + continue + d[k] = d[k] | v return d @@ -210,7 +214,6 @@ class ValidatorBase: if (cls.__is_json_validation_enabled('uniqueItems', _instantiation_metadata.configuration) and 'unique_items' in validations and validations['unique_items'] and input_values): unique_items = [] - # print(validations) for item in input_values: if item not in unique_items: unique_items.append(item) @@ -775,25 +778,22 @@ class ListBase: cls_item_cls = getattr(cls, '_items', AnyTypeSchema) for i, value in enumerate(list_items): item_path_to_item = _instantiation_metadata.path_to_item+(i,) - if item_path_to_item in _instantiation_metadata.path_to_schemas: - item_cls = _instantiation_metadata.path_to_schemas[item_path_to_item] - else: + item_cls = _instantiation_metadata.path_to_schemas.get(item_path_to_item) + if item_cls is None: item_cls = cls_item_cls if isinstance(value, item_cls): cast_items.append(value) continue + item_instantiation_metadata = InstantiationMetadata( configuration=_instantiation_metadata.configuration, from_server=_instantiation_metadata.from_server, path_to_item=item_path_to_item, path_to_schemas=_instantiation_metadata.path_to_schemas, ) - - if _instantiation_metadata.from_server: - new_value = item_cls._from_openapi_data(value, _instantiation_metadata=item_instantiation_metadata) - else: - new_value = item_cls(value, _instantiation_metadata=item_instantiation_metadata) + new_value = item_cls._get_new_instance_without_conversion( + value, _instantiation_metadata=item_instantiation_metadata) cast_items.append(new_value) return cast_items @@ -932,7 +932,6 @@ class DictBase(Discriminable): ) other_path_to_schemas = schema._validate(value, _instantiation_metadata=arg_instantiation_metadata) update(path_to_schemas, other_path_to_schemas) - _instantiation_metadata.path_to_schemas.update(arg_instantiation_metadata.path_to_schemas) return path_to_schemas @classmethod @@ -1045,10 +1044,8 @@ class DictBase(Discriminable): path_to_item=property_path_to_item, path_to_schemas=_instantiation_metadata.path_to_schemas, ) - if _instantiation_metadata.from_server: - new_value = property_cls._from_openapi_data(value, _instantiation_metadata=prop_instantiation_metadata) - else: - new_value = property_cls(value, _instantiation_metadata=prop_instantiation_metadata) + new_value = property_cls._get_new_instance_without_conversion( + value, _instantiation_metadata=prop_instantiation_metadata) dict_items[property_name_js] = new_value return dict_items @@ -1063,11 +1060,9 @@ class DictBase(Discriminable): return self[name] except KeyError as ex: raise AttributeError(str(ex)) - # print(('non-frozendict __getattr__', name)) return super().__getattr__(self, name) def __getattribute__(self, name): - # print(('__getattribute__', name)) # if an attribute does exist (for example as a class property but not as an instance method) try: return self[name] @@ -1268,9 +1263,6 @@ class Schema: _instantiation_metadata.path_to_schemas and _instantiation_metadata.path_to_item in _instantiation_metadata.path_to_schemas): chosen_new_cls = _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] - # print('leaving __get_new_cls early for cls {} because path_to_schemas exists'.format(cls)) - # print(_instantiation_metadata.path_to_item) - # print(chosen_new_cls) return chosen_new_cls """ Dict property + List Item Assignment Use cases: @@ -1286,8 +1278,6 @@ class Schema: because value is of the correct type, and validation was run earlier when the instance was created """ _path_to_schemas = cls._validate(arg, _instantiation_metadata=_instantiation_metadata) - from pprint import pprint - pprint(dict(_path_to_schemas)) # loop through it make a new class for each entry for path, schema_classes in _path_to_schemas.items(): enum_schema = any( @@ -1318,7 +1308,6 @@ class Schema: continue # Use case: value is None, True, False, or an enum value - # print('choosing enum class for path {} in arg {}'.format(path, arg)) value = arg for key in path[1:]: value = value[key] @@ -1335,14 +1324,14 @@ class Schema: return _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] @classmethod - def __get_new_instance_without_conversion(cls, arg, _instantiation_metadata): + def _get_new_instance_without_conversion(cls, arg, _instantiation_metadata): # PATH 2 - we have a Dynamic class and we are making an instance of it - if issubclass(cls, tuple): - items = cls._get_items(arg, _instantiation_metadata=_instantiation_metadata) - return super(Schema, cls).__new__(cls, items) - elif issubclass(cls, frozendict): + if issubclass(cls, frozendict): properties = cls._get_properties(arg, _instantiation_metadata=_instantiation_metadata) return super(Schema, cls).__new__(cls, properties) + elif issubclass(cls, tuple): + items = cls._get_items(arg, _instantiation_metadata=_instantiation_metadata) + return super(Schema, cls).__new__(cls, items) """ str = openapi str, date, and datetime decimal.Decimal = openapi int and float @@ -1381,7 +1370,7 @@ class Schema: 'from_server must be True in this code path, if you need it to be False, use cls()' ) new_cls = cls.__get_new_cls(arg, _instantiation_metadata) - new_inst = new_cls.__get_new_instance_without_conversion(arg, _instantiation_metadata) + new_inst = new_cls._get_new_instance_without_conversion(arg, _instantiation_metadata) return new_inst @staticmethod @@ -1422,7 +1411,7 @@ class Schema: ) arg = cast_to_allowed_types(arg, from_server=_instantiation_metadata.from_server) new_cls = cls.__get_new_cls(arg, _instantiation_metadata) - return new_cls.__get_new_instance_without_conversion(arg, _instantiation_metadata) + return new_cls._get_new_instance_without_conversion(arg, _instantiation_metadata) def __init__( self, @@ -1448,21 +1437,16 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal int, float -> Decimal StrSchema will convert that to bytes and remember the encoding when we pass in str input """ - if isinstance(arg, (date, datetime)): - if not from_server: - return arg.isoformat() - # ApiTypeError will be thrown later by _validate_type + if isinstance(arg, str): return arg + elif type(arg) is dict or type(arg) is frozendict: + return frozendict({key: cast_to_allowed_types(val) for key, val in arg.items()}) elif isinstance(arg, bool): """ this check must come before isinstance(arg, (int, float)) because isinstance(True, int) is True """ return arg - elif isinstance(arg, decimal.Decimal): - return arg - elif isinstance(arg, int): - return decimal.Decimal(arg) elif isinstance(arg, float): decimal_from_float = decimal.Decimal(arg) if decimal_from_float.as_integer_ratio()[1] == 1: @@ -1470,7 +1454,18 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') return decimal.Decimal(str(decimal_from_float)+'.0') return decimal_from_float - elif isinstance(arg, str): + elif type(arg) is list or type(arg) is tuple: + return tuple([cast_to_allowed_types(item) for item in arg]) + elif isinstance(arg, int): + return decimal.Decimal(arg) + elif arg is None: + return arg + elif isinstance(arg, (date, datetime)): + if not from_server: + return arg.isoformat() + # ApiTypeError will be thrown later by _validate_type + return arg + elif isinstance(arg, decimal.Decimal): return arg elif isinstance(arg, bytes): return arg @@ -1478,12 +1473,6 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal if arg.closed: raise ApiValueError('Invalid file state; file is closed and must be open') return arg - elif type(arg) is list or type(arg) is tuple: - return tuple([cast_to_allowed_types(item) for item in arg]) - elif type(arg) is dict or type(arg) is frozendict: - return frozendict({key: cast_to_allowed_types(val) for key, val in arg.items() if val is not unset}) - elif arg is None: - return arg elif isinstance(arg, Schema): return arg raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) @@ -1772,30 +1761,49 @@ class IntSchema(IntBase, NumberSchema): return super().__new__(cls, arg, **kwargs) -class Int32Schema( +class Int32Base( _SchemaValidator( inclusive_minimum=decimal.Decimal(-2147483648), inclusive_maximum=decimal.Decimal(2147483647) ), +): + pass + + +class Int32Schema( + Int32Base, IntSchema ): pass -class Int64Schema( + +class Int64Base( _SchemaValidator( inclusive_minimum=decimal.Decimal(-9223372036854775808), inclusive_maximum=decimal.Decimal(9223372036854775807) ), +): + pass + + +class Int64Schema( + Int64Base, IntSchema ): pass -class Float32Schema( +class Float32Base( _SchemaValidator( inclusive_minimum=decimal.Decimal(-3.4028234663852886e+38), inclusive_maximum=decimal.Decimal(3.4028234663852886e+38) ), +): + pass + + +class Float32Schema( + Float32Base, NumberSchema ): @@ -1805,11 +1813,17 @@ class Float32Schema( return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) -class Float64Schema( +class Float64Base( _SchemaValidator( inclusive_minimum=decimal.Decimal(-1.7976931348623157E+308), inclusive_maximum=decimal.Decimal(1.7976931348623157E+308) ), +): + pass + + +class Float64Schema( + Float64Base, NumberSchema ): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py index eef7420a019a..d8e8700aed00 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py index c1a9e4213e08..2e7164b4db24 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py index 1958cd47e5fb..a980fc167748 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py index 466bb6bdeac1..c864cb57521e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py index 30eb23e2260d..581a2cf36b04 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py index 7d10197e7b97..14eb9ddd3553 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py index 185f737fd612..30ed8b1c8ff3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py index 27c385cf6d8c..3611abb2da57 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py index 8d33047b77b3..8a8e707648d2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py @@ -45,6 +45,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py index 32c09a60148a..be63bf5e8a4f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py index f18f635fbcba..cd997455196d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py index 5898d0608a23..639c85ec7819 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py index 9a0375a83d93..a3ac05fa5f07 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py index 321959bf07e0..e3970df11dde 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py index 77bce3d6270a..bab146a1f469 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py index 3dcf988a1b7f..47fb548b1f25 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py index 5a595a3fb3e6..1253597ad0a1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py index 917d5c7b7d73..aac637d1507f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py index 40880fd1b09c..8ac173426e32 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py index e24811186515..1826a74b2718 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py index 6e72d45b78db..77f4b3ad9756 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py index 4ec604dd98c8..e1606beb30e3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py index 8fd0b87cf6ca..4fef58c1548f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py @@ -45,6 +45,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py index f1dda7d9754b..318ab585f742 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py index 21d92e829df2..7dc15a2977b8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py index 73f707e268bf..77527a9eff31 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py index f39892210cbc..3dce641e4769 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py index 6be2c17a026c..2eed478036df 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py index 1ccf89e848c3..d4839bb9b699 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py index 802803633582..bc2b459c4c19 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py index afb30b580480..8f75bcbd8aa5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py index ac4b7f3ad8c2..c75db96db9bf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py index 5496b92cd55e..028f8d68d795 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py index 549fd2aa6fc2..ca6e4ae9f750 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py index fa1b5a1bb966..3c3578420ca6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py index 798b70c896a9..2961059c15b5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py index c137418e02d8..62404922a6fc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py index 10c595a21abd..53751178469a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py index 1c4269d277bf..2ed9303649cd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py @@ -45,6 +45,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py index 9daf61b0c088..a674b60efe4e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py index 99f9ecbb28f1..bf7861386a3d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py index ba961a9921ed..881f91dc5c48 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py index 7cc7494687db..7bf386a6936b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py index d3ae4f85df7c..22d7f23164a0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py index 81553c66598f..558f9086b3cf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py index f337efa34803..88b859ff00ba 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py @@ -45,6 +45,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py index fa01a3901198..9c5583d5c6d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py index 47447322ff0d..478b4869d829 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py index 99bcba58663f..b9aa62e0c2a6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py @@ -45,6 +45,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py index 472d3354b84e..37fed9bcf273 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py @@ -46,6 +46,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index 8301d14cf869..2c5686051176 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py index 90d612a857aa..c94a35d111be 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py index 95e55511dca4..4bcd72165671 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index f0dc6441d3e2..2e1a97f9ffa4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 2bb3d0259c81..be131584f2c3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py index 41f336ea8bcf..201a8188f58a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py index 05b8485a74d9..c85b60cf1ce3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py index df315c8bf1c4..5e423efafba6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py index 51e9aeeb603c..c2edbaeb0efa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index 06912cc2194c..b7e1221340d0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index 19af3dc1e9fd..e394fe933116 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index c2d568e4b808..7ff4a959c9cb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index 00d72319a69d..c94a91a879db 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py index 07b32f95f673..79a9aad5fd75 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py index 4cb4561abe22..fe60e91a7ba0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py index b7012234a08f..bf3fac7cb945 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py index 61b13533570b..81ce5b09a51f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py index f1e74bf1e463..bfff57cb0824 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py index 3f35ab6a6535..263bdbdcdd76 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py index cf75f7c9445b..c40292d6ee23 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py index e5987dc95595..1e9d2b12f8d4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index e0f0b0f20535..5bcbd3abdad7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index 82c20ec0769e..549885a2e27c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py index 9f92d2b3a38f..94a7ff0a0c3c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index 114bd2832d23..3d5cc122bfa1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index 791f3793cb54..c152c0f10605 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py index 37c5b23285bb..4f1e9ed14a54 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py index bc4ff7ffab38..a476e5d92c3b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index 422ae90d3b8b..5c1c3815296a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py index d24b43d5ed68..f91b041e09e1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py index 97f75c86ddac..bab2f27e022a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py index 8b20d7f09415..4582184e4653 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py index 5aa09239e140..3ea21ab42be9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py index 534e1ce01ca2..d6a1f7cced53 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py index c4e879ae995b..928f58b5bd80 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py index f7ba1546f97f..fe8ec7865805 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py index 0adf69e676ec..071e8b2febfe 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py index 6efeb9a7872f..86b17805c8a7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py index 38f4fb948ac5..49fc619cfc2c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py index 1fd715f3f145..af48c5f606b4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py index af29f5c9e7ab..938f8b4f88dc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py index 8b05311d14d4..fe399c0a759c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py index c4365f56e89c..d593ace1dec7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py index 364759f48e23..310dad4babf2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py index 99f1f2e47350..24c443deeb90 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index de0f9c174f33..f48bfc6fb33b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index b527aedf20b9..88c86c052618 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index d61f6b07be1e..4d61e721a6bb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index a3fb56284bdb..9ea913052e81 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index 45a9a512fc0e..17828f28029b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 7204328fc893..5f4fa186bc08 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index 9c433255529a..5e96fa2799fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py index 1e23482bd9c9..785966c5dda8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py index 3bb58da70670..c5c048042c91 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index f55669e69938..a6bf45a144b7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py index 47357f615881..3535312831d3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py index 4560f080ddde..4a5e0140489e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index 3fba42202fe8..37b155280237 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index 74414d77adde..6f5098eaaf54 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index 59d81989169a..03b81dffb459 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index 47e282a63e8b..d99b83df17a8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index a0a1f019d819..bec74170f914 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py index 3ea543b00046..28cace6c66df 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py index 146af3287ee1..474bc2f1b6bb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index 6227389dfb16..f9ce559597f3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py index d9132eb29978..2ce5bf788e24 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index bf6c94525020..2a401beda7b2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index 48870526b658..198416fa503a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py index 087d6c07427a..d553aa4002f7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py index ef06e4d9e73e..d1be99d4e438 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index fa8036ac0c71..3a922c9c856c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py index 98351c3eb9d4..57612019a9e6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index c46a3dde4ad9..a819f0a5e46f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index c8e7a591f8c4..640f40bac9a6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index 6f95ff0eaaf1..ee0bf81b1a0d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py index cf5dd3ae557b..98b30389ae44 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py index 5a9f2f5bb082..a3bfcac60190 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py index 603573e9f997..aa107446c43d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py index 08f1eacf23b6..3be7a9658b5e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py index 4e7724357e8a..a504545ae442 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py index d3a247432469..821225c10255 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index 2a0c429f54ef..14193cfacbec 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py index 567a7fac1602..a311a0c656ed 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py index 19c1626f4875..23b3e0befb28 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py index 52533d39e49d..698cbc0b7846 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index c8108d4a1075..129a0eacb17d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py index af87968d14a3..1a230f98b737 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 14aeee17ba6c..b16983b11558 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py index 074cc52aaa43..c840eab6369f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py index 2429a2205a21..595655019ed7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py index ca57f8edd0c4..16d6e23cb24e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py index b0b588d04a13..91be6d02d1a8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py index 294687560d50..6f06e85a3be2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index 2775c77d79c7..d93f03e849f2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index 038a4c6f701f..acdcad0903e5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index 438831aac748..55baf6a7b35c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py index e85504879aeb..56b09a2024f2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index 7ce3ae227f97..2aecf52210ef 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py index ff7e85735b4a..384d18d11812 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py index c3b568a7336c..5a4c783fa0b8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 721c27153e57..83fd87c719d5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py index 595525992640..5a3d2514eb46 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index f61207d5b578..b29f83c9976d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index f78ed803a59c..8275e48bb955 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index f6bf08a97e50..273512a90138 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py index 8e4bea9b30e3..f45e4a2bb0dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py index 3efa9b66074e..1565cd8b9793 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 9a67034b34c1..09c039f8fe60 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py index f2f4e22231e4..2b661afe3c24 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index a42d77f660dc..cead5d15b7bd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index 395d83d0f1e5..b96f2559062d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index c51fbf770135..c2547b157a66 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py index 9eae261142d9..8bbc226e3476 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py index 1b38c173ce0b..2e533571785e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index c312855b6bb3..115cde5048f3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py index a36fd79ef3ff..83428cd27113 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py index cf29c50f64f3..1de764931197 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py index 8d6de64ab2c0..d33c830522f0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py index 15bbe41e9b44..2ea5d4039ce7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -47,6 +47,10 @@ NoneBase, StrBase, IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, NumberBase, DateBase, DateTimeBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py index b896e4ebe4fd..58ffd544224b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py @@ -65,8 +65,12 @@ def update(d: dict, u: dict): Adds u to d Where each dict is defaultdict(set) """ + if not u: + return d for k, v in u.items(): - d[k] = d[k].union(v) + if not v: + continue + d[k] = d[k] | v return d @@ -217,7 +221,6 @@ def __check_tuple_validations( if (cls.__is_json_validation_enabled('uniqueItems', _instantiation_metadata.configuration) and 'unique_items' in validations and validations['unique_items'] and input_values): unique_items = [] - # print(validations) for item in input_values: if item not in unique_items: unique_items.append(item) @@ -782,25 +785,22 @@ def _get_items(cls, *args, _instantiation_metadata: typing.Optional[Instantiatio cls_item_cls = getattr(cls, '_items', AnyTypeSchema) for i, value in enumerate(list_items): item_path_to_item = _instantiation_metadata.path_to_item+(i,) - if item_path_to_item in _instantiation_metadata.path_to_schemas: - item_cls = _instantiation_metadata.path_to_schemas[item_path_to_item] - else: + item_cls = _instantiation_metadata.path_to_schemas.get(item_path_to_item) + if item_cls is None: item_cls = cls_item_cls if isinstance(value, item_cls): cast_items.append(value) continue + item_instantiation_metadata = InstantiationMetadata( configuration=_instantiation_metadata.configuration, from_server=_instantiation_metadata.from_server, path_to_item=item_path_to_item, path_to_schemas=_instantiation_metadata.path_to_schemas, ) - - if _instantiation_metadata.from_server: - new_value = item_cls._from_openapi_data(value, _instantiation_metadata=item_instantiation_metadata) - else: - new_value = item_cls(value, _instantiation_metadata=item_instantiation_metadata) + new_value = item_cls._get_new_instance_without_conversion( + value, _instantiation_metadata=item_instantiation_metadata) cast_items.append(new_value) return cast_items @@ -939,7 +939,6 @@ def _validate_args(cls, arg, _instantiation_metadata: InstantiationMetadata): ) other_path_to_schemas = schema._validate(value, _instantiation_metadata=arg_instantiation_metadata) update(path_to_schemas, other_path_to_schemas) - _instantiation_metadata.path_to_schemas.update(arg_instantiation_metadata.path_to_schemas) return path_to_schemas @classmethod @@ -1052,10 +1051,8 @@ def _get_properties(cls, arg: typing.Dict[str, typing.Any], _instantiation_metad path_to_item=property_path_to_item, path_to_schemas=_instantiation_metadata.path_to_schemas, ) - if _instantiation_metadata.from_server: - new_value = property_cls._from_openapi_data(value, _instantiation_metadata=prop_instantiation_metadata) - else: - new_value = property_cls(value, _instantiation_metadata=prop_instantiation_metadata) + new_value = property_cls._get_new_instance_without_conversion( + value, _instantiation_metadata=prop_instantiation_metadata) dict_items[property_name_js] = new_value return dict_items @@ -1070,11 +1067,9 @@ def __getattr__(self, name): return self[name] except KeyError as ex: raise AttributeError(str(ex)) - # print(('non-frozendict __getattr__', name)) return super().__getattr__(self, name) def __getattribute__(self, name): - # print(('__getattribute__', name)) # if an attribute does exist (for example as a class property but not as an instance method) try: return self[name] @@ -1275,9 +1270,6 @@ def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): _instantiation_metadata.path_to_schemas and _instantiation_metadata.path_to_item in _instantiation_metadata.path_to_schemas): chosen_new_cls = _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] - # print('leaving __get_new_cls early for cls {} because path_to_schemas exists'.format(cls)) - # print(_instantiation_metadata.path_to_item) - # print(chosen_new_cls) return chosen_new_cls """ Dict property + List Item Assignment Use cases: @@ -1293,8 +1285,6 @@ def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): because value is of the correct type, and validation was run earlier when the instance was created """ _path_to_schemas = cls._validate(arg, _instantiation_metadata=_instantiation_metadata) - from pprint import pprint - pprint(dict(_path_to_schemas)) # loop through it make a new class for each entry for path, schema_classes in _path_to_schemas.items(): enum_schema = any( @@ -1325,7 +1315,6 @@ def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): continue # Use case: value is None, True, False, or an enum value - # print('choosing enum class for path {} in arg {}'.format(path, arg)) value = arg for key in path[1:]: value = value[key] @@ -1342,14 +1331,14 @@ def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): return _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] @classmethod - def __get_new_instance_without_conversion(cls, arg, _instantiation_metadata): + def _get_new_instance_without_conversion(cls, arg, _instantiation_metadata): # PATH 2 - we have a Dynamic class and we are making an instance of it - if issubclass(cls, tuple): - items = cls._get_items(arg, _instantiation_metadata=_instantiation_metadata) - return super(Schema, cls).__new__(cls, items) - elif issubclass(cls, frozendict): + if issubclass(cls, frozendict): properties = cls._get_properties(arg, _instantiation_metadata=_instantiation_metadata) return super(Schema, cls).__new__(cls, properties) + elif issubclass(cls, tuple): + items = cls._get_items(arg, _instantiation_metadata=_instantiation_metadata) + return super(Schema, cls).__new__(cls, items) """ str = openapi str, date, and datetime decimal.Decimal = openapi int and float @@ -1388,7 +1377,7 @@ def _from_openapi_data( 'from_server must be True in this code path, if you need it to be False, use cls()' ) new_cls = cls.__get_new_cls(arg, _instantiation_metadata) - new_inst = new_cls.__get_new_instance_without_conversion(arg, _instantiation_metadata) + new_inst = new_cls._get_new_instance_without_conversion(arg, _instantiation_metadata) return new_inst @staticmethod @@ -1429,7 +1418,7 @@ def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Deci ) arg = cast_to_allowed_types(arg, from_server=_instantiation_metadata.from_server) new_cls = cls.__get_new_cls(arg, _instantiation_metadata) - return new_cls.__get_new_instance_without_conversion(arg, _instantiation_metadata) + return new_cls._get_new_instance_without_conversion(arg, _instantiation_metadata) def __init__( self, @@ -1455,21 +1444,16 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal int, float -> Decimal StrSchema will convert that to bytes and remember the encoding when we pass in str input """ - if isinstance(arg, (date, datetime)): - if not from_server: - return arg.isoformat() - # ApiTypeError will be thrown later by _validate_type + if isinstance(arg, str): return arg + elif type(arg) is dict or type(arg) is frozendict: + return frozendict({key: cast_to_allowed_types(val) for key, val in arg.items()}) elif isinstance(arg, bool): """ this check must come before isinstance(arg, (int, float)) because isinstance(True, int) is True """ return arg - elif isinstance(arg, decimal.Decimal): - return arg - elif isinstance(arg, int): - return decimal.Decimal(arg) elif isinstance(arg, float): decimal_from_float = decimal.Decimal(arg) if decimal_from_float.as_integer_ratio()[1] == 1: @@ -1477,7 +1461,18 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') return decimal.Decimal(str(decimal_from_float)+'.0') return decimal_from_float - elif isinstance(arg, str): + elif type(arg) is list or type(arg) is tuple: + return tuple([cast_to_allowed_types(item) for item in arg]) + elif isinstance(arg, int): + return decimal.Decimal(arg) + elif arg is None: + return arg + elif isinstance(arg, (date, datetime)): + if not from_server: + return arg.isoformat() + # ApiTypeError will be thrown later by _validate_type + return arg + elif isinstance(arg, decimal.Decimal): return arg elif isinstance(arg, bytes): return arg @@ -1485,12 +1480,6 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal if arg.closed: raise ApiValueError('Invalid file state; file is closed and must be open') return arg - elif type(arg) is list or type(arg) is tuple: - return tuple([cast_to_allowed_types(item) for item in arg]) - elif type(arg) is dict or type(arg) is frozendict: - return frozendict({key: cast_to_allowed_types(val) for key, val in arg.items() if val is not unset}) - elif arg is None: - return arg elif isinstance(arg, Schema): return arg raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) @@ -1779,30 +1768,49 @@ def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: typing.Union return super().__new__(cls, arg, **kwargs) -class Int32Schema( +class Int32Base( _SchemaValidator( inclusive_minimum=decimal.Decimal(-2147483648), inclusive_maximum=decimal.Decimal(2147483647) ), +): + pass + + +class Int32Schema( + Int32Base, IntSchema ): pass -class Int64Schema( + +class Int64Base( _SchemaValidator( inclusive_minimum=decimal.Decimal(-9223372036854775808), inclusive_maximum=decimal.Decimal(9223372036854775807) ), +): + pass + + +class Int64Schema( + Int64Base, IntSchema ): pass -class Float32Schema( +class Float32Base( _SchemaValidator( inclusive_minimum=decimal.Decimal(-3.4028234663852886e+38), inclusive_maximum=decimal.Decimal(3.4028234663852886e+38) ), +): + pass + + +class Float32Schema( + Float32Base, NumberSchema ): @@ -1812,11 +1820,17 @@ def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _instanti return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) -class Float64Schema( +class Float64Base( _SchemaValidator( inclusive_minimum=decimal.Decimal(-1.7976931348623157E+308), inclusive_maximum=decimal.Decimal(1.7976931348623157E+308) ), +): + pass + + +class Float64Schema( + Float64Base, NumberSchema ): From 92ccb629e95b039e54bf91f3a349d6fa95b319ea Mon Sep 17 00:00:00 2001 From: ruijlpires Date: Sat, 5 Feb 2022 06:28:05 +0000 Subject: [PATCH 006/111] Fix duplicated Authorization headers when renewing a token on a retry (#11513) Add a leeway time to avoid a skew in the local clock --- .../resources/Java/libraries/feign/auth/OAuth.mustache | 10 +++++++--- .../main/java/org/openapitools/client/auth/OAuth.java | 10 +++++++--- .../main/java/org/openapitools/client/auth/OAuth.java | 10 +++++++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OAuth.mustache index e6082965643a..bc5a1d7c6d30 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OAuth.mustache @@ -10,6 +10,9 @@ import java.util.Collection; {{>generatedAnnotation}} public abstract class OAuth implements RequestInterceptor { + //https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4 + static final int LEEWAY_SENCONDS = 10; + static final int MILLIS_PER_SECOND = 1000; public interface AccessTokenListener { @@ -17,7 +20,7 @@ public abstract class OAuth implements RequestInterceptor { } private volatile String accessToken; - private Long expirationTimeMillis; + private Long expirationTimeSeconds; private AccessTokenListener accessTokenListener; protected OAuth20Service service; @@ -39,6 +42,7 @@ public abstract class OAuth implements RequestInterceptor { } String accessToken = getAccessToken(); if (accessToken != null) { + template.removeHeader("Authorization"); template.header("Authorization", "Bearer " + accessToken); } } @@ -73,7 +77,7 @@ public abstract class OAuth implements RequestInterceptor { public synchronized String getAccessToken() { // If first time, get the token - if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { + if (expirationTimeSeconds == null || System.currentTimeMillis() >= expirationTimeSeconds) { updateAccessToken(); } return accessToken; @@ -86,7 +90,7 @@ public abstract class OAuth implements RequestInterceptor { */ public synchronized void setAccessToken(String accessToken, Integer expiresIn) { this.accessToken = accessToken; - this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; + this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SENCONDS; } } \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuth.java index 0ae73ee19c8b..9a47491d269d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuth.java @@ -10,6 +10,9 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public abstract class OAuth implements RequestInterceptor { + //https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4 + static final int LEEWAY_SENCONDS = 10; + static final int MILLIS_PER_SECOND = 1000; public interface AccessTokenListener { @@ -17,7 +20,7 @@ public interface AccessTokenListener { } private volatile String accessToken; - private Long expirationTimeMillis; + private Long expirationTimeSeconds; private AccessTokenListener accessTokenListener; protected OAuth20Service service; @@ -39,6 +42,7 @@ public void apply(RequestTemplate template) { } String accessToken = getAccessToken(); if (accessToken != null) { + template.removeHeader("Authorization"); template.header("Authorization", "Bearer " + accessToken); } } @@ -73,7 +77,7 @@ public synchronized void registerAccessTokenListener(AccessTokenListener accessT public synchronized String getAccessToken() { // If first time, get the token - if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { + if (expirationTimeSeconds == null || System.currentTimeMillis() >= expirationTimeSeconds) { updateAccessToken(); } return accessToken; @@ -86,7 +90,7 @@ public synchronized String getAccessToken() { */ public synchronized void setAccessToken(String accessToken, Integer expiresIn) { this.accessToken = accessToken; - this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; + this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SENCONDS; } } \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuth.java index 0ae73ee19c8b..9a47491d269d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuth.java @@ -10,6 +10,9 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public abstract class OAuth implements RequestInterceptor { + //https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4 + static final int LEEWAY_SENCONDS = 10; + static final int MILLIS_PER_SECOND = 1000; public interface AccessTokenListener { @@ -17,7 +20,7 @@ public interface AccessTokenListener { } private volatile String accessToken; - private Long expirationTimeMillis; + private Long expirationTimeSeconds; private AccessTokenListener accessTokenListener; protected OAuth20Service service; @@ -39,6 +42,7 @@ public void apply(RequestTemplate template) { } String accessToken = getAccessToken(); if (accessToken != null) { + template.removeHeader("Authorization"); template.header("Authorization", "Bearer " + accessToken); } } @@ -73,7 +77,7 @@ public synchronized void registerAccessTokenListener(AccessTokenListener accessT public synchronized String getAccessToken() { // If first time, get the token - if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { + if (expirationTimeSeconds == null || System.currentTimeMillis() >= expirationTimeSeconds) { updateAccessToken(); } return accessToken; @@ -86,7 +90,7 @@ public synchronized String getAccessToken() { */ public synchronized void setAccessToken(String accessToken, Integer expiresIn) { this.accessToken = accessToken; - this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; + this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SENCONDS; } } \ No newline at end of file From 1a14d9e5cac8964c48e7eebd51d2937ce581df7d Mon Sep 17 00:00:00 2001 From: lbilger Date: Sat, 5 Feb 2022 07:43:25 +0100 Subject: [PATCH 007/111] Fix ClassCastException if expected type is Object (#11510) The currently generated code will throw a `ClassCastException` if `type` is `Object`. I'm not quite sure why `isAssignableFrom` is used here but I tried to keep the change minimal - in my understanding, the result would be the same if the line was ``` if(Types.getRawType(type).equals(ApiResponse.class)) { ``` because the `ApiResponse` only extends `Object` and implements no interfaces. Maybe it was meant to be `ApiResponse.class.isAssignableFrom(Types.getRawType(type))`? This would also permit subclasses of `ApiResponse`, but then it would be more complicated to determine the actual type parameter (because `type` itself may not be parameterized) and to create the object to return (because it would have to be an instance of the subclass). --- .../Java/libraries/feign/ApiResponseDecoder.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiResponseDecoder.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiResponseDecoder.mustache index ef171de94300..2ff7a3243c06 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiResponseDecoder.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiResponseDecoder.mustache @@ -25,7 +25,7 @@ public class ApiResponseDecoder extends JacksonDecoder { Map> responseHeaders = Collections.unmodifiableMap(response.headers()); //Detects if the type is an instance of the parameterized class ApiResponse Type responseBodyType; - if (Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { + if (type instanceof ParameterizedType && Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { //The ApiResponse class has a single type parameter, the Dto class itself responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; Object body = super.decode(response, responseBodyType); @@ -35,4 +35,4 @@ public class ApiResponseDecoder extends JacksonDecoder { return super.decode(response, type); } } -} \ No newline at end of file +} From 31f2f11beb2593fb8d5dcf85ac701507aaec7893 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 5 Feb 2022 14:47:51 +0800 Subject: [PATCH 008/111] update samples --- .../main/java/org/openapitools/client/ApiResponseDecoder.java | 4 ++-- .../main/java/org/openapitools/client/ApiResponseDecoder.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiResponseDecoder.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiResponseDecoder.java index d74d1d8768d6..659cad2102cf 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiResponseDecoder.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiResponseDecoder.java @@ -25,7 +25,7 @@ public Object decode(Response response, Type type) throws IOException { Map> responseHeaders = Collections.unmodifiableMap(response.headers()); //Detects if the type is an instance of the parameterized class ApiResponse Type responseBodyType; - if (Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { + if (type instanceof ParameterizedType && Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { //The ApiResponse class has a single type parameter, the Dto class itself responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; Object body = super.decode(response, responseBodyType); @@ -35,4 +35,4 @@ public Object decode(Response response, Type type) throws IOException { return super.decode(response, type); } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiResponseDecoder.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiResponseDecoder.java index d74d1d8768d6..659cad2102cf 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiResponseDecoder.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiResponseDecoder.java @@ -25,7 +25,7 @@ public Object decode(Response response, Type type) throws IOException { Map> responseHeaders = Collections.unmodifiableMap(response.headers()); //Detects if the type is an instance of the parameterized class ApiResponse Type responseBodyType; - if (Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { + if (type instanceof ParameterizedType && Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { //The ApiResponse class has a single type parameter, the Dto class itself responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; Object body = super.decode(response, responseBodyType); @@ -35,4 +35,4 @@ public Object decode(Response response, Type type) throws IOException { return super.decode(response, type); } } -} \ No newline at end of file +} From e2d32b2061b1b6a4c97a617e2ab98c004a7e6351 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 5 Feb 2022 15:18:36 +0800 Subject: [PATCH 009/111] fix javadoc warnings in feign client (#11527) --- .../main/resources/Java/libraries/feign/ApiClient.mustache | 6 ++++-- .../src/main/java/org/openapitools/client/ApiClient.java | 6 ++++-- .../src/main/java/org/openapitools/client/ApiClient.java | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index ed8f2302eb82..249f4b65abaa 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -274,8 +274,8 @@ public class ApiClient { {{#hasOAuthMethods}} /** * Helper method to configure the client credentials for Oauth - * @param username Username - * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setClientCredentials(String clientId, String clientSecret) { OauthClientCredentialsGrant authorization = getAuthorization(OauthClientCredentialsGrant.class); @@ -286,6 +286,8 @@ public class ApiClient { * Helper method to configure the username/password for Oauth password grant * @param username Username * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setOauthPassword(String username, String password, String clientId, String clientSecret) { OauthPasswordGrant apiAuthorization = getAuthorization(OauthPasswordGrant.class); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java index da2d48856c65..da622ac9d094 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java @@ -230,8 +230,8 @@ public void setCredentials(String username, String password) { /** * Helper method to configure the client credentials for Oauth - * @param username Username - * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setClientCredentials(String clientId, String clientSecret) { OauthClientCredentialsGrant authorization = getAuthorization(OauthClientCredentialsGrant.class); @@ -242,6 +242,8 @@ public void setClientCredentials(String clientId, String clientSecret) { * Helper method to configure the username/password for Oauth password grant * @param username Username * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setOauthPassword(String username, String password, String clientId, String clientSecret) { OauthPasswordGrant apiAuthorization = getAuthorization(OauthPasswordGrant.class); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java index fb8f19963d9a..6d02aa546b8c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java @@ -237,8 +237,8 @@ public void setCredentials(String username, String password) { /** * Helper method to configure the client credentials for Oauth - * @param username Username - * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setClientCredentials(String clientId, String clientSecret) { OauthClientCredentialsGrant authorization = getAuthorization(OauthClientCredentialsGrant.class); @@ -249,6 +249,8 @@ public void setClientCredentials(String clientId, String clientSecret) { * Helper method to configure the username/password for Oauth password grant * @param username Username * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setOauthPassword(String username, String password, String clientId, String clientSecret) { OauthPasswordGrant apiAuthorization = getAuthorization(OauthPasswordGrant.class); From 092100694e444b642ac63891c3ba15655315489a Mon Sep 17 00:00:00 2001 From: zarlo Date: Sat, 5 Feb 2022 19:04:07 +1100 Subject: [PATCH 010/111] Update __init__model.mustache (#11474) fix a error in the template --- .../src/main/resources/python/__init__model.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/__init__model.mustache b/modules/openapi-generator/src/main/resources/python/__init__model.mustache index cfe32b784926..b6b698b04528 100644 --- a/modules/openapi-generator/src/main/resources/python/__init__model.mustache +++ b/modules/openapi-generator/src/main/resources/python/__init__model.mustache @@ -2,4 +2,4 @@ # reference which would not work in python2 # do not import all models into this module because that uses a lot of memory and stack frames # if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB +# from {{packageName}}.models import ModelA, ModelB From e177a4b757e7db46e6b2004ffb0f01e4ea300b35 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 5 Feb 2022 16:37:56 +0800 Subject: [PATCH 011/111] update samples --- samples/client/petstore/python/petstore_api/model/__init__.py | 2 +- .../petstore_api/model/__init__.py | 2 +- .../x-auth-id-alias/python/x_auth_id_alias/model/__init__.py | 2 +- .../dynamic-servers/python/dynamic_servers/model/__init__.py | 2 +- .../client/petstore/python/petstore_api/model/__init__.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/client/petstore/python/petstore_api/model/__init__.py b/samples/client/petstore/python/petstore_api/model/__init__.py index cfe32b784926..027452f37a87 100644 --- a/samples/client/petstore/python/petstore_api/model/__init__.py +++ b/samples/client/petstore/python/petstore_api/model/__init__.py @@ -2,4 +2,4 @@ # reference which would not work in python2 # do not import all models into this module because that uses a lot of memory and stack frames # if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB +# from petstore_api.models import ModelA, ModelB diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py index cfe32b784926..027452f37a87 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py @@ -2,4 +2,4 @@ # reference which would not work in python2 # do not import all models into this module because that uses a lot of memory and stack frames # if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB +# from petstore_api.models import ModelA, ModelB diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model/__init__.py index cfe32b784926..7462dab04eeb 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model/__init__.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model/__init__.py @@ -2,4 +2,4 @@ # reference which would not work in python2 # do not import all models into this module because that uses a lot of memory and stack frames # if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB +# from x_auth_id_alias.models import ModelA, ModelB diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model/__init__.py index cfe32b784926..96df46621423 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model/__init__.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model/__init__.py @@ -2,4 +2,4 @@ # reference which would not work in python2 # do not import all models into this module because that uses a lot of memory and stack frames # if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB +# from dynamic_servers.models import ModelA, ModelB diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/model/__init__.py index cfe32b784926..027452f37a87 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/__init__.py @@ -2,4 +2,4 @@ # reference which would not work in python2 # do not import all models into this module because that uses a lot of memory and stack frames # if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB +# from petstore_api.models import ModelA, ModelB From 194b3fda26576c2ed0af38d14321c819c80f67b5 Mon Sep 17 00:00:00 2001 From: cachescrubber <5127753+cachescrubber@users.noreply.github.com> Date: Sat, 5 Feb 2022 10:29:58 +0100 Subject: [PATCH 012/111] [Bug][Java/Spring] OAS3 related bugfixes and enhancements (#11526) * Content mediatype is hardcoded in api.mustache #11511 * Generate Samples * OAS3 incorrect data type when providing a default value #11367 * Generate Samples * Fix JsonTypeName annotation handling in Java and JavaSpring * Generate Samples * getIsClassnameSanitized: use null safe equals --- .../openapitools/codegen/CodegenModel.java | 3 +- .../languages/AbstractJavaCodegen.java | 4 + .../Java/libraries/jersey2/pojo.mustache | 3 + .../okhttp-gson-nextgen/pojo.mustache | 2 + .../src/main/resources/Java/pojo.mustache | 2 + .../Java/typeInfoAnnotation.mustache | 3 - .../main/resources/JavaSpring/api.mustache | 6 +- .../resources/JavaSpring/paramDoc.mustache | 2 +- .../main/resources/JavaSpring/pojo.mustache | 5 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelClient.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../org/openapitools/client/model/File.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../client/model/DeprecatedObject.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../org/openapitools/client/model/File.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../org/openapitools/client/model/Foo.java | 1 - .../client/model/HealthCheckResult.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../client/model/NullableClass.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../model/ObjectWithDeprecatedFields.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../model/OuterObjectWithEnumProperty.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../client/model/BigCatAllOf.java | 1 + .../openapitools/client/model/CatAllOf.java | 1 + .../openapitools/client/model/DogAllOf.java | 1 + .../openapitools/client/model/EnumTest.java | 1 + .../openapitools/client/model/FormatTest.java | 1 + .../client/model/HasOnlyReadOnly.java | 1 + .../client/model/Model200Response.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../openapitools/client/model/ModelFile.java | 1 + .../openapitools/client/model/ModelList.java | 1 + .../client/model/ModelReturn.java | 1 + .../client/model/SpecialModelName.java | 1 + .../client/model/BigCatAllOf.java | 1 + .../openapitools/client/model/CatAllOf.java | 1 + .../openapitools/client/model/DogAllOf.java | 1 + .../openapitools/client/model/EnumTest.java | 1 + .../openapitools/client/model/FormatTest.java | 1 + .../client/model/HasOnlyReadOnly.java | 1 + .../client/model/Model200Response.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../openapitools/client/model/ModelFile.java | 1 + .../openapitools/client/model/ModelList.java | 1 + .../client/model/ModelReturn.java | 1 + .../client/model/SpecialModelName.java | 1 + .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../org/openapitools/client/model/BigCat.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../client/model/TypeHolderDefault.java | 1 - .../client/model/TypeHolderExample.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/client/model/XmlItem.java | 1 - .../client/model/ByteArrayObject.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../client/model/ArrayOfNumberOnly.java | 1 - .../openapitools/client/model/ArrayTest.java | 1 - .../client/model/Capitalization.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/Category.java | 1 - .../openapitools/client/model/ClassModel.java | 1 - .../org/openapitools/client/model/Client.java | 1 - .../client/model/DeprecatedObject.java | 1 - .../org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/EnumArrays.java | 1 - .../client/model/FileSchemaTestClass.java | 1 - .../org/openapitools/client/model/Foo.java | 1 - .../client/model/HealthCheckResult.java | 1 - .../openapitools/client/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../org/openapitools/client/model/Name.java | 1 - .../client/model/NullableClass.java | 1 - .../openapitools/client/model/NumberOnly.java | 1 - .../model/ObjectWithDeprecatedFields.java | 1 - .../org/openapitools/client/model/Order.java | 1 - .../client/model/OuterComposite.java | 1 - .../model/OuterObjectWithEnumProperty.java | 1 - .../org/openapitools/client/model/Pet.java | 1 - .../client/model/ReadOnlyFirst.java | 1 - .../org/openapitools/client/model/Tag.java | 1 - .../org/openapitools/client/model/User.java | 1 - .../openapitools/model/ModelApiResponse.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../client/model/ChildSchemaAllOf.java | 1 + .../client/model/MySchemaNameCharacters.java | 2 +- .../model/MySchemaNameCharactersAllOf.java | 1 + .../org/openapitools/client/model/Apple.java | 1 + .../openapitools/client/model/AppleReq.java | 1 + .../org/openapitools/client/model/Banana.java | 1 + .../openapitools/client/model/BananaReq.java | 1 + .../openapitools/client/model/CatAllOf.java | 1 + .../client/model/ChildCatAllOf.java | 1 + .../openapitools/client/model/DogAllOf.java | 1 + .../openapitools/client/model/EnumTest.java | 1 + .../openapitools/client/model/FormatTest.java | 1 + .../client/model/HasOnlyReadOnly.java | 1 + .../client/model/InlineResponseDefault.java | 1 + .../client/model/Model200Response.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../openapitools/client/model/ModelFile.java | 1 + .../openapitools/client/model/ModelList.java | 1 + .../client/model/ModelReturn.java | 1 + .../client/model/SpecialModelName.java | 1 + .../org/openapitools/client/model/Whale.java | 1 + .../org/openapitools/client/model/Zebra.java | 1 + .../java/org/openapitools/api/PetApi.java | 45 ++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../openapitools/model/ModelApiResponse.java | 2 + .../java/org/openapitools/api/DefaultApi.java | 12 +- .../org/openapitools/api/AnotherFakeApi.java | 6 +- .../java/org/openapitools/api/FakeApi.java | 110 ++++++++-------- .../api/FakeClassnameTags123Api.java | 6 +- .../java/org/openapitools/api/PetApi.java | 55 +++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../java/org/openapitools/api/PetApi.java | 45 ++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../openapitools/model/ModelApiResponse.java | 2 + .../java/org/openapitools/api/PetApi.java | 55 +++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../openapitools/model/ModelApiResponse.java | 2 + .../java/org/openapitools/api/PetApi.java | 45 ++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../openapitools/model/ModelApiResponse.java | 2 + .../java/org/openapitools/api/PetApi.java | 55 +++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/api/AnotherFakeApi.java | 6 +- .../api/AnotherFakeApiController.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 120 ++++++++++-------- .../openapitools/api/FakeApiController.java | 96 +++++++------- .../api/FakeClassnameTestApi.java | 6 +- .../api/FakeClassnameTestApiController.java | 2 +- .../java/org/openapitools/api/PetApi.java | 45 ++++--- .../openapitools/api/PetApiController.java | 26 ++-- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../openapitools/api/StoreApiController.java | 6 +- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../openapitools/api/UserApiController.java | 18 +-- .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/api/AnotherFakeApi.java | 6 +- .../java/org/openapitools/api/FakeApi.java | 120 ++++++++++-------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 45 ++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/api/AnotherFakeApi.java | 6 +- .../java/org/openapitools/api/FakeApi.java | 120 ++++++++++-------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 45 ++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/api/AnotherFakeApi.java | 6 +- .../java/org/openapitools/api/FakeApi.java | 120 ++++++++++-------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 45 ++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/api/AnotherFakeApi.java | 6 +- .../java/org/openapitools/api/FakeApi.java | 120 ++++++++++-------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 45 ++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../java/org/openapitools/api/PetApi.java | 55 +++++--- .../java/org/openapitools/api/StoreApi.java | 20 ++- .../java/org/openapitools/api/UserApi.java | 28 ++-- .../openapitools/model/ModelApiResponse.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/BigCatAllOf.java | 1 + .../app/apimodels/CatAllOf.java | 1 + .../app/apimodels/DogAllOf.java | 1 + .../app/apimodels/EnumTest.java | 1 + .../app/apimodels/FormatTest.java | 1 + .../app/apimodels/HasOnlyReadOnly.java | 1 + .../app/apimodels/Model200Response.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelFile.java | 1 + .../app/apimodels/ModelList.java | 1 + .../app/apimodels/ModelReturn.java | 1 + .../app/apimodels/SpecialModelName.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../app/apimodels/ModelApiResponse.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../model/InlineResponseDefault.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + .../virtualan/model/BigCatAllOf.java | 2 + .../virtualan/model/CatAllOf.java | 2 + .../virtualan/model/DogAllOf.java | 2 + .../virtualan/model/EnumTest.java | 2 + .../virtualan/model/FormatTest.java | 2 + .../virtualan/model/HasOnlyReadOnly.java | 2 + .../virtualan/model/Model200Response.java | 2 + .../virtualan/model/ModelApiResponse.java | 2 + .../virtualan/model/ModelList.java | 2 + .../virtualan/model/ModelReturn.java | 2 + .../virtualan/model/SpecialModelName.java | 2 + .../org/openapitools/model/BigCatAllOf.java | 2 + .../java/org/openapitools/model/CatAllOf.java | 2 + .../java/org/openapitools/model/DogAllOf.java | 2 + .../java/org/openapitools/model/EnumTest.java | 2 + .../org/openapitools/model/FormatTest.java | 2 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 2 + .../org/openapitools/model/ModelList.java | 2 + .../org/openapitools/model/ModelReturn.java | 2 + .../openapitools/model/SpecialModelName.java | 2 + 987 files changed, 2033 insertions(+), 1285 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index 960011d0618d..7403002e2d49 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.ExternalDocumentation; import java.util.*; +import org.apache.commons.lang3.StringUtils; /** * CodegenModel represents a schema object in a OpenAPI document. @@ -240,7 +241,7 @@ public void setClassVarName(String classVarName) { * @return true if the classname property is sanitized */ public boolean getIsClassnameSanitized() { - return !classname.equals(name); + return !StringUtils.equals(classname, name); } public String getClassname() { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 2933bd3302b3..ed493454fd34 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -1275,6 +1275,10 @@ public CodegenModel fromModel(String name, Schema model) { @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + if (model.getIsClassnameSanitized() && additionalProperties.containsKey(JACKSON)) { + model.imports.add("JsonTypeName"); + } + if (serializeBigDecimalAsString) { if ("decimal".equals(property.baseType)) { // we serialize BigDecimal as `string` to avoid precision loss diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index 93bd6bfb8257..a6c07433c604 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -10,6 +10,9 @@ {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) +{{#isClassnameSanitized}} +@JsonTypeName("{{name}}") +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache index b30ce069f095..c99b68893190 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache @@ -29,7 +29,9 @@ import {{invokerPackage}}.JSON; {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) +{{#isClassnameSanitized}} @JsonTypeName("{{name}}") +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index 7ca5cedeed88..f28311cddfb0 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -10,7 +10,9 @@ {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) +{{#isClassnameSanitized}} @JsonTypeName("{{name}}") +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ diff --git a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache index 63eb42ea5001..c8bf7b8e3c1e 100644 --- a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache @@ -10,7 +10,4 @@ }) {{/-last}} {{/discriminator.mappedModels}} -{{#isClassnameSanitized}} -@JsonTypeName("{{name}}") -{{/isClassnameSanitized}} {{/jackson}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index da913ae679a0..c7ba4bcd0bdf 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -137,7 +137,11 @@ public interface {{classname}} { {{/vendorExtensions.x-tags}} responses = { {{#responses}} - @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = @Content(mediaType = "application/json", schema = @Schema(implementation = {{{baseType}}}.class)){{/baseType}}){{^-last}},{{/-last}} + @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = { + {{#produces}} + @Content(mediaType = "{{{mediaType}}}", schema = @Schema(implementation = {{{baseType}}}.class)){{^-last}},{{/-last}} + {{/produces}} + }{{/baseType}}){{^-last}},{{/-last}} {{/responses}} }{{#hasAuthMethods}}, security = { diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache index 304e097c219f..77d6fed3a783 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache @@ -1 +1 @@ -{{#swagger2AnnotationLibrary}}@Parameter(name = "{{{baseName}}}", description = "{{{description}}}"{{#required}}, required = true{{/required}}, schema = @Schema(description = ""{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}})){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/swagger1AnnotationLibrary}} \ No newline at end of file +{{#swagger2AnnotationLibrary}}@Parameter(name = "{{{baseName}}}", description = "{{{description}}}"{{#required}}, required = true{{/required}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/swagger1AnnotationLibrary}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index c33f9ac03b4c..9478514e3e16 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -13,6 +13,11 @@ {{#discriminator}} {{>typeInfoAnnotation}} {{/discriminator}} +{{#jackson}} +{{#isClassnameSanitized}} +@JsonTypeName("{{name}}") +{{/isClassnameSanitized}} +{{/jackson}} {{#withXml}} {{>xmlAnnotation}} {{/withXml}} diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java index f19a8935510b..a8d93ae52c68 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java index 6125a814c9be..de9cc24095ab 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java index 3dba0d3bc208..8257ba1c1faf 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java index 1168da6df501..3a49114419db 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java index 83555236ab53..6d0e6a1c5f11 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 0de28c497864..935585b256cc 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java index 05141ad70762..4279f5642118 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java index 33e9cd2305ff..b5f9caf6139f 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java index 936ddd4a2dfb..9aac15eb2829 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java index b4d40ff9b656..2e62234e76fe 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java index 6c48df8fe43a..dd3965d127c4 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java index be60946ba7f7..dcf5131a4211 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java index d0a8db4de8bc..584a790f345e 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 57b75a4e5dd8..957cc2b807aa 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index dfd316bf1046..e5162ab46123 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index c6e7164efa7d..98ea69f7f4a8 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 6bb1861f65d1..22fe0a8e0f42 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -45,7 +45,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 2c67aa963673..3a87682ab4a2 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 90250b719b87..c6da3609d42b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index abd6ff204b79..ec6a2360fe64 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 324c57fde5e7..3ba318c8ac28 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java index 8563c7d9e705..6f303f173ae2 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java @@ -37,7 +37,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 99c326878949..395b4c4d405d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b995540f6280..81437ecc350b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java index ab3d8a2cc285..29e8fde2a2bc 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCat.java index 8f57023a54ae..03e9592e224b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java index 9dc31fc1bea9..09da87c7676a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java index 4726746bb7b8..1f3434c2ec64 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java index a76c23cd2c46..9ecb9793f886 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java index 1e6987ac7392..02a70314cfda 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java index a91695f70536..c0e12096086d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java index 306a371d5a36..806f7a66fe90 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java index dd78a19e82a8..f5b42b0b8739 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 78045f685e85..43c10d8609b0 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java index 3b4a4aaf56df..f21d8f15c1e0 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2ae360810626..b6361509275f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java index 8f1e9b423d2c..b263b708fefe 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 77a36e15c97f..4a268ea06ea6 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java index 098dcd4e8d49..34dcbe2336d4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 9a1e65114648..710f35030363 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java index 7b39879b1288..27121c69698e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 77c82ef6a3ca..1130124051bf 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java index a8e8b81ee313..25e766c40edb 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index adf9cfe99537..b4e2af9d2546 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -38,7 +38,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java index ef3cd0d7b5ba..e550b7a42198 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -39,7 +39,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java index 83979c42fb72..a289c89f5e60 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/XmlItem.java index a8dcac646f6d..f038a2d4b987 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/XmlItem.java @@ -62,7 +62,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 931b76ba5bbc..13929e3ca3dc 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 6faa54bcc8a7..92454a75cdd3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 9615cb382041..c8c9afbae389 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 71446f5ad6b2..681cde131684 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -45,7 +45,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 188c8f1d10cc..0fd004f8932c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index c2b21f367fa4..8c1b5aa090aa 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 120e2c5dbae0..7e957c981c90 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index dc865cfd1eb7..505a004ae440 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index 4ed427ad59ce..882b23a600fb 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -37,7 +37,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c7e5757afadc..a741789d3ada 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index fa149ecb37d1..8cc942cb0139 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index e310dc070d60..6cbe60cc9d03 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index b7b6fb6ceff0..051f4a0d7b82 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index 527ecdf078b8..738b70559c08 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index b1e6eb37d897..305e1927f676 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java index 2f338509e144..fce1efca6a07 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index 8cde8b56df52..b043ba52d3be 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java index 8333a2fa307c..e2a0f312f23e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 7cdcce8dc412..960744d9f008 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index 7c1d862c8cca..22e516c64c58 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java index 5621664e81d0..dd3513af7648 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ File.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class File { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 84a8e2819657..7a576704d8e0 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index 312111b66ee2..a3a475637b8d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index cfffb60809f0..43c027223e13 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java index f84949f12730..16a3d8b0a163 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index 104a98d8a9fa..66b80c1b3317 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java index f8764b087463..6b990afde26c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index 31ec4403a008..cacdb6dd7751 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index 1b8506338c9d..af99775de00f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 2d944c59d873..822b1addd371 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index 6f5fec1f3a2a..0daa61152372 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 95313004c133..b43e4d092dc8 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -38,7 +38,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index cec32e366774..4bbb377dfe3b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -39,7 +39,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java index 69493bfe139f..9eebcbe06843 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index 0233a8d4af34..508f9e5147ff 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -62,7 +62,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 77046bd872ac..036bd0becce6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -35,7 +35,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index ee588a3cf4c9..845e30d5a772 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -36,7 +36,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index cecc19e110a5..649c9e94fbe3 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 683789eea868..abcfd84dab57 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java index 9b3859e613c4..ef4272c814b5 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java index 9dc31fc1bea9..09da87c7676a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index 9df38a083777..c6ededc593ed 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java index a76c23cd2c46..9ecb9793f886 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java index 1e6987ac7392..02a70314cfda 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java index a91695f70536..c0e12096086d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 8ce005bca559..43b0f5f7645d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ DeprecatedObject.JSON_PROPERTY_NAME }) -@JsonTypeName("DeprecatedObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DeprecatedObject { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java index 306a371d5a36..806f7a66fe90 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java index c45d328d5823..170b78af7b14 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java index f69646c7fbef..0455b9277411 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ File.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class File { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index d1ce9ae611df..306e4b90d6ee 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java index 23e8d2d84765..fe477338c490 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Foo.JSON_PROPERTY_BAR }) -@JsonTypeName("Foo") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Foo { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java index ca53feb8faa6..19f2227d84bf 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE }) -@JsonTypeName("HealthCheckResult") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HealthCheckResult { public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index daec11727924..d3291df59fe8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d0913fb877b9..257a9fe634f1 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java index 8f1e9b423d2c..b263b708fefe 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java index 3fbb133aafd9..e242e8994940 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java @@ -53,7 +53,6 @@ NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) -@JsonTypeName("NullableClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NullableClass extends HashMap { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java index 77a36e15c97f..4a268ea06ea6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 46020e412098..d6a77e2107e4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -38,7 +38,6 @@ ObjectWithDeprecatedFields.JSON_PROPERTY_DEPRECATED_REF, ObjectWithDeprecatedFields.JSON_PROPERTY_BARS }) -@JsonTypeName("ObjectWithDeprecatedFields") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ObjectWithDeprecatedFields { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java index 736bb3cc795e..4bd1b9d4f2f5 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java index 575601736ab6..4a82ead06cbb 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 6dfd8bbdcf28..1669551078e2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ OuterObjectWithEnumProperty.JSON_PROPERTY_VALUE }) -@JsonTypeName("OuterObjectWithEnumProperty") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterObjectWithEnumProperty { public static final String JSON_PROPERTY_VALUE = "value"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index 64f2debe0395..54b9601550c5 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 77c82ef6a3ca..1130124051bf 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java index a8e8b81ee313..25e766c40edb 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java index 83979c42fb72..a289c89f5e60 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 57b75a4e5dd8..957cc2b807aa 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index dfd316bf1046..e5162ab46123 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index c6e7164efa7d..98ea69f7f4a8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index fa757a9cd8a4..7ed7eada218d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -45,7 +45,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 2c67aa963673..3a87682ab4a2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 90250b719b87..c6da3609d42b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index abd6ff204b79..ec6a2360fe64 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 324c57fde5e7..3ba318c8ac28 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index 8563c7d9e705..6f303f173ae2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -37,7 +37,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index cecc19e110a5..649c9e94fbe3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 683789eea868..abcfd84dab57 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java index 9b3859e613c4..ef4272c814b5 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java index 8f57023a54ae..03e9592e224b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java index 9dc31fc1bea9..09da87c7676a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java index 4726746bb7b8..1f3434c2ec64 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java index a76c23cd2c46..9ecb9793f886 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java index 1e6987ac7392..02a70314cfda 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java index a91695f70536..c0e12096086d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java index 306a371d5a36..806f7a66fe90 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java index c45d328d5823..170b78af7b14 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index dd42e4b5763c..5134b02e94af 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index daec11727924..d3291df59fe8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d0913fb877b9..257a9fe634f1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java index 8f1e9b423d2c..b263b708fefe 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java index 77a36e15c97f..4a268ea06ea6 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java index 098dcd4e8d49..34dcbe2336d4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java index 9a1e65114648..710f35030363 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index 64f2debe0395..54b9601550c5 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 77c82ef6a3ca..1130124051bf 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java index a8e8b81ee313..25e766c40edb 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6ac9db96adcd..f5425c1d5f9d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -38,7 +38,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 1e377b531d55..94c308e6c304 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -39,7 +39,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java index 83979c42fb72..a289c89f5e60 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java index 8fac0ca29889..f797d243ea7b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java @@ -62,7 +62,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 57b75a4e5dd8..957cc2b807aa 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index dfd316bf1046..e5162ab46123 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index c6e7164efa7d..98ea69f7f4a8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index fa757a9cd8a4..7ed7eada218d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -45,7 +45,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 2c67aa963673..3a87682ab4a2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 90250b719b87..c6da3609d42b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index abd6ff204b79..ec6a2360fe64 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 324c57fde5e7..3ba318c8ac28 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java index 8563c7d9e705..6f303f173ae2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java @@ -37,7 +37,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index cecc19e110a5..649c9e94fbe3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 683789eea868..abcfd84dab57 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java index 9b3859e613c4..ef4272c814b5 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java index 8f57023a54ae..03e9592e224b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java index 9dc31fc1bea9..09da87c7676a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java index 4726746bb7b8..1f3434c2ec64 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java index a76c23cd2c46..9ecb9793f886 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java index 1e6987ac7392..02a70314cfda 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java index a91695f70536..c0e12096086d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java index 306a371d5a36..806f7a66fe90 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java index c45d328d5823..170b78af7b14 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index dd42e4b5763c..5134b02e94af 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index daec11727924..d3291df59fe8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d0913fb877b9..257a9fe634f1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java index 8f1e9b423d2c..b263b708fefe 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java index 77a36e15c97f..4a268ea06ea6 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java index 098dcd4e8d49..34dcbe2336d4 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java index 9a1e65114648..710f35030363 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java index 64f2debe0395..54b9601550c5 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 77c82ef6a3ca..1130124051bf 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java index a8e8b81ee313..25e766c40edb 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6ac9db96adcd..f5425c1d5f9d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -38,7 +38,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 1e377b531d55..94c308e6c304 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -39,7 +39,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java index 83979c42fb72..a289c89f5e60 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java index 8fac0ca29889..f797d243ea7b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java @@ -62,7 +62,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCatAllOf.java index f0822b5887d8..35537933cb1b 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/CatAllOf.java index 4b48d9f85879..6222fed9d8e8 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/DogAllOf.java index 43845b6171f8..eebf3332059b 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java index be96737e8557..0c0412cb2658 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java @@ -39,6 +39,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java index 588afd472ff6..880602183805 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java @@ -52,6 +52,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 9c1665a812bf..4e0f5d3046c7 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -35,6 +35,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java index 0573efb7bd06..92d98164d09d 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java @@ -36,6 +36,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f2112a0d961d..b60409db551e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -36,6 +36,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java index 0de39ec2ab0a..176014187cf8 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) +@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java index 19025e8ec4f3..a3307d73ae9f 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) +@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java index 57f315ddad84..48cda5542525 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java index 733b9e116cd8..de091732b54d 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java index f0822b5887d8..35537933cb1b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index 4b48d9f85879..6222fed9d8e8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index 43845b6171f8..eebf3332059b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index be96737e8557..0c0412cb2658 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -39,6 +39,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 1dc1a8505b14..d82bdbc998a2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -52,6 +52,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 9c1665a812bf..4e0f5d3046c7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -35,6 +35,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 0573efb7bd06..92d98164d09d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -36,6 +36,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f2112a0d961d..b60409db551e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -36,6 +36,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java index 0de39ec2ab0a..176014187cf8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) +@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java index 19025e8ec4f3..a3307d73ae9f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) +@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 57f315ddad84..48cda5542525 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 733b9e116cd8..de091732b54d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f9d94e243c6f..f9a9a3d9f7f9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 5863e89d07fa..5042678d9158 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -37,7 +37,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 819f55843464..3f14c0556cb4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index d0c10077a984..08e66c4a5598 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -48,7 +48,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 877502c1681e..2341d7367d7c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 6e6337b13f75..5531b90c00db 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -37,7 +37,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index f37f91ac286d..be5b538e5330 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index ccd38c956d01..e3d50bc073b6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java index fde8cfea9c21..093a7285df9f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java @@ -40,7 +40,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index cb76f14ae196..93c455587f49 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -37,7 +37,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index f64ab1cf4a1d..8e87ac5b3d35 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -37,7 +37,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java index 5aaddbbf4913..4cf4c59f7f2e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -39,7 +39,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java index 7e450b499211..44188dcd33f7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java @@ -38,7 +38,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java index b1ead3dabc96..81024c4b79fc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -39,7 +39,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java index 928cca805264..72b9932e92dc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java @@ -39,7 +39,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java index d447bb8af000..65981c4b1435 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -35,7 +35,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java index e5da2c0342bd..69c4acbcdda6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java index 48d451925906..187c5aa0f41e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java index c660018d8b83..121b65548f05 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java @@ -38,7 +38,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java index ad10f67b0d70..15e56c7b19cf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -37,7 +37,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 9aa13f2db0ff..9faa20ad35c2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -38,7 +38,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java index 312bffabdfef..2c5d44dd7cbd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java @@ -40,7 +40,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6286fd7b31d8..57e96365bc83 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -42,7 +42,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java index 693f2a9e0a28..87c3cae986ea 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java @@ -38,7 +38,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java index bfc4e0c5bed1..027c1c3cc636 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java index 32ca832daf7f..e83599822720 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -40,7 +40,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java index 7e2fc32926a5..8865835c60b8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -37,7 +37,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java index cb9fc8fefa90..515e741f6798 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -46,7 +46,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index d5d7a523467c..12743501dbd8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -35,7 +35,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java index f5f137bd05d2..a8cefec4a131 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -35,7 +35,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0234af961fcb..be4591d3ef6b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -41,7 +41,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9ff7733be73b..619e4073412b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -42,7 +42,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java index 5267a6c43f8f..568b1cd1190e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java @@ -41,7 +41,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java index ce281b246530..dbf1dc9883a5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -65,7 +65,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 57b75a4e5dd8..957cc2b807aa 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index dfd316bf1046..e5162ab46123 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index c6e7164efa7d..98ea69f7f4a8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 6bb1861f65d1..22fe0a8e0f42 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -45,7 +45,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 2c67aa963673..3a87682ab4a2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 90250b719b87..c6da3609d42b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index abd6ff204b79..ec6a2360fe64 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 324c57fde5e7..3ba318c8ac28 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index 8563c7d9e705..6f303f173ae2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -37,7 +37,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 99c326878949..395b4c4d405d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b995540f6280..81437ecc350b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java index ab3d8a2cc285..29e8fde2a2bc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java index 8f57023a54ae..03e9592e224b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java index 9dc31fc1bea9..09da87c7676a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java index 4726746bb7b8..1f3434c2ec64 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java index a76c23cd2c46..9ecb9793f886 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java index 1e6987ac7392..02a70314cfda 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java index a91695f70536..c0e12096086d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java index 306a371d5a36..806f7a66fe90 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java index dd78a19e82a8..f5b42b0b8739 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 78045f685e85..43c10d8609b0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index 3b4a4aaf56df..f21d8f15c1e0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2ae360810626..b6361509275f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java index 8f1e9b423d2c..b263b708fefe 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java index 77a36e15c97f..4a268ea06ea6 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java index 098dcd4e8d49..34dcbe2336d4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java index 9a1e65114648..710f35030363 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index 7b39879b1288..27121c69698e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 77c82ef6a3ca..1130124051bf 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java index a8e8b81ee313..25e766c40edb 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index adf9cfe99537..b4e2af9d2546 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -38,7 +38,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java index ef3cd0d7b5ba..e550b7a42198 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -39,7 +39,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java index 83979c42fb72..a289c89f5e60 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java index a8dcac646f6d..f038a2d4b987 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java @@ -62,7 +62,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 1c049d42ab0d..a6b4473f8dbb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesAnyType") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 703308a5e55a..daeb05b45743 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesArray") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index cea7fda7e465..7702ad08ce39 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesBoolean") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b9818df7b048..528a69212c33 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesClass") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 0e67727b7436..35f1354b31cb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesInteger") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 2d0f4c51cada..855869f6c426 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesNumber") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 87e1d3b7c1c7..ab334d13d19e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesObject") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8607e3bdc3a5..0213454f77db 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesString") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index c4934b6766c6..be4ebc6ccfbc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -39,7 +39,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 99a738af3bce..ee9eb8dbd4cd 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ArrayOfArrayOfNumberOnly") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index e022a51cb5c2..e70efdd577e8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ArrayOfNumberOnly") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java index e7e2c942e436..c8fe4d1a1f85 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -38,7 +38,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ArrayTest") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java index cc840ec54115..ff75a1b3fa0a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java @@ -37,7 +37,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java index 6ba26921340a..a296d6dc230e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java @@ -38,7 +38,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Capitalization") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java index 901f289caaf3..8c21afcb7398 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java @@ -38,7 +38,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java index d4fdf9c896fd..bd3fdf809469 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java @@ -34,7 +34,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Category") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java index 67752e8f16f1..f7377c80c065 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ClassModel") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java index 983d14e0ad4f..762614cbb9eb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Client") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java index a382687fa013..5027d3dffdad 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java @@ -37,7 +37,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java index ec61f354cc78..d102eb00fcb7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -36,7 +36,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "EnumArrays") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4d8a8cdb4a89..95ea9e88ae0f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -37,7 +37,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "FileSchemaTestClass") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index b3a9dfb9eff8..6f2e3c49cc43 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -39,7 +39,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "MapTest") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4f80f5ecfaa3..a452e0b47fed 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -41,7 +41,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "MixedPropertiesAndAdditionalPropertiesClass") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java index 54d844de3971..c47c69fb153f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java @@ -37,7 +37,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Name") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java index 54eadddec84d..90fe00684b28 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "NumberOnly") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index ffae074f6c21..1d158746721f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -39,7 +39,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Order") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index 0c326ec93dc3..c95caa085428 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -36,7 +36,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "OuterComposite") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index 476daea7b3b1..220ab00320c6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -45,7 +45,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Pet") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7cdee18b12eb..8abba1a8d62b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -34,7 +34,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ReadOnlyFirst") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java index 284f4a6ad980..b79352b6a732 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java @@ -34,7 +34,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Tag") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 08a78ab1c139..f3cae2496a58 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -40,7 +40,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "TypeHolderDefault") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 559974b2aeba..ba08b0e7b42d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -41,7 +41,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "TypeHolderExample") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java index 4fda57eabde6..bfdc061945a9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java @@ -40,7 +40,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "User") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java index b8feb9122562..121199ecadce 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java @@ -64,7 +64,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(namespace="http://a.com/schema", name = "XmlItem") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 57b75a4e5dd8..957cc2b807aa 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index dfd316bf1046..e5162ab46123 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index c6e7164efa7d..98ea69f7f4a8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 6bb1861f65d1..22fe0a8e0f42 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -45,7 +45,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 2c67aa963673..3a87682ab4a2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 90250b719b87..c6da3609d42b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index abd6ff204b79..ec6a2360fe64 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 324c57fde5e7..3ba318c8ac28 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index 8563c7d9e705..6f303f173ae2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -37,7 +37,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 99c326878949..395b4c4d405d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b995540f6280..81437ecc350b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java index ab3d8a2cc285..29e8fde2a2bc 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java index 8f57023a54ae..03e9592e224b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java index 9dc31fc1bea9..09da87c7676a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java index 4726746bb7b8..1f3434c2ec64 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index a76c23cd2c46..9ecb9793f886 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java index 1e6987ac7392..02a70314cfda 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java index a91695f70536..c0e12096086d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java index 306a371d5a36..806f7a66fe90 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java index dd78a19e82a8..f5b42b0b8739 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 78045f685e85..43c10d8609b0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index 3b4a4aaf56df..f21d8f15c1e0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2ae360810626..b6361509275f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java index 8f1e9b423d2c..b263b708fefe 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java index 77a36e15c97f..4a268ea06ea6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index 098dcd4e8d49..34dcbe2336d4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index 9a1e65114648..710f35030363 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index 7b39879b1288..27121c69698e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 77c82ef6a3ca..1130124051bf 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index a8e8b81ee313..25e766c40edb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index adf9cfe99537..b4e2af9d2546 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -38,7 +38,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java index ef3cd0d7b5ba..e550b7a42198 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -39,7 +39,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java index 83979c42fb72..a289c89f5e60 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java index a8dcac646f6d..f038a2d4b987 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java @@ -62,7 +62,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 933ad4034721..1fb2379e811c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 237f40d1b6b5..130f672b1a7b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5ef118dde7cc..462c0c3d6eff 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 9135167a9b9e..70bc409d8db6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -47,7 +47,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 170a837b9f7b..784bdd22cbf7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index a8c569e21a41..b501d4495c05 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index f65487cacad2..5b98814ffec1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 5c2ff9b8437d..411b9db6bf7e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index aff9d725f167..d08460a47c48 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -39,7 +39,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 9257487c56eb..555cf4f6ddc8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9a53f9d446cf..9e76090d3098 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java index e0a84f4289ba..a5b45ae5b9d4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -38,7 +38,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java index 5d4517b9b925..2c3ec8c9a5a1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java @@ -37,7 +37,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java index 23cdbede2016..793d7f0cee97 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java @@ -38,7 +38,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java index a831aeff4514..4530736d7ca1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java @@ -38,7 +38,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java index 1fb4f6f0d608..d1161eed8b3f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java @@ -34,7 +34,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java index 55f441114cfc..c467f79b3f76 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java index 6020d6086b29..027622d616a2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java index a5acff86622b..4fca866a8c12 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java @@ -37,7 +37,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java index 9580eca2fe0f..a24ef7f852fb 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -36,7 +36,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 88802be1f2f9..5e98e4ce7ddd 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -37,7 +37,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java index 6c23883998d7..91bd60bc0409 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java @@ -39,7 +39,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index be0bcca382b8..dd9aad2dbb62 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -41,7 +41,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java index b663dd7d5e9d..868bbaeec85f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java @@ -37,7 +37,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java index 82f640404002..66b422039b01 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java index acda20d5db06..00a3983cf94a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java @@ -39,7 +39,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java index b6e9c9923ae7..3007e768ff68 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -36,7 +36,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java index 025e32508c85..22d6c3ec75ad 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java @@ -45,7 +45,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f6fa0a065b53..b196c9adbc12 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -34,7 +34,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java index 4decae666b15..bf8e34e7a33a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java @@ -34,7 +34,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 5932d2a416dd..d76352b15de0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -40,7 +40,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java index bbf0c177813d..2d8afb925bc2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -41,7 +41,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java index 21a022681e43..b7e85e77bfa6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java @@ -40,7 +40,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java index 6bff621c24b3..cdd7061544cc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java @@ -64,7 +64,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 57b75a4e5dd8..957cc2b807aa 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index dfd316bf1046..e5162ab46123 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index c6e7164efa7d..98ea69f7f4a8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 6bb1861f65d1..22fe0a8e0f42 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -45,7 +45,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 2c67aa963673..3a87682ab4a2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 90250b719b87..c6da3609d42b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index abd6ff204b79..ec6a2360fe64 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 324c57fde5e7..3ba318c8ac28 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index 8563c7d9e705..6f303f173ae2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -37,7 +37,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 99c326878949..395b4c4d405d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b995540f6280..81437ecc350b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index ab3d8a2cc285..29e8fde2a2bc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index 8f57023a54ae..03e9592e224b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index 9dc31fc1bea9..09da87c7676a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index 4726746bb7b8..1f3434c2ec64 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java index a76c23cd2c46..9ecb9793f886 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index 1e6987ac7392..02a70314cfda 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java index a91695f70536..c0e12096086d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 306a371d5a36..806f7a66fe90 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index dd78a19e82a8..f5b42b0b8739 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 78045f685e85..43c10d8609b0 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index 3b4a4aaf56df..f21d8f15c1e0 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2ae360810626..b6361509275f 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java index 8f1e9b423d2c..b263b708fefe 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index 77a36e15c97f..4a268ea06ea6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java index 098dcd4e8d49..34dcbe2336d4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index 9a1e65114648..710f35030363 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index 7b39879b1288..27121c69698e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 77c82ef6a3ca..1130124051bf 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index a8e8b81ee313..25e766c40edb 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index adf9cfe99537..b4e2af9d2546 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -38,7 +38,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index ef3cd0d7b5ba..e550b7a42198 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -39,7 +39,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java index 83979c42fb72..a289c89f5e60 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index a8dcac646f6d..f038a2d4b987 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -62,7 +62,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 57b75a4e5dd8..957cc2b807aa 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index dfd316bf1046..e5162ab46123 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index c6e7164efa7d..98ea69f7f4a8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 6bb1861f65d1..22fe0a8e0f42 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -45,7 +45,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 2c67aa963673..3a87682ab4a2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 90250b719b87..c6da3609d42b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index abd6ff204b79..ec6a2360fe64 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 324c57fde5e7..3ba318c8ac28 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) -@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index 8563c7d9e705..6f303f173ae2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -37,7 +37,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 99c326878949..395b4c4d405d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b995540f6280..81437ecc350b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java index ab3d8a2cc285..29e8fde2a2bc 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java index 8f57023a54ae..03e9592e224b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java index 9dc31fc1bea9..09da87c7676a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java index 4726746bb7b8..1f3434c2ec64 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java index a76c23cd2c46..9ecb9793f886 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java index 1e6987ac7392..02a70314cfda 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java index a91695f70536..c0e12096086d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java index 306a371d5a36..806f7a66fe90 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java index dd78a19e82a8..f5b42b0b8739 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 78045f685e85..43c10d8609b0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index 3b4a4aaf56df..f21d8f15c1e0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index c82c9ddc19b9..a7abbab8c555 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java index 8f1e9b423d2c..b263b708fefe 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java index 77a36e15c97f..4a268ea06ea6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java index 34f645fc3289..4fccc19338f1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java index 9a1e65114648..710f35030363 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java index 7b39879b1288..27121c69698e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 77c82ef6a3ca..1130124051bf 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java index a8e8b81ee313..25e766c40edb 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index adf9cfe99537..b4e2af9d2546 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -38,7 +38,6 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java index ef3cd0d7b5ba..e550b7a42198 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -39,7 +39,6 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java index 83979c42fb72..a289c89f5e60 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java index a8dcac646f6d..f038a2d4b987 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java @@ -62,7 +62,6 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java index 02d26b01105d..664f570c7e44 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java @@ -40,7 +40,6 @@ ByteArrayObject.JSON_PROPERTY_STRING_FIELD, ByteArrayObject.JSON_PROPERTY_INT_FIELD }) -@JsonTypeName("ByteArrayObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ByteArrayObject { public static final String JSON_PROPERTY_NULLABLE_ARRAY = "nullableArray"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 721ccbb9c00a..28a144fd4f4d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -35,7 +35,6 @@ AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY }) -@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index ee588a3cf4c9..845e30d5a772 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -36,7 +36,6 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 99c326878949..395b4c4d405d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b995540f6280..81437ecc350b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java index ab3d8a2cc285..29e8fde2a2bc 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,7 +36,6 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java index 9dc31fc1bea9..09da87c7676a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -36,7 +36,6 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index 6cd5f2811efc..9f6822877f8f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java index a76c23cd2c46..9ecb9793f886 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java @@ -32,7 +32,6 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java index 1e6987ac7392..02a70314cfda 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java index a91695f70536..c0e12096086d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 8ce005bca559..43b0f5f7645d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ DeprecatedObject.JSON_PROPERTY_NAME }) -@JsonTypeName("DeprecatedObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DeprecatedObject { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java index 306a371d5a36..806f7a66fe90 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,6 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java index dd78a19e82a8..f5b42b0b8739 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -34,7 +34,6 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 78045f685e85..43c10d8609b0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,7 +35,6 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java index 23e8d2d84765..fe477338c490 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ Foo.JSON_PROPERTY_BAR }) -@JsonTypeName("Foo") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Foo { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java index ca53feb8faa6..19f2227d84bf 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -36,7 +36,6 @@ @JsonPropertyOrder({ HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE }) -@JsonTypeName("HealthCheckResult") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HealthCheckResult { public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index 3b4a4aaf56df..f21d8f15c1e0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -37,7 +37,6 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index c82c9ddc19b9..a7abbab8c555 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -39,7 +39,6 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java index 8f1e9b423d2c..b263b708fefe 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java @@ -35,7 +35,6 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java index 78c77b4385fa..efc2e3716703 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java @@ -53,7 +53,6 @@ NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) -@JsonTypeName("NullableClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NullableClass extends HashMap { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 77a36e15c97f..4a268ea06ea6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 7d9ebe2cfde3..3831a4d330ae 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -38,7 +38,6 @@ ObjectWithDeprecatedFields.JSON_PROPERTY_DEPRECATED_REF, ObjectWithDeprecatedFields.JSON_PROPERTY_BARS }) -@JsonTypeName("ObjectWithDeprecatedFields") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ObjectWithDeprecatedFields { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java index 34f645fc3289..4fccc19338f1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java @@ -37,7 +37,6 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 9a1e65114648..710f35030363 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -34,7 +34,6 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 6dfd8bbdcf28..1669551078e2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ OuterObjectWithEnumProperty.JSON_PROPERTY_VALUE }) -@JsonTypeName("OuterObjectWithEnumProperty") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterObjectWithEnumProperty { public static final String JSON_PROPERTY_VALUE = "value"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index 7b39879b1288..27121c69698e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -43,7 +43,6 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 77c82ef6a3ca..1130124051bf 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -32,7 +32,6 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java index a8e8b81ee313..25e766c40edb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java @@ -32,7 +32,6 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java index 83979c42fb72..a289c89f5e60 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java @@ -38,7 +38,6 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java index 3ab8ad09cb6d..eb9d1d35f36d 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 3ab8ad09cb6d..eb9d1d35f36d 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java index 3ab8ad09cb6d..eb9d1d35f36d 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java index 3ab8ad09cb6d..eb9d1d35f36d 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java index 0bc65ec9d911..a317e0d27b47 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ ChildSchemaAllOf.JSON_PROPERTY_PROP1 }) +@JsonTypeName("ChildSchema_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ChildSchemaAllOf { public static final String JSON_PROPERTY_PROP1 = "prop1"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java index 38dfaa71eacf..3d163c3c9597 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java @@ -43,9 +43,9 @@ @JsonPropertyOrder({ MySchemaNameCharacters.JSON_PROPERTY_PROP2 }) +@JsonTypeName("MySchemaName._-Characters") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "objectType", visible = true) -@JsonTypeName("MySchemaName._-Characters") public class MySchemaNameCharacters extends Parent { public static final String JSON_PROPERTY_PROP2 = "prop2"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java index 966da5e78557..fb611324f2de 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ MySchemaNameCharactersAllOf.JSON_PROPERTY_PROP2 }) +@JsonTypeName("MySchemaName___Characters_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MySchemaNameCharactersAllOf { public static final String JSON_PROPERTY_PROP2 = "prop2"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java index e182ba4f7aa8..1dfa1d804107 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java @@ -35,6 +35,7 @@ Apple.JSON_PROPERTY_CULTIVAR, Apple.JSON_PROPERTY_ORIGIN }) +@JsonTypeName("apple") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Apple { public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java index a6364100b949..7fea72737529 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java @@ -35,6 +35,7 @@ AppleReq.JSON_PROPERTY_CULTIVAR, AppleReq.JSON_PROPERTY_MEALY }) +@JsonTypeName("appleReq") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AppleReq { public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java index c40724818be7..0111884795d6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Banana.JSON_PROPERTY_LENGTH_CM }) +@JsonTypeName("banana") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Banana { public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java index e999834dd834..53acfbce6188 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java @@ -36,6 +36,7 @@ BananaReq.JSON_PROPERTY_LENGTH_CM, BananaReq.JSON_PROPERTY_SWEET }) +@JsonTypeName("bananaReq") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BananaReq { public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index 4b48d9f85879..6222fed9d8e8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java index 76c51f86af80..4f0a6fde8c7f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java @@ -37,6 +37,7 @@ ChildCatAllOf.JSON_PROPERTY_NAME, ChildCatAllOf.JSON_PROPERTY_PET_TYPE }) +@JsonTypeName("ChildCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ChildCatAllOf { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index 43845b6171f8..eebf3332059b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 88c595176173..f7f0b7c40094 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -50,6 +50,7 @@ EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 0575f277044f..b160ec254e56 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -54,6 +54,7 @@ FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 9c1665a812bf..4e0f5d3046c7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -35,6 +35,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java index f69147ae0a2d..f49a48dad09d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ InlineResponseDefault.JSON_PROPERTY_STRING }) +@JsonTypeName("inline_response_default") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class InlineResponseDefault { public static final String JSON_PROPERTY_STRING = "string"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 0573efb7bd06..92d98164d09d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -36,6 +36,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f2112a0d961d..b60409db551e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -36,6 +36,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java index 0de39ec2ab0a..176014187cf8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) +@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java index 19025e8ec4f3..a3307d73ae9f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) +@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 57f315ddad84..48cda5542525 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 981578922c9c..a37085f8b0e0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -35,6 +35,7 @@ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, SpecialModelName.JSON_PROPERTY_SPECIAL_MODEL_NAME }) +@JsonTypeName("_special_model.name_") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java index ee5e24a8bf8b..8d52875cee88 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java @@ -36,6 +36,7 @@ Whale.JSON_PROPERTY_HAS_TEETH, Whale.JSON_PROPERTY_CLASS_NAME }) +@JsonTypeName("whale") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Whale { public static final String JSON_PROPERTY_HAS_BALEEN = "hasBaleen"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java index 5cb16abe582b..dc56517b8d9a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java @@ -39,6 +39,7 @@ Zebra.JSON_PROPERTY_TYPE, Zebra.JSON_PROPERTY_CLASS_NAME }) +@JsonTypeName("zebra") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Zebra { /** diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index a4e1474ceb8b..4b506b9a6812 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -59,7 +59,7 @@ public interface PetApi { consumes = "application/json" ) CompletableFuture> addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -86,8 +86,8 @@ CompletableFuture> addPet( value = "/pet/{petId}" ) CompletableFuture> deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ); @@ -104,7 +104,10 @@ CompletableFuture> deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -117,7 +120,7 @@ CompletableFuture> deletePet( produces = "application/json" ) CompletableFuture>> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ); @@ -135,7 +138,10 @@ CompletableFuture>> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -148,7 +154,7 @@ CompletableFuture>> findPetsByStatus( produces = "application/json" ) CompletableFuture>> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags ); @@ -166,7 +172,10 @@ CompletableFuture>> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -180,7 +189,7 @@ CompletableFuture>> findPetsByTags( produces = "application/json" ) CompletableFuture> getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ); @@ -211,7 +220,7 @@ CompletableFuture> getPetById( consumes = "application/json" ) CompletableFuture> updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -240,9 +249,9 @@ CompletableFuture> updatePet( consumes = "application/x-www-form-urlencoded" ) CompletableFuture> updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @RequestParam(value="name", required=false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @RequestParam(value="status", required=false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @RequestParam(value="name", required=false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @RequestParam(value="status", required=false) String status ); @@ -259,7 +268,9 @@ CompletableFuture> updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -272,9 +283,9 @@ CompletableFuture> updatePetWithForm( consumes = "multipart/form-data" ) CompletableFuture> uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestParam("file") MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestParam("file") MultipartFile file ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index ce28c3358385..0a7cdb2f5a13 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -58,7 +58,7 @@ public interface StoreApi { value = "/store/order/{orderId}" ) CompletableFuture> deleteOrder( - @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("orderId") String orderId + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ); @@ -73,7 +73,9 @@ CompletableFuture> deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -103,7 +105,10 @@ CompletableFuture>> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -114,7 +119,7 @@ CompletableFuture>> getInventory( produces = "application/json" ) CompletableFuture> getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("orderId") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ); @@ -130,7 +135,10 @@ CompletableFuture> getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -140,7 +148,7 @@ CompletableFuture> getOrderById( produces = "application/json" ) CompletableFuture> placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 043fd45a392b..c71f790b7362 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -57,7 +57,7 @@ public interface UserApi { value = "/user" ) CompletableFuture> createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ); @@ -80,7 +80,7 @@ CompletableFuture> createUser( value = "/user/createWithArray" ) CompletableFuture> createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -103,7 +103,7 @@ CompletableFuture> createUsersWithArrayInput( value = "/user/createWithList" ) CompletableFuture> createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -129,7 +129,7 @@ CompletableFuture> createUsersWithListInput( value = "/user/{username}" ) CompletableFuture> deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ); @@ -146,7 +146,10 @@ CompletableFuture> deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -157,7 +160,7 @@ CompletableFuture> deleteUser( produces = "application/json" ) CompletableFuture> getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ); @@ -174,7 +177,10 @@ CompletableFuture> getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -184,8 +190,8 @@ CompletableFuture> getUserByName( produces = "application/json" ) CompletableFuture> loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ); @@ -234,8 +240,8 @@ CompletableFuture> logoutUser( value = "/user/{username}" ) CompletableFuture> updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java index ea4f1e402648..a235a99f9035 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index fe29d68a5724..e849c4697f96 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -56,10 +56,10 @@ public interface DefaultApi { value = "/thingy/{date}" ) ResponseEntity get( - @Parameter(name = "date", description = "A date path parameter", required = true, schema = @Schema(description = "")) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @NotNull @Parameter(name = "dateTime", description = "A date-time query parameter", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "dateTime", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "X-Order-Date", description = "A date header parameter", required = true, schema = @Schema(description = "")) @RequestHeader(value = "X-Order-Date", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate, - @Parameter(name = "loginDate", description = "A date cookie parameter", schema = @Schema(description = "")) @CookieValue("loginDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate + @Parameter(name = "date", description = "A date path parameter", required = true) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @NotNull @Parameter(name = "dateTime", description = "A date-time query parameter", required = true) @Valid @RequestParam(value = "dateTime", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "X-Order-Date", description = "A date header parameter", required = true) @RequestHeader(value = "X-Order-Date", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate, + @Parameter(name = "loginDate", description = "A date cookie parameter") @CookieValue("loginDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate ); @@ -83,8 +83,8 @@ ResponseEntity get( consumes = "application/x-www-form-urlencoded" ) ResponseEntity updatePetWithForm( - @Parameter(name = "date", description = "A date path parameter", required = true, schema = @Schema(description = "")) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "visitDate", description = "Updated last vist timestamp", schema = @Schema(description = "")) @RequestParam(value="visitDate", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate + @Parameter(name = "date", description = "A date path parameter", required = true) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "visitDate", description = "Updated last vist timestamp") @RequestParam(value="visitDate", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java index c37a73915a4a..e0237bfedccb 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -46,7 +46,9 @@ public interface AnotherFakeApi { summary = "To test special tags", tags = { "$another-fake?" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -56,7 +58,7 @@ public interface AnotherFakeApi { consumes = "application/json" ) ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index a17844c874cc..72370cfbf04e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -64,7 +64,7 @@ public interface FakeApi { consumes = "application/xml" ) ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true, schema = @Schema(description = "")) @Valid @RequestBody XmlItem xmlItem + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ); @@ -79,7 +79,9 @@ ResponseEntity createXmlItem( operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) } ) @RequestMapping( @@ -88,7 +90,7 @@ ResponseEntity createXmlItem( produces = "*/*" ) ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Boolean body + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ); @@ -103,7 +105,9 @@ ResponseEntity fakeOuterBooleanSerialize( operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) } ) @RequestMapping( @@ -112,7 +116,7 @@ ResponseEntity fakeOuterBooleanSerialize( produces = "*/*" ) ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ); @@ -127,7 +131,9 @@ ResponseEntity fakeOuterCompositeSerialize( operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) } ) @RequestMapping( @@ -136,7 +142,7 @@ ResponseEntity fakeOuterCompositeSerialize( produces = "*/*" ) ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) BigDecimal body + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ); @@ -151,7 +157,9 @@ ResponseEntity fakeOuterNumberSerialize( operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) } ) @RequestMapping( @@ -160,7 +168,7 @@ ResponseEntity fakeOuterNumberSerialize( produces = "*/*" ) ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) String body + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ); @@ -184,7 +192,7 @@ ResponseEntity fakeOuterStringSerialize( consumes = "application/json" ) ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ); @@ -208,8 +216,8 @@ ResponseEntity testBodyWithFileSchema( consumes = "application/json" ) ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ); @@ -225,7 +233,9 @@ ResponseEntity testBodyWithQueryParams( summary = "To test \"client\" model", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -235,7 +245,7 @@ ResponseEntity testBodyWithQueryParams( consumes = "application/json" ) ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ); @@ -278,20 +288,20 @@ ResponseEntity testClientModel( consumes = "application/x-www-form-urlencoded" ) ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true, schema = @Schema(description = "")) @RequestParam(value="number", required=true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true, schema = @Schema(description = "")) @RequestParam(value="double", required=true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true, schema = @Schema(description = "")) @RequestParam(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true, schema = @Schema(description = "")) @RequestParam(value="byte", required=true) byte[] _byte, - @Parameter(name = "integer", description = "None", schema = @Schema(description = "")) @RequestParam(value="integer", required=false) Integer integer, - @Parameter(name = "int32", description = "None", schema = @Schema(description = "")) @RequestParam(value="int32", required=false) Integer int32, - @Parameter(name = "int64", description = "None", schema = @Schema(description = "")) @RequestParam(value="int64", required=false) Long int64, - @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @RequestParam(value="float", required=false) Float _float, - @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @RequestParam(value="string", required=false) String string, - @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestParam("binary") MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @RequestParam(value="date", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @RequestParam(value="dateTime", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @RequestParam(value="password", required=false) String password, - @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @RequestParam(value="callback", required=false) String paramCallback + @Parameter(name = "number", description = "None", required = true) @RequestParam(value="number", required=true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @RequestParam(value="double", required=true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @RequestParam(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @RequestParam(value="byte", required=true) byte[] _byte, + @Parameter(name = "integer", description = "None") @RequestParam(value="integer", required=false) Integer integer, + @Parameter(name = "int32", description = "None") @RequestParam(value="int32", required=false) Integer int32, + @Parameter(name = "int64", description = "None") @RequestParam(value="int64", required=false) Long int64, + @Parameter(name = "float", description = "None") @RequestParam(value="float", required=false) Float _float, + @Parameter(name = "string", description = "None") @RequestParam(value="string", required=false) String string, + @Parameter(name = "binary", description = "None") @RequestParam("binary") MultipartFile binary, + @Parameter(name = "date", description = "None") @RequestParam(value="date", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @RequestParam(value="dateTime", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @RequestParam(value="password", required=false) String password, + @Parameter(name = "callback", description = "None") @RequestParam(value="callback", required=false) String paramCallback ); @@ -325,14 +335,14 @@ ResponseEntity testEndpointParameters( consumes = "application/x-www-form-urlencoded" ) ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1", "-2" })) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1.1", "-1.2" })) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @RequestParam(value="enum_form_string_array", required=false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @RequestParam(value="enum_form_string", required=false) String enumFormString + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @RequestParam(value="enum_form_string_array", required=false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @RequestParam(value="enum_form_string", required=false) String enumFormString ); @@ -361,12 +371,12 @@ ResponseEntity testEnumParameters( value = "/fake" ) ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, schema = @Schema(description = "")) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", schema = @Schema(description = "")) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group ); @@ -390,7 +400,7 @@ ResponseEntity testGroupParameters( consumes = "application/json" ) ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true, schema = @Schema(description = "")) @Valid @RequestBody Map param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ); @@ -415,8 +425,8 @@ ResponseEntity testInlineAdditionalProperties( consumes = "application/x-www-form-urlencoded" ) ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true, schema = @Schema(description = "")) @RequestParam(value="param", required=true) String param, - @Parameter(name = "param2", description = "field2", required = true, schema = @Schema(description = "")) @RequestParam(value="param2", required=true) String param2 + @Parameter(name = "param", description = "field1", required = true) @RequestParam(value="param", required=true) String param, + @Parameter(name = "param2", description = "field2", required = true) @RequestParam(value="param2", required=true) String param2 ); @@ -443,11 +453,11 @@ ResponseEntity testJsonFormData( value = "/fake/test-query-parameters" ) ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "context", required = true) List context + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index fd9a8e3e74ec..db15af3b8d12 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -46,7 +46,9 @@ public interface FakeClassnameTags123Api { summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) }, security = { @SecurityRequirement(name = "api_key_query") @@ -59,7 +61,7 @@ public interface FakeClassnameTags123Api { consumes = "application/json" ) ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java index cb02a7f60cd8..379b6cc8dcea 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java @@ -61,7 +61,7 @@ public interface PetApi { consumes = "application/json" ) ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -90,8 +90,8 @@ ResponseEntity addPet( value = "/pet/{petId}" ) ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ); @@ -108,7 +108,10 @@ ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -121,7 +124,7 @@ ResponseEntity deletePet( produces = "application/json" ) ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ); @@ -139,7 +142,10 @@ ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -152,7 +158,7 @@ ResponseEntity> findPetsByStatus( produces = "application/json" ) ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) Set tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ); @@ -170,7 +176,10 @@ ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -184,7 +193,7 @@ ResponseEntity> findPetsByTags( produces = "application/json" ) ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ); @@ -217,7 +226,7 @@ ResponseEntity getPetById( consumes = "application/json" ) ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -246,9 +255,9 @@ ResponseEntity updatePet( consumes = "application/x-www-form-urlencoded" ) ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @RequestParam(value="name", required=false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @RequestParam(value="status", required=false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @RequestParam(value="name", required=false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @RequestParam(value="status", required=false) String status ); @@ -265,7 +274,9 @@ ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -278,9 +289,9 @@ ResponseEntity updatePetWithForm( consumes = "multipart/form-data" ) ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestParam("file") MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestParam("file") MultipartFile file ); @@ -297,7 +308,9 @@ ResponseEntity uploadFile( summary = "uploads an image (required)", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -310,9 +323,9 @@ ResponseEntity uploadFile( consumes = "multipart/form-data" ) ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true, schema = @Schema(description = "")) @RequestParam("requiredFile") MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestParam("requiredFile") MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java index d30b583bf685..17b1e9a972f4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java @@ -57,7 +57,7 @@ public interface StoreApi { value = "/store/order/{order_id}" ) ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("order_id") String orderId + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ); @@ -72,7 +72,9 @@ ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -102,7 +104,10 @@ ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -113,7 +118,7 @@ ResponseEntity> getInventory( produces = "application/json" ) ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("order_id") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ); @@ -129,7 +134,10 @@ ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -139,7 +147,7 @@ ResponseEntity getOrderById( produces = "application/json" ) ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java index 310149ab5eaf..781f7a3f223b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java @@ -56,7 +56,7 @@ public interface UserApi { value = "/user" ) ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ); @@ -79,7 +79,7 @@ ResponseEntity createUser( value = "/user/createWithArray" ) ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -102,7 +102,7 @@ ResponseEntity createUsersWithArrayInput( value = "/user/createWithList" ) ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -128,7 +128,7 @@ ResponseEntity createUsersWithListInput( value = "/user/{username}" ) ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ); @@ -145,7 +145,10 @@ ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -156,7 +159,7 @@ ResponseEntity deleteUser( produces = "application/json" ) ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ); @@ -173,7 +176,10 @@ ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -183,8 +189,8 @@ ResponseEntity getUserByName( produces = "application/json" ) ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ); @@ -233,8 +239,8 @@ ResponseEntity logoutUser( value = "/user/{username}" ) ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java index 3640a6301af0..843e46a1f6cd 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; @@ -19,6 +20,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java index 19ffd6fffead..88bc8c3d6492 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java index cc0bafc92e34..1a4f50f5bcd4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java index 19ea0acc7a7c..fb2ee5373fbf 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java index 6790fc82a0ba..05abfd1c26ef 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -24,6 +25,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index ec728db1f145..768e7277a703 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java index 48528166d1c1..95f81f418d28 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "200_response", description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java index 4312ff4cc727..474ed54662f7 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java index 11078e7094e4..7615d501057e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java index 37c94a6aa80e..eef02c8ade31 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "Return", description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java index 3dcdd9ee3f54..1eac86e9ebca 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 68e082a37191..ba3da2527647 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -60,7 +60,7 @@ public interface PetApi { consumes = "application/json" ) ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -87,8 +87,8 @@ ResponseEntity addPet( value = "/pet/{petId}" ) ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ); @@ -105,7 +105,10 @@ ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -118,7 +121,7 @@ ResponseEntity deletePet( produces = "application/json" ) ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status, + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status, @ParameterObject final Pageable pageable ); @@ -137,7 +140,10 @@ ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -150,7 +156,7 @@ ResponseEntity> findPetsByStatus( produces = "application/json" ) ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags, + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @ParameterObject final Pageable pageable ); @@ -169,7 +175,10 @@ ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -183,7 +192,7 @@ ResponseEntity> findPetsByTags( produces = "application/json" ) ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ); @@ -214,7 +223,7 @@ ResponseEntity getPetById( consumes = "application/json" ) ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -243,9 +252,9 @@ ResponseEntity updatePet( consumes = "application/x-www-form-urlencoded" ) ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @RequestParam(value="name", required=false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @RequestParam(value="status", required=false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @RequestParam(value="name", required=false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @RequestParam(value="status", required=false) String status ); @@ -262,7 +271,9 @@ ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -275,9 +286,9 @@ ResponseEntity updatePetWithForm( consumes = "multipart/form-data" ) ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestParam("file") MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestParam("file") MultipartFile file ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index ce3c67ac8f70..9983f217acea 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -57,7 +57,7 @@ public interface StoreApi { value = "/store/order/{orderId}" ) ResponseEntity deleteOrder( - @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("orderId") String orderId + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ); @@ -72,7 +72,9 @@ ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -102,7 +104,10 @@ ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -113,7 +118,7 @@ ResponseEntity> getInventory( produces = "application/json" ) ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("orderId") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ); @@ -129,7 +134,10 @@ ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -139,7 +147,7 @@ ResponseEntity getOrderById( produces = "application/json" ) ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 72dba3efc87a..1ab0b17179ef 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -56,7 +56,7 @@ public interface UserApi { value = "/user" ) ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ); @@ -79,7 +79,7 @@ ResponseEntity createUser( value = "/user/createWithArray" ) ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -102,7 +102,7 @@ ResponseEntity createUsersWithArrayInput( value = "/user/createWithList" ) ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -128,7 +128,7 @@ ResponseEntity createUsersWithListInput( value = "/user/{username}" ) ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ); @@ -145,7 +145,10 @@ ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -156,7 +159,7 @@ ResponseEntity deleteUser( produces = "application/json" ) ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ); @@ -173,7 +176,10 @@ ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -183,8 +189,8 @@ ResponseEntity getUserByName( produces = "application/json" ) ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ); @@ -255,8 +261,8 @@ ResponseEntity logoutUserOptions( value = "/user/{username}" ) ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index ea4f1e402648..a235a99f9035 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 7da5823f0e99..d1dec5e38788 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -47,7 +47,10 @@ public interface PetApi { summary = "Add a new pet to the store", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "405", description = "Invalid input") }, security = { @@ -61,7 +64,7 @@ public interface PetApi { consumes = "application/json" ) ResponseEntity addPet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet pet + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -88,8 +91,8 @@ ResponseEntity addPet( value = "/pet/{petId}" ) ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ); @@ -106,7 +109,10 @@ ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -119,7 +125,7 @@ ResponseEntity deletePet( produces = "application/json" ) ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ); @@ -137,7 +143,10 @@ ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -150,7 +159,7 @@ ResponseEntity> findPetsByStatus( produces = "application/json" ) ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags ); @@ -168,7 +177,10 @@ ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -182,7 +194,7 @@ ResponseEntity> findPetsByTags( produces = "application/json" ) ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ); @@ -200,7 +212,10 @@ ResponseEntity getPetById( summary = "Update an existing pet", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found"), @ApiResponse(responseCode = "405", description = "Validation exception") @@ -216,7 +231,7 @@ ResponseEntity getPetById( consumes = "application/json" ) ResponseEntity updatePet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet pet + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -245,9 +260,9 @@ ResponseEntity updatePet( consumes = "application/x-www-form-urlencoded" ) ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @RequestParam(value="name", required=false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @RequestParam(value="status", required=false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @RequestParam(value="name", required=false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @RequestParam(value="status", required=false) String status ); @@ -264,7 +279,9 @@ ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -277,9 +294,9 @@ ResponseEntity updatePetWithForm( consumes = "multipart/form-data" ) ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestParam("file") MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestParam("file") MultipartFile file ); } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 58ce12ee8f96..f4bc1148a865 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -57,7 +57,7 @@ public interface StoreApi { value = "/store/order/{orderId}" ) ResponseEntity deleteOrder( - @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("orderId") String orderId + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ); @@ -72,7 +72,9 @@ ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -102,7 +104,10 @@ ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -113,7 +118,7 @@ ResponseEntity> getInventory( produces = "application/json" ) ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("orderId") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ); @@ -129,7 +134,10 @@ ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -140,7 +148,7 @@ ResponseEntity getOrderById( consumes = "application/json" ) ResponseEntity placeOrder( - @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order order + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index ffac4f85f78b..d231b4116771 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -60,7 +60,7 @@ public interface UserApi { consumes = "application/json" ) ResponseEntity createUser( - @Parameter(name = "User", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User user + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ); @@ -87,7 +87,7 @@ ResponseEntity createUser( consumes = "application/json" ) ResponseEntity createUsersWithArrayInput( - @Parameter(name = "User", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List user + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -114,7 +114,7 @@ ResponseEntity createUsersWithArrayInput( consumes = "application/json" ) ResponseEntity createUsersWithListInput( - @Parameter(name = "User", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List user + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -143,7 +143,7 @@ ResponseEntity createUsersWithListInput( value = "/user/{username}" ) ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ); @@ -160,7 +160,10 @@ ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -171,7 +174,7 @@ ResponseEntity deleteUser( produces = "application/json" ) ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ); @@ -188,7 +191,10 @@ ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -198,8 +204,8 @@ ResponseEntity getUserByName( produces = "application/json" ) ResponseEntity loginUser( - @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ); @@ -255,8 +261,8 @@ ResponseEntity logoutUser( consumes = "application/json" ) ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "User", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User user + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ); } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java index ea4f1e402648..a235a99f9035 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 2a0b918f991e..4503a2026fc0 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -62,7 +62,7 @@ default Optional getRequest() { consumes = "application/json" ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -92,8 +92,8 @@ default ResponseEntity addPet( value = "/pet/{petId}" ) default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -113,7 +113,10 @@ default ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -126,7 +129,7 @@ default ResponseEntity deletePet( produces = "application/json" ) default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -161,7 +164,10 @@ default ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -174,7 +180,7 @@ default ResponseEntity> findPetsByStatus( produces = "application/json" ) default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -209,7 +215,10 @@ default ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -223,7 +232,7 @@ default ResponseEntity> findPetsByTags( produces = "application/json" ) default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -271,7 +280,7 @@ default ResponseEntity getPetById( consumes = "application/json" ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -303,9 +312,9 @@ default ResponseEntity updatePet( consumes = "application/x-www-form-urlencoded" ) default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -325,7 +334,9 @@ default ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -338,9 +349,9 @@ default ResponseEntity updatePetWithForm( consumes = "multipart/form-data" ) default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 4969341a44fb..be4671c1c5db 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -61,7 +61,7 @@ default Optional getRequest() { value = "/store/order/{orderId}" ) default ResponseEntity deleteOrder( - @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("orderId") String orderId + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -79,7 +79,9 @@ default ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -112,7 +114,10 @@ default ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -123,7 +128,7 @@ default ResponseEntity> getInventory( produces = "application/json" ) default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("orderId") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -156,7 +161,10 @@ default ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -166,7 +174,7 @@ default ResponseEntity getOrderById( produces = "application/json" ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 2db1089ce52b..d37aeb35fde5 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -60,7 +60,7 @@ default Optional getRequest() { value = "/user" ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -86,7 +86,7 @@ default ResponseEntity createUser( value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -112,7 +112,7 @@ default ResponseEntity createUsersWithArrayInput( value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -141,7 +141,7 @@ default ResponseEntity createUsersWithListInput( value = "/user/{username}" ) default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -161,7 +161,10 @@ default ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -172,7 +175,7 @@ default ResponseEntity deleteUser( produces = "application/json" ) default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -206,7 +209,10 @@ default ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -216,8 +222,8 @@ default ResponseEntity getUserByName( produces = "application/json" ) default ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -272,8 +278,8 @@ default ResponseEntity logoutUser( value = "/user/{username}" ) default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java index ea4f1e402648..a235a99f9035 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java index 061450ef1124..16a553b637bf 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java @@ -51,7 +51,10 @@ default Optional getRequest() { summary = "Add a new pet to the store", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "405", description = "Invalid input") }, security = { @@ -65,7 +68,7 @@ default Optional getRequest() { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet pet + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -109,8 +112,8 @@ default ResponseEntity addPet( value = "/pet/{petId}" ) default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -130,7 +133,10 @@ default ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -143,7 +149,7 @@ default ResponseEntity deletePet( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -178,7 +184,10 @@ default ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -191,7 +200,7 @@ default ResponseEntity> findPetsByStatus( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -226,7 +235,10 @@ default ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -240,7 +252,7 @@ default ResponseEntity> findPetsByTags( produces = { "application/xml", "application/json" } ) default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -275,7 +287,10 @@ default ResponseEntity getPetById( summary = "Update an existing pet", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found"), @ApiResponse(responseCode = "405", description = "Validation exception") @@ -291,7 +306,7 @@ default ResponseEntity getPetById( consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet pet + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -337,9 +352,9 @@ default ResponseEntity updatePet( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -359,7 +374,9 @@ default ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -372,9 +389,9 @@ default ResponseEntity updatePetWithForm( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java index fbc6b4fa89c2..794da5c8373d 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java @@ -61,7 +61,7 @@ default Optional getRequest() { value = "/store/order/{orderId}" ) default ResponseEntity deleteOrder( - @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("orderId") String orderId + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -79,7 +79,9 @@ default ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -112,7 +114,10 @@ default ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -123,7 +128,7 @@ default ResponseEntity> getInventory( produces = { "application/xml", "application/json" } ) default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("orderId") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -156,7 +161,10 @@ default ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -167,7 +175,7 @@ default ResponseEntity getOrderById( consumes = { "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order order + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java index 17444f774be8..29ac437379b9 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java @@ -64,7 +64,7 @@ default Optional getRequest() { consumes = { "application/json" } ) default ResponseEntity createUser( - @Parameter(name = "User", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User user + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -94,7 +94,7 @@ default ResponseEntity createUser( consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "User", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List user + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -124,7 +124,7 @@ default ResponseEntity createUsersWithArrayInput( consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "User", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List user + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -156,7 +156,7 @@ default ResponseEntity createUsersWithListInput( value = "/user/{username}" ) default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -176,7 +176,10 @@ default ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -187,7 +190,7 @@ default ResponseEntity deleteUser( produces = { "application/xml", "application/json" } ) default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -221,7 +224,10 @@ default ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -231,8 +237,8 @@ default ResponseEntity getUserByName( produces = { "application/xml", "application/json" } ) default ResponseEntity loginUser( - @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -294,8 +300,8 @@ default ResponseEntity logoutUser( consumes = { "application/json" } ) default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "User", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User user + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java index ea4f1e402648..a235a99f9035 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index cf6aeeaf1f0a..7c9284a30a84 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -42,7 +42,9 @@ public interface AnotherFakeApi { summary = "To test special tags", tags = { "$another-fake?" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -52,7 +54,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index cac2bbc73b8f..0af2569895c4 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -51,7 +51,7 @@ public AnotherFakeApiController(NativeWebRequest request) { * @see AnotherFakeApi#call123testSpecialTags */ public ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 4f5f9b8dcd71..f1a1b951814b 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -61,7 +61,7 @@ public interface FakeApi { consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true, schema = @Schema(description = "")) @Valid @RequestBody XmlItem xmlItem + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ); @@ -76,7 +76,9 @@ ResponseEntity createXmlItem( operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) } ) @RequestMapping( @@ -85,7 +87,7 @@ ResponseEntity createXmlItem( produces = { "*/*" } ) ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Boolean body + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ); @@ -100,7 +102,9 @@ ResponseEntity fakeOuterBooleanSerialize( operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) } ) @RequestMapping( @@ -109,7 +113,7 @@ ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" } ) ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ); @@ -124,7 +128,9 @@ ResponseEntity fakeOuterCompositeSerialize( operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) } ) @RequestMapping( @@ -133,7 +139,7 @@ ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" } ) ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) BigDecimal body + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ); @@ -148,7 +154,9 @@ ResponseEntity fakeOuterNumberSerialize( operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) } ) @RequestMapping( @@ -157,7 +165,7 @@ ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" } ) ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) String body + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ); @@ -181,7 +189,7 @@ ResponseEntity fakeOuterStringSerialize( consumes = { "application/json" } ) ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ); @@ -205,8 +213,8 @@ ResponseEntity testBodyWithFileSchema( consumes = { "application/json" } ) ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ); @@ -222,7 +230,9 @@ ResponseEntity testBodyWithQueryParams( summary = "To test \"client\" model", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -232,7 +242,7 @@ ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ); @@ -275,20 +285,20 @@ ResponseEntity testClientModel( consumes = { "application/x-www-form-urlencoded" } ) ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ); @@ -322,14 +332,14 @@ ResponseEntity testEndpointParameters( consumes = { "application/x-www-form-urlencoded" } ) ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1", "-2" })) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1.1", "-1.2" })) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString ); @@ -358,12 +368,12 @@ ResponseEntity testEnumParameters( value = "/fake" ) ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, schema = @Schema(description = "")) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", schema = @Schema(description = "")) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group ); @@ -387,7 +397,7 @@ ResponseEntity testGroupParameters( consumes = { "application/json" } ) ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true, schema = @Schema(description = "")) @Valid @RequestBody Map param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ); @@ -412,8 +422,8 @@ ResponseEntity testInlineAdditionalProperties( consumes = { "application/x-www-form-urlencoded" } ) ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param2", required = true) String param2 + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 ); @@ -440,11 +450,11 @@ ResponseEntity testJsonFormData( value = "/fake/test-query-parameters" ) ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "context", required = true) List context + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context ); @@ -461,7 +471,9 @@ ResponseEntity testQueryParameterCollectionFormat( summary = "uploads an image (required)", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -474,9 +486,9 @@ ResponseEntity testQueryParameterCollectionFormat( consumes = { "multipart/form-data" } ) ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true, schema = @Schema(description = "")) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index b4f24ba29edf..57fb48219922 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -61,7 +61,7 @@ public FakeApiController(NativeWebRequest request) { * @see FakeApi#createXmlItem */ public ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true, schema = @Schema(description = "")) @Valid @RequestBody XmlItem xmlItem + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -76,7 +76,7 @@ public ResponseEntity createXmlItem( * @see FakeApi#fakeOuterBooleanSerialize */ public ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Boolean body + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -91,7 +91,7 @@ public ResponseEntity fakeOuterBooleanSerialize( * @see FakeApi#fakeOuterCompositeSerialize */ public ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -113,7 +113,7 @@ public ResponseEntity fakeOuterCompositeSerialize( * @see FakeApi#fakeOuterNumberSerialize */ public ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) BigDecimal body + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -128,7 +128,7 @@ public ResponseEntity fakeOuterNumberSerialize( * @see FakeApi#fakeOuterStringSerialize */ public ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) String body + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -143,7 +143,7 @@ public ResponseEntity fakeOuterStringSerialize( * @see FakeApi#testBodyWithFileSchema */ public ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -158,8 +158,8 @@ public ResponseEntity testBodyWithFileSchema( * @see FakeApi#testBodyWithQueryParams */ public ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -174,7 +174,7 @@ public ResponseEntity testBodyWithQueryParams( * @see FakeApi#testClientModel */ public ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -210,20 +210,20 @@ public ResponseEntity testClientModel( * @see FakeApi#testEndpointParameters */ public ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -246,14 +246,14 @@ public ResponseEntity testEndpointParameters( * @see FakeApi#testEnumParameters */ public ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1", "-2" })) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1.1", "-1.2" })) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -273,12 +273,12 @@ public ResponseEntity testEnumParameters( * @see FakeApi#testGroupParameters */ public ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, schema = @Schema(description = "")) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", schema = @Schema(description = "")) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -292,7 +292,7 @@ public ResponseEntity testGroupParameters( * @see FakeApi#testInlineAdditionalProperties */ public ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true, schema = @Schema(description = "")) @Valid @RequestBody Map param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -307,8 +307,8 @@ public ResponseEntity testInlineAdditionalProperties( * @see FakeApi#testJsonFormData */ public ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param2", required = true) String param2 + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -327,11 +327,11 @@ public ResponseEntity testJsonFormData( * @see FakeApi#testQueryParameterCollectionFormat */ public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "context", required = true) List context + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -347,9 +347,9 @@ public ResponseEntity testQueryParameterCollectionFormat( * @see FakeApi#uploadFileWithRequiredFile */ public ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true, schema = @Schema(description = "")) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7856c1ccfde0..623a96bfa3af 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -42,7 +42,9 @@ public interface FakeClassnameTestApi { summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) }, security = { @SecurityRequirement(name = "api_key_query") @@ -55,7 +57,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index c28517ba229d..002a76ceef94 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -51,7 +51,7 @@ public FakeClassnameTestApiController(NativeWebRequest request) { * @see FakeClassnameTestApi#testClassname */ public ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 728a50366832..a4a9df21dc46 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -57,7 +57,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -86,8 +86,8 @@ ResponseEntity addPet( value = "/pet/{petId}" ) ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ); @@ -104,7 +104,10 @@ ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -117,7 +120,7 @@ ResponseEntity deletePet( produces = { "application/xml", "application/json" } ) ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ); @@ -135,7 +138,10 @@ ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -148,7 +154,7 @@ ResponseEntity> findPetsByStatus( produces = { "application/xml", "application/json" } ) ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) Set tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ); @@ -166,7 +172,10 @@ ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -180,7 +189,7 @@ ResponseEntity> findPetsByTags( produces = { "application/xml", "application/json" } ) ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ); @@ -213,7 +222,7 @@ ResponseEntity getPetById( consumes = { "application/json", "application/xml" } ) ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -242,9 +251,9 @@ ResponseEntity updatePet( consumes = { "application/x-www-form-urlencoded" } ) ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status ); @@ -261,7 +270,9 @@ ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -274,9 +285,9 @@ ResponseEntity updatePetWithForm( consumes = { "multipart/form-data" } ) ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index 197fca8ae629..ef7bc64295dd 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -53,7 +53,7 @@ public PetApiController(NativeWebRequest request) { * @see PetApi#addPet */ public ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -69,8 +69,8 @@ public ResponseEntity addPet( * @see PetApi#deletePet */ public ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -86,7 +86,7 @@ public ResponseEntity deletePet( * @see PetApi#findPetsByStatus */ public ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -115,7 +115,7 @@ public ResponseEntity> findPetsByStatus( * @see PetApi#findPetsByTags */ public ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) Set tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -144,7 +144,7 @@ public ResponseEntity> findPetsByTags( * @see PetApi#getPetById */ public ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -173,7 +173,7 @@ public ResponseEntity getPetById( * @see PetApi#updatePet */ public ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -189,9 +189,9 @@ public ResponseEntity updatePet( * @see PetApi#updatePetWithForm */ public ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -207,9 +207,9 @@ public ResponseEntity updatePetWithForm( * @see PetApi#uploadFile */ public ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 4552b38a3c5f..57565fe8958b 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -53,7 +53,7 @@ public interface StoreApi { value = "/store/order/{order_id}" ) ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("order_id") String orderId + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ); @@ -68,7 +68,9 @@ ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -98,7 +100,10 @@ ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -109,7 +114,7 @@ ResponseEntity> getInventory( produces = { "application/xml", "application/json" } ) ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("order_id") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ); @@ -125,7 +130,10 @@ ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -135,7 +143,7 @@ ResponseEntity getOrderById( produces = { "application/xml", "application/json" } ) ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index 9b0ba8bd7203..f8cbc7b210b9 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -53,7 +53,7 @@ public StoreApiController(NativeWebRequest request) { * @see StoreApi#deleteOrder */ public ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("order_id") String orderId + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -84,7 +84,7 @@ public ResponseEntity> getInventory( * @see StoreApi#getOrderById */ public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("order_id") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -111,7 +111,7 @@ public ResponseEntity getOrderById( * @see StoreApi#placeOrder */ public ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 439fa56574e9..2d35561243db 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -52,7 +52,7 @@ public interface UserApi { value = "/user" ) ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ); @@ -75,7 +75,7 @@ ResponseEntity createUser( value = "/user/createWithArray" ) ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -98,7 +98,7 @@ ResponseEntity createUsersWithArrayInput( value = "/user/createWithList" ) ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -124,7 +124,7 @@ ResponseEntity createUsersWithListInput( value = "/user/{username}" ) ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ); @@ -141,7 +141,10 @@ ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -152,7 +155,7 @@ ResponseEntity deleteUser( produces = { "application/xml", "application/json" } ) ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ); @@ -169,7 +172,10 @@ ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -179,8 +185,8 @@ ResponseEntity getUserByName( produces = { "application/xml", "application/json" } ) ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ); @@ -229,8 +235,8 @@ ResponseEntity logoutUser( value = "/user/{username}" ) ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body ); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index 781b593f564e..bf733026fd36 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -53,7 +53,7 @@ public UserApiController(NativeWebRequest request) { * @see UserApi#createUser */ public ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -67,7 +67,7 @@ public ResponseEntity createUser( * @see UserApi#createUsersWithArrayInput */ public ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -81,7 +81,7 @@ public ResponseEntity createUsersWithArrayInput( * @see UserApi#createUsersWithListInput */ public ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -97,7 +97,7 @@ public ResponseEntity createUsersWithListInput( * @see UserApi#deleteUser */ public ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -113,7 +113,7 @@ public ResponseEntity deleteUser( * @see UserApi#getUserByName */ public ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -141,8 +141,8 @@ public ResponseEntity getUserByName( * @see UserApi#loginUser */ public ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -172,8 +172,8 @@ public ResponseEntity logoutUser( * @see UserApi#updateUser */ public ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index 56ea82672354..1948c4618e4c 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.Valid; import javax.validation.constraints.*; @@ -17,6 +18,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index 5354e8af1322..707845c261dc 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -16,6 +17,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index a82bcdc49073..44068dd905a9 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -16,6 +17,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index a9cc411bc890..357486e4bcb2 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.model.OuterEnum; import javax.validation.Valid; @@ -18,6 +19,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 708a8b392c57..9c2828613d9e 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.util.Arrays; import java.util.UUID; @@ -22,6 +23,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index adc53a60f2c2..87bfaa5169e2 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -16,6 +17,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 21c119570b91..648952ab7633 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -17,6 +18,7 @@ */ @Schema(name = "200_response", description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index b2190788b398..9ee12a74ce21 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -16,6 +17,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 65083e0155bd..aa4a512c8c5f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -16,6 +17,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 2c77d8a517a2..4a964dd8908a 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -17,6 +18,7 @@ */ @Schema(name = "Return", description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index e52a3838938e..068ed6d7943d 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -16,6 +17,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 0a6bb7e1c0ca..eeac82c9faf3 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -46,7 +46,9 @@ default AnotherFakeApiDelegate getDelegate() { summary = "To test special tags", tags = { "$another-fake?" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -56,7 +58,7 @@ default AnotherFakeApiDelegate getDelegate() { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().call123testSpecialTags(body); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 6082640bf1bb..edf8d40bf875 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -65,7 +65,7 @@ default FakeApiDelegate getDelegate() { consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) default ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true, schema = @Schema(description = "")) @Valid @RequestBody XmlItem xmlItem + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { return getDelegate().createXmlItem(xmlItem); } @@ -82,7 +82,9 @@ default ResponseEntity createXmlItem( operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) } ) @RequestMapping( @@ -91,7 +93,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" } ) default ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Boolean body + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { return getDelegate().fakeOuterBooleanSerialize(body); } @@ -108,7 +110,9 @@ default ResponseEntity fakeOuterBooleanSerialize( operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) } ) @RequestMapping( @@ -117,7 +121,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" } ) default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { return getDelegate().fakeOuterCompositeSerialize(body); } @@ -134,7 +138,9 @@ default ResponseEntity fakeOuterCompositeSerialize( operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) } ) @RequestMapping( @@ -143,7 +149,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" } ) default ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) BigDecimal body + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { return getDelegate().fakeOuterNumberSerialize(body); } @@ -160,7 +166,9 @@ default ResponseEntity fakeOuterNumberSerialize( operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) } ) @RequestMapping( @@ -169,7 +177,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" } ) default ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) String body + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ) { return getDelegate().fakeOuterStringSerialize(body); } @@ -195,7 +203,7 @@ default ResponseEntity fakeOuterStringSerialize( consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { return getDelegate().testBodyWithFileSchema(body); } @@ -221,8 +229,8 @@ default ResponseEntity testBodyWithFileSchema( consumes = { "application/json" } ) default ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ) { return getDelegate().testBodyWithQueryParams(query, body); } @@ -240,7 +248,9 @@ default ResponseEntity testBodyWithQueryParams( summary = "To test \"client\" model", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -250,7 +260,7 @@ default ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClientModel(body); } @@ -295,20 +305,20 @@ default ResponseEntity testClientModel( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -344,14 +354,14 @@ default ResponseEntity testEndpointParameters( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1", "-2" })) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1.1", "-1.2" })) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -382,12 +392,12 @@ default ResponseEntity testEnumParameters( value = "/fake" ) default ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, schema = @Schema(description = "")) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", schema = @Schema(description = "")) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group ) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -413,7 +423,7 @@ default ResponseEntity testGroupParameters( consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true, schema = @Schema(description = "")) @Valid @RequestBody Map param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ) { return getDelegate().testInlineAdditionalProperties(param); } @@ -440,8 +450,8 @@ default ResponseEntity testInlineAdditionalProperties( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param2", required = true) String param2 + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 ) { return getDelegate().testJsonFormData(param, param2); } @@ -470,11 +480,11 @@ default ResponseEntity testJsonFormData( value = "/fake/test-query-parameters" ) default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "context", required = true) List context + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context ) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } @@ -493,7 +503,9 @@ default ResponseEntity testQueryParameterCollectionFormat( summary = "uploads an image (required)", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -506,9 +518,9 @@ default ResponseEntity testQueryParameterCollectionFormat( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true, schema = @Schema(description = "")) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 69de7240b132..e1c09bd0521e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -46,7 +46,9 @@ default FakeClassnameTestApiDelegate getDelegate() { summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) }, security = { @SecurityRequirement(name = "api_key_query") @@ -59,7 +61,7 @@ default FakeClassnameTestApiDelegate getDelegate() { consumes = { "application/json" } ) default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClassname(body); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 3383fc0ceeba..63940f8803d6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -61,7 +61,7 @@ default PetApiDelegate getDelegate() { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return getDelegate().addPet(body); } @@ -92,8 +92,8 @@ default ResponseEntity addPet( value = "/pet/{petId}" ) default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ) { return getDelegate().deletePet(petId, apiKey); } @@ -112,7 +112,10 @@ default ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -125,7 +128,7 @@ default ResponseEntity deletePet( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ) { return getDelegate().findPetsByStatus(status); } @@ -145,7 +148,10 @@ default ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -158,7 +164,7 @@ default ResponseEntity> findPetsByStatus( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) Set tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { return getDelegate().findPetsByTags(tags); } @@ -178,7 +184,10 @@ default ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -192,7 +201,7 @@ default ResponseEntity> findPetsByTags( produces = { "application/xml", "application/json" } ) default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { return getDelegate().getPetById(petId); } @@ -227,7 +236,7 @@ default ResponseEntity getPetById( consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return getDelegate().updatePet(body); } @@ -258,9 +267,9 @@ default ResponseEntity updatePet( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status ) { return getDelegate().updatePetWithForm(petId, name, status); } @@ -279,7 +288,9 @@ default ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -292,9 +303,9 @@ default ResponseEntity updatePetWithForm( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 631191ae7f8f..af6187df0548 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -57,7 +57,7 @@ default StoreApiDelegate getDelegate() { value = "/store/order/{order_id}" ) default ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("order_id") String orderId + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { return getDelegate().deleteOrder(orderId); } @@ -74,7 +74,9 @@ default ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -106,7 +108,10 @@ default ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -117,7 +122,7 @@ default ResponseEntity> getInventory( produces = { "application/xml", "application/json" } ) default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("order_id") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { return getDelegate().getOrderById(orderId); } @@ -135,7 +140,10 @@ default ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -145,7 +153,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { return getDelegate().placeOrder(body); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 4dcc19500f27..4a70932e32a2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -56,7 +56,7 @@ default UserApiDelegate getDelegate() { value = "/user" ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ) { return getDelegate().createUser(body); } @@ -81,7 +81,7 @@ default ResponseEntity createUser( value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return getDelegate().createUsersWithArrayInput(body); } @@ -106,7 +106,7 @@ default ResponseEntity createUsersWithArrayInput( value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return getDelegate().createUsersWithListInput(body); } @@ -134,7 +134,7 @@ default ResponseEntity createUsersWithListInput( value = "/user/{username}" ) default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { return getDelegate().deleteUser(username); } @@ -153,7 +153,10 @@ default ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -164,7 +167,7 @@ default ResponseEntity deleteUser( produces = { "application/xml", "application/json" } ) default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); } @@ -183,7 +186,10 @@ default ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -193,8 +199,8 @@ default ResponseEntity getUserByName( produces = { "application/xml", "application/json" } ) default ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ) { return getDelegate().loginUser(username, password); } @@ -247,8 +253,8 @@ default ResponseEntity logoutUser( value = "/user/{username}" ) default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body ) { return getDelegate().updateUser(username, body); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java index 3640a6301af0..843e46a1f6cd 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; @@ -19,6 +20,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java index 19ffd6fffead..88bc8c3d6492 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java index cc0bafc92e34..1a4f50f5bcd4 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 19ea0acc7a7c..fb2ee5373fbf 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index 6790fc82a0ba..05abfd1c26ef 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -24,6 +25,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index ec728db1f145..768e7277a703 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 48528166d1c1..95f81f418d28 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "200_response", description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index 4312ff4cc727..474ed54662f7 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java index 11078e7094e4..7615d501057e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index 37c94a6aa80e..eef02c8ade31 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "Return", description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index 3dcdd9ee3f54..1eac86e9ebca 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 51f7935f655c..252c6c11f3c4 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -50,7 +50,9 @@ default Optional getRequest() { summary = "To test special tags", tags = { "$another-fake?" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @Parameters({ @@ -62,7 +64,7 @@ default Optional getRequest() { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 90090a0ac82d..9cf6af86d69e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -71,7 +71,7 @@ default Optional getRequest() { consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) default ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true, schema = @Schema(description = "")) @Valid @RequestBody XmlItem xmlItem + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -89,7 +89,9 @@ default ResponseEntity createXmlItem( operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) } ) @Parameters({ @@ -100,7 +102,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" } ) default ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Boolean body + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -118,7 +120,9 @@ default ResponseEntity fakeOuterBooleanSerialize( operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) } ) @Parameters({ @@ -129,7 +133,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" } ) default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -156,7 +160,9 @@ default ResponseEntity fakeOuterCompositeSerialize( operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) } ) @Parameters({ @@ -167,7 +173,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" } ) default ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) BigDecimal body + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -185,7 +191,9 @@ default ResponseEntity fakeOuterNumberSerialize( operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) } ) @Parameters({ @@ -196,7 +204,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" } ) default ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) String body + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -225,7 +233,7 @@ default ResponseEntity fakeOuterStringSerialize( consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -254,8 +262,8 @@ default ResponseEntity testBodyWithFileSchema( consumes = { "application/json" } ) default ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -274,7 +282,9 @@ default ResponseEntity testBodyWithQueryParams( summary = "To test \"client\" model", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @Parameters({ @@ -286,7 +296,7 @@ default ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -343,20 +353,20 @@ default ResponseEntity testClientModel( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -386,8 +396,8 @@ default ResponseEntity testEndpointParameters( } ) @Parameters({ - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })), - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)"), + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") }) @RequestMapping( method = RequestMethod.GET, @@ -395,12 +405,12 @@ default ResponseEntity testEndpointParameters( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testEnumParameters( - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1", "-2" })) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1.1", "-1.2" })) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -426,18 +436,18 @@ default ResponseEntity testEnumParameters( } ) @Parameters({ - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, schema = @Schema(description = "")), - @Parameter(name = "boolean_group", description = "Boolean in group parameters", schema = @Schema(description = "")) + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true), + @Parameter(name = "boolean_group", description = "Boolean in group parameters") }) @RequestMapping( method = RequestMethod.DELETE, value = "/fake" ) default ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -466,7 +476,7 @@ default ResponseEntity testGroupParameters( consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true, schema = @Schema(description = "")) @Valid @RequestBody Map param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -496,8 +506,8 @@ default ResponseEntity testInlineAdditionalProperties( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param2", required = true) String param2 + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -529,11 +539,11 @@ default ResponseEntity testJsonFormData( value = "/fake/test-query-parameters" ) default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "context", required = true) List context + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -553,7 +563,9 @@ default ResponseEntity testQueryParameterCollectionFormat( summary = "uploads an image (required)", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -568,9 +580,9 @@ default ResponseEntity testQueryParameterCollectionFormat( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true, schema = @Schema(description = "")) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2fbe8511b867..c731b97ec125 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -50,7 +50,9 @@ default Optional getRequest() { summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) }, security = { @SecurityRequirement(name = "api_key_query") @@ -65,7 +67,7 @@ default Optional getRequest() { consumes = { "application/json" } ) default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index fb9189b16fd7..d57bc4405ac8 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -94,14 +94,14 @@ default ResponseEntity addPet( } ) @Parameters({ - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) + @Parameter(name = "api_key", description = "") }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -121,7 +121,10 @@ default ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -136,7 +139,7 @@ default ResponseEntity deletePet( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -171,7 +174,10 @@ default ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -186,7 +192,7 @@ default ResponseEntity> findPetsByStatus( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) Set tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -221,7 +227,10 @@ default ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -237,7 +246,7 @@ default ResponseEntity> findPetsByTags( produces = { "application/xml", "application/json" } ) default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -289,7 +298,7 @@ default ResponseEntity getPetById( consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -323,9 +332,9 @@ default ResponseEntity updatePet( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -345,7 +354,9 @@ default ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -360,9 +371,9 @@ default ResponseEntity updatePetWithForm( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 1cdc49b49c6f..3c42250c555e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -63,7 +63,7 @@ default Optional getRequest() { value = "/store/order/{order_id}" ) default ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("order_id") String orderId + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -81,7 +81,9 @@ default ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -116,7 +118,10 @@ default ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -129,7 +134,7 @@ default ResponseEntity> getInventory( produces = { "application/xml", "application/json" } ) default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("order_id") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -162,7 +167,10 @@ default ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -174,7 +182,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index d1fd8b88d7c9..b375b927cc85 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -62,7 +62,7 @@ default Optional getRequest() { value = "/user" ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,7 +90,7 @@ default ResponseEntity createUser( value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -118,7 +118,7 @@ default ResponseEntity createUsersWithArrayInput( value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -149,7 +149,7 @@ default ResponseEntity createUsersWithListInput( value = "/user/{username}" ) default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -169,7 +169,10 @@ default ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -182,7 +185,7 @@ default ResponseEntity deleteUser( produces = { "application/xml", "application/json" } ) default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -216,7 +219,10 @@ default ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -228,8 +234,8 @@ default ResponseEntity getUserByName( produces = { "application/xml", "application/json" } ) default ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -288,8 +294,8 @@ default ResponseEntity logoutUser( value = "/user/{username}" ) default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java index 3640a6301af0..843e46a1f6cd 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; @@ -19,6 +20,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java index 19ffd6fffead..88bc8c3d6492 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java index cc0bafc92e34..1a4f50f5bcd4 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 19ea0acc7a7c..fb2ee5373fbf 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index 6790fc82a0ba..05abfd1c26ef 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -24,6 +25,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index ec728db1f145..768e7277a703 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index 48528166d1c1..95f81f418d28 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "200_response", description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index 4312ff4cc727..474ed54662f7 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java index 11078e7094e4..7615d501057e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index 37c94a6aa80e..eef02c8ade31 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "Return", description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index 3dcdd9ee3f54..1eac86e9ebca 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 833d46effbd8..60239a08dcb5 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -50,7 +50,9 @@ default AnotherFakeApiDelegate getDelegate() { summary = "To test special tags", tags = { "$another-fake?" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -60,7 +62,7 @@ default AnotherFakeApiDelegate getDelegate() { consumes = { "application/json" } ) default Mono> call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().call123testSpecialTags(body, exchange); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 3862551833ce..f56335a4cc60 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -69,7 +69,7 @@ default FakeApiDelegate getDelegate() { consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) default Mono> createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono xmlItem, + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().createXmlItem(xmlItem, exchange); @@ -87,7 +87,9 @@ default Mono> createXmlItem( operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) } ) @RequestMapping( @@ -96,7 +98,7 @@ default Mono> createXmlItem( produces = { "*/*" } ) default Mono> fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Mono body, + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().fakeOuterBooleanSerialize(body, exchange); @@ -114,7 +116,9 @@ default Mono> fakeOuterBooleanSerialize( operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) } ) @RequestMapping( @@ -123,7 +127,7 @@ default Mono> fakeOuterBooleanSerialize( produces = { "*/*" } ) default Mono> fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Mono body, + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().fakeOuterCompositeSerialize(body, exchange); @@ -141,7 +145,9 @@ default Mono> fakeOuterCompositeSerialize( operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) } ) @RequestMapping( @@ -150,7 +156,7 @@ default Mono> fakeOuterCompositeSerialize( produces = { "*/*" } ) default Mono> fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Mono body, + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().fakeOuterNumberSerialize(body, exchange); @@ -168,7 +174,9 @@ default Mono> fakeOuterNumberSerialize( operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) } ) @RequestMapping( @@ -177,7 +185,7 @@ default Mono> fakeOuterNumberSerialize( produces = { "*/*" } ) default Mono> fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Mono body, + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().fakeOuterStringSerialize(body, exchange); @@ -204,7 +212,7 @@ default Mono> fakeOuterStringSerialize( consumes = { "application/json" } ) default Mono> testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testBodyWithFileSchema(body, exchange); @@ -231,8 +239,8 @@ default Mono> testBodyWithFileSchema( consumes = { "application/json" } ) default Mono> testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testBodyWithQueryParams(query, body, exchange); @@ -251,7 +259,9 @@ default Mono> testBodyWithQueryParams( summary = "To test \"client\" model", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -261,7 +271,7 @@ default Mono> testBodyWithQueryParams( consumes = { "application/json" } ) default Mono> testClientModel( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testClientModel(body, exchange); @@ -307,20 +317,20 @@ default Mono> testClientModel( consumes = { "application/x-www-form-urlencoded" } ) default Mono> testEndpointParameters( - @Parameter(name = "number", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) Flux binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback, + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) Flux binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); @@ -357,14 +367,14 @@ default Mono> testEndpointParameters( consumes = { "application/x-www-form-urlencoded" } ) default Mono> testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1", "-2" })) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1.1", "-1.2" })) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString, + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); @@ -396,12 +406,12 @@ default Mono> testEnumParameters( value = "/fake" ) default Mono> testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, schema = @Schema(description = "")) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", schema = @Schema(description = "")) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); @@ -428,7 +438,7 @@ default Mono> testGroupParameters( consumes = { "application/json" } ) default Mono> testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono> param, + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Mono> param, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testInlineAdditionalProperties(param, exchange); @@ -456,8 +466,8 @@ default Mono> testInlineAdditionalProperties( consumes = { "application/x-www-form-urlencoded" } ) default Mono> testJsonFormData( - @Parameter(name = "param", description = "field1", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param2", required = true) String param2, + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testJsonFormData(param, param2, exchange); @@ -487,11 +497,11 @@ default Mono> testJsonFormData( value = "/fake/test-query-parameters" ) default Mono> testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "context", required = true) List context, + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); @@ -511,7 +521,9 @@ default Mono> testQueryParameterCollectionFormat( summary = "uploads an image (required)", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -524,9 +536,9 @@ default Mono> testQueryParameterCollectionFormat( consumes = { "multipart/form-data" } ) default Mono> uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true, schema = @Schema(description = "")) @RequestPart(value = "requiredFile", required = true) Flux requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Flux requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e0ec6e8b1184..58cff10158be 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -50,7 +50,9 @@ default FakeClassnameTestApiDelegate getDelegate() { summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) }, security = { @SecurityRequirement(name = "api_key_query") @@ -63,7 +65,7 @@ default FakeClassnameTestApiDelegate getDelegate() { consumes = { "application/json" } ) default Mono> testClassname( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testClassname(body, exchange); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 56aa42d803ac..961209bca59b 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -65,7 +65,7 @@ default PetApiDelegate getDelegate() { consumes = { "application/json", "application/xml" } ) default Mono> addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().addPet(body, exchange); @@ -97,8 +97,8 @@ default Mono> addPet( value = "/pet/{petId}" ) default Mono> deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey, + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().deletePet(petId, apiKey, exchange); @@ -118,7 +118,10 @@ default Mono> deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -131,7 +134,7 @@ default Mono> deletePet( produces = { "application/xml", "application/json" } ) default Mono>> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status, + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().findPetsByStatus(status, exchange); @@ -152,7 +155,10 @@ default Mono>> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -165,7 +171,7 @@ default Mono>> findPetsByStatus( produces = { "application/xml", "application/json" } ) default Mono>> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) Set tags, + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().findPetsByTags(tags, exchange); @@ -186,7 +192,10 @@ default Mono>> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -200,7 +209,7 @@ default Mono>> findPetsByTags( produces = { "application/xml", "application/json" } ) default Mono> getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().getPetById(petId, exchange); @@ -236,7 +245,7 @@ default Mono> getPetById( consumes = { "application/json", "application/xml" } ) default Mono> updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().updatePet(body, exchange); @@ -268,9 +277,9 @@ default Mono> updatePet( consumes = { "application/x-www-form-urlencoded" } ) default Mono> updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status, + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().updatePetWithForm(petId, name, status, exchange); @@ -290,7 +299,9 @@ default Mono> updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -303,9 +314,9 @@ default Mono> updatePetWithForm( consumes = { "multipart/form-data" } ) default Mono> uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) Flux file, + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) Flux file, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 9d77308dc0d0..49d7f624b6bc 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -61,7 +61,7 @@ default StoreApiDelegate getDelegate() { value = "/store/order/{order_id}" ) default Mono> deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("order_id") String orderId, + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().deleteOrder(orderId, exchange); @@ -79,7 +79,9 @@ default Mono> deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -111,7 +113,10 @@ default Mono>> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -122,7 +127,7 @@ default Mono>> getInventory( produces = { "application/xml", "application/json" } ) default Mono> getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("order_id") Long orderId, + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().getOrderById(orderId, exchange); @@ -141,7 +146,10 @@ default Mono> getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -151,7 +159,7 @@ default Mono> getOrderById( produces = { "application/xml", "application/json" } ) default Mono> placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().placeOrder(body, exchange); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 060c2e17e780..863193a82ddb 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -60,7 +60,7 @@ default UserApiDelegate getDelegate() { value = "/user" ) default Mono> createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().createUser(body, exchange); @@ -86,7 +86,7 @@ default Mono> createUser( value = "/user/createWithArray" ) default Mono> createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody Flux body, + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody Flux body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().createUsersWithArrayInput(body, exchange); @@ -112,7 +112,7 @@ default Mono> createUsersWithArrayInput( value = "/user/createWithList" ) default Mono> createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody Flux body, + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody Flux body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().createUsersWithListInput(body, exchange); @@ -141,7 +141,7 @@ default Mono> createUsersWithListInput( value = "/user/{username}" ) default Mono> deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().deleteUser(username, exchange); @@ -161,7 +161,10 @@ default Mono> deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -172,7 +175,7 @@ default Mono> deleteUser( produces = { "application/xml", "application/json" } ) default Mono> getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().getUserByName(username, exchange); @@ -192,7 +195,10 @@ default Mono> getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -202,8 +208,8 @@ default Mono> getUserByName( produces = { "application/xml", "application/json" } ) default Mono> loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password, + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().loginUser(username, password, exchange); @@ -257,8 +263,8 @@ default Mono> logoutUser( value = "/user/{username}" ) default Mono> updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono body, + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().updateUser(username, body, exchange); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java index 3640a6301af0..843e46a1f6cd 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; @@ -19,6 +20,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java index 19ffd6fffead..88bc8c3d6492 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java index cc0bafc92e34..1a4f50f5bcd4 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 19ea0acc7a7c..fb2ee5373fbf 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index 6790fc82a0ba..05abfd1c26ef 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -24,6 +25,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index ec728db1f145..768e7277a703 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java index 48528166d1c1..95f81f418d28 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "200_response", description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index 4312ff4cc727..474ed54662f7 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java index 11078e7094e4..7615d501057e 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java index 37c94a6aa80e..eef02c8ade31 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "Return", description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index 3dcdd9ee3f54..1eac86e9ebca 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index 919f448abac0..653d00e34e9a 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -50,7 +50,9 @@ default Optional getRequest() { summary = "To test special tags", tags = { "$another-fake?" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -60,7 +62,7 @@ default Optional getRequest() { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index cca81138adbb..913d949c27c6 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -69,7 +69,7 @@ default Optional getRequest() { consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) default ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true, schema = @Schema(description = "")) @Valid @RequestBody XmlItem xmlItem + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -87,7 +87,9 @@ default ResponseEntity createXmlItem( operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) } ) @RequestMapping( @@ -96,7 +98,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" } ) default ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Boolean body + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -114,7 +116,9 @@ default ResponseEntity fakeOuterBooleanSerialize( operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) } ) @RequestMapping( @@ -123,7 +127,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" } ) default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -150,7 +154,9 @@ default ResponseEntity fakeOuterCompositeSerialize( operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) } ) @RequestMapping( @@ -159,7 +165,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" } ) default ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) BigDecimal body + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -177,7 +183,9 @@ default ResponseEntity fakeOuterNumberSerialize( operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) } ) @RequestMapping( @@ -186,7 +194,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" } ) default ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) String body + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -213,7 +221,7 @@ default ResponseEntity fakeOuterStringSerialize( consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -240,8 +248,8 @@ default ResponseEntity testBodyWithFileSchema( consumes = { "application/json" } ) default ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -260,7 +268,9 @@ default ResponseEntity testBodyWithQueryParams( summary = "To test \"client\" model", tags = { "fake" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) } ) @RequestMapping( @@ -270,7 +280,7 @@ default ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -325,20 +335,20 @@ default ResponseEntity testClientModel( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -375,14 +385,14 @@ default ResponseEntity testEndpointParameters( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @RequestHeader(value = "enum_header_string", required = false) Optional enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1", "-2" })) @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1.1", "-1.2" })) @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) Optional enumHeaderString, + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -414,12 +424,12 @@ default ResponseEntity testEnumParameters( value = "/fake" ) default ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, schema = @Schema(description = "")) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", schema = @Schema(description = "")) @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -446,7 +456,7 @@ default ResponseEntity testGroupParameters( consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true, schema = @Schema(description = "")) @Valid @RequestBody Map param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -474,8 +484,8 @@ default ResponseEntity testInlineAdditionalProperties( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true, schema = @Schema(description = "")) @Valid @RequestPart(value = "param2", required = true) String param2 + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -505,11 +515,11 @@ default ResponseEntity testJsonFormData( value = "/fake/test-query-parameters" ) default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "context", required = true) List context + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -529,7 +539,9 @@ default ResponseEntity testQueryParameterCollectionFormat( summary = "uploads an image (required)", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -542,9 +554,9 @@ default ResponseEntity testQueryParameterCollectionFormat( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true, schema = @Schema(description = "")) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2e1880a7241c..993f4a4b4efa 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -50,7 +50,9 @@ default Optional getRequest() { summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) }, security = { @SecurityRequirement(name = "api_key_query") @@ -63,7 +65,7 @@ default Optional getRequest() { consumes = { "application/json" } ) default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index f0a2deb9d22a..595d3cdef789 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -65,7 +65,7 @@ default Optional getRequest() { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -97,8 +97,8 @@ default ResponseEntity addPet( value = "/pet/{petId}" ) default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) Optional apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) Optional apiKey ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -118,7 +118,10 @@ default ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -131,7 +134,7 @@ default ResponseEntity deletePet( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -166,7 +169,10 @@ default ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -179,7 +185,7 @@ default ResponseEntity> findPetsByStatus( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) Set tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -214,7 +220,10 @@ default ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -228,7 +237,7 @@ default ResponseEntity> findPetsByTags( produces = { "application/xml", "application/json" } ) default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -278,7 +287,7 @@ default ResponseEntity getPetById( consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -310,9 +319,9 @@ default ResponseEntity updatePet( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -332,7 +341,9 @@ default ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -345,9 +356,9 @@ default ResponseEntity updatePetWithForm( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index e5918a3b05dc..963a60ac29a3 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -61,7 +61,7 @@ default Optional getRequest() { value = "/store/order/{order_id}" ) default ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("order_id") String orderId + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -79,7 +79,9 @@ default ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -112,7 +114,10 @@ default ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -123,7 +128,7 @@ default ResponseEntity> getInventory( produces = { "application/xml", "application/json" } ) default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("order_id") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -156,7 +161,10 @@ default ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -166,7 +174,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index cfa50be96676..f4555ba9a1d6 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -60,7 +60,7 @@ default Optional getRequest() { value = "/user" ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -86,7 +86,7 @@ default ResponseEntity createUser( value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -112,7 +112,7 @@ default ResponseEntity createUsersWithArrayInput( value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -141,7 +141,7 @@ default ResponseEntity createUsersWithListInput( value = "/user/{username}" ) default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -161,7 +161,10 @@ default ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -172,7 +175,7 @@ default ResponseEntity deleteUser( produces = { "application/xml", "application/json" } ) default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -206,7 +209,10 @@ default ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -216,8 +222,8 @@ default ResponseEntity getUserByName( produces = { "application/xml", "application/json" } ) default ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -272,8 +278,8 @@ default ResponseEntity logoutUser( value = "/user/{username}" ) default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java index 3640a6301af0..843e46a1f6cd 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; @@ -19,6 +20,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java index 19ffd6fffead..88bc8c3d6492 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java index cc0bafc92e34..1a4f50f5bcd4 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 19ea0acc7a7c..fb2ee5373fbf 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index 6790fc82a0ba..05abfd1c26ef 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -24,6 +25,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index ec728db1f145..768e7277a703 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 48528166d1c1..95f81f418d28 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "200_response", description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index 4312ff4cc727..474ed54662f7 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index 11078e7094e4..7615d501057e 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index 37c94a6aa80e..eef02c8ade31 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "Return", description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index 3dcdd9ee3f54..1eac86e9ebca 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,6 +19,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 061450ef1124..16a553b637bf 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -51,7 +51,10 @@ default Optional getRequest() { summary = "Add a new pet to the store", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "405", description = "Invalid input") }, security = { @@ -65,7 +68,7 @@ default Optional getRequest() { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet pet + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -109,8 +112,8 @@ default ResponseEntity addPet( value = "/pet/{petId}" ) default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -130,7 +133,10 @@ default ResponseEntity deletePet( summary = "Finds Pets by status", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { @@ -143,7 +149,7 @@ default ResponseEntity deletePet( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -178,7 +184,10 @@ default ResponseEntity> findPetsByStatus( summary = "Finds Pets by tags", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { @@ -191,7 +200,7 @@ default ResponseEntity> findPetsByStatus( produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -226,7 +235,10 @@ default ResponseEntity> findPetsByTags( summary = "Find pet by ID", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found") }, @@ -240,7 +252,7 @@ default ResponseEntity> findPetsByTags( produces = { "application/xml", "application/json" } ) default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -275,7 +287,10 @@ default ResponseEntity getPetById( summary = "Update an existing pet", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found"), @ApiResponse(responseCode = "405", description = "Validation exception") @@ -291,7 +306,7 @@ default ResponseEntity getPetById( consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet pet + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -337,9 +352,9 @@ default ResponseEntity updatePet( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -359,7 +374,9 @@ default ResponseEntity updatePetWithForm( summary = "uploads an image", tags = { "pet" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) @@ -372,9 +389,9 @@ default ResponseEntity updatePetWithForm( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index fbc6b4fa89c2..794da5c8373d 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -61,7 +61,7 @@ default Optional getRequest() { value = "/store/order/{orderId}" ) default ResponseEntity deleteOrder( - @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("orderId") String orderId + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -79,7 +79,9 @@ default ResponseEntity deleteOrder( summary = "Returns pet inventories by status", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) }, security = { @SecurityRequirement(name = "api_key") @@ -112,7 +114,10 @@ default ResponseEntity> getInventory( summary = "Find purchase order by ID", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Order not found") } @@ -123,7 +128,7 @@ default ResponseEntity> getInventory( produces = { "application/xml", "application/json" } ) default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("orderId") Long orderId + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -156,7 +161,10 @@ default ResponseEntity getOrderById( summary = "Place an order for a pet", tags = { "store" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid Order") } ) @@ -167,7 +175,7 @@ default ResponseEntity getOrderById( consumes = { "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order order + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 17444f774be8..29ac437379b9 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -64,7 +64,7 @@ default Optional getRequest() { consumes = { "application/json" } ) default ResponseEntity createUser( - @Parameter(name = "User", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User user + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -94,7 +94,7 @@ default ResponseEntity createUser( consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "User", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List user + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -124,7 +124,7 @@ default ResponseEntity createUsersWithArrayInput( consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "User", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List user + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -156,7 +156,7 @@ default ResponseEntity createUsersWithListInput( value = "/user/{username}" ) default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -176,7 +176,10 @@ default ResponseEntity deleteUser( summary = "Get user by user name", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") } @@ -187,7 +190,7 @@ default ResponseEntity deleteUser( produces = { "application/xml", "application/json" } ) default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -221,7 +224,10 @@ default ResponseEntity getUserByName( summary = "Logs user into the system", tags = { "user" }, responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") } ) @@ -231,8 +237,8 @@ default ResponseEntity getUserByName( produces = { "application/xml", "application/json" } ) default ResponseEntity loginUser( - @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -294,8 +300,8 @@ default ResponseEntity logoutUser( consumes = { "application/json" } ) default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, - @Parameter(name = "User", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User user + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index ea4f1e402648..a235a99f9035 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,6 +20,7 @@ */ @Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java index 9be107507838..cc75dd59249b 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -23,6 +24,7 @@ */ @Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") @JacksonXmlRootElement(localName = "ModelApiResponse") @XmlRootElement(name = "ModelApiResponse") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java index 6e4b2b0834f4..aa2fb19253b8 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.*; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java index 75970bc87532..77bb91d3121a 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/CatAllOf.java index e92ac97ef401..79bab35f1d70 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/CatAllOf.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/DogAllOf.java index f319e8af2de5..f3a99940bdcc 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/DogAllOf.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java index 0e7cd4cde5b3..0b2952a15763 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FormatTest.java index 6ad510b26dad..8937ac052845 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FormatTest.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 402186d101f6..ed7fa2fe9705 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Model200Response.java index 6b6f8b53e5ce..543ecd964eb1 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Model200Response.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelApiResponse.java index 0b916a979ae9..45e8ac75136e 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java index ce611a313c61..a339148dec49 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java index 101752a80d3b..eed287f59d23 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelReturn.java index 455d60fb72f1..66cb7b6589fc 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelReturn.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/SpecialModelName.java index cc4647f0a279..2ce194030015 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints-with-security/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-fake-endpoints-with-security/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints-with-security/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints-with-security/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java index c0e2cdeab1a7..87f0924badd6 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java index d9b481c439b9..34865f24182a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java index ea23e72c16e0..111696fa0a6d 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java index fd50cfba92f7..6081f7810492 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java @@ -1,6 +1,7 @@ package apimodels; import apimodels.OuterEnum; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java index c202d9340e7b..13e3f7e8ba04 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import java.io.InputStream; import java.math.BigDecimal; import java.time.LocalDate; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java index fa8b55adabee..697e96681c7d 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java index f0ca332d186f..ebffc7e5dc27 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java index 75f9e7c5d464..0820d45f5def 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java index 16c242ddf5a4..9f509226df49 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java index 6b6d4a3913ed..e31afffb3ac2 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java index 298399adb2a3..e367c3941e94 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java index dfbc01afecd8..da472606817b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java index 8a08c1c5af3b..2880d327382b 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java index 820779a1cd95..301968462bb4 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java @@ -1,5 +1,6 @@ package apimodels; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/ModelApiResponse.java index b0f63e547a15..940222d99fe0 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/ModelApiResponse.java index 4e8ea10a168b..63a57fee26d0 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/ModelApiResponse.java index b0f63e547a15..940222d99fe0 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java index e9fb53527a7e..fc86ddad6973 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -1,6 +1,7 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/CatAllOf.java index a6b97523e2d9..a9b9e3ee2290 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/CatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/DogAllOf.java index f626b990623e..a267694d017b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/DogAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java index 5b7934af548f..25b8936d196f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java @@ -1,6 +1,7 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.model.OuterEnum; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/FormatTest.java index 905070757281..99f6e76de0eb 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import java.io.File; import java.math.BigDecimal; import java.util.Date; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 68093885046c..6cc81ceeaaed 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Model200Response.java index 5e4f06e6f9ed..d0a9b793514c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Model200Response.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelApiResponse.java index 04d8e8e7fe47..09472755fffc 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelFile.java index 36f52f07e29e..74576478b23c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelFile.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelList.java index 6ea1e0d5a325..8ec273dbd0b3 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelList.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelReturn.java index 768acf861b59..bfc732d5e264 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ModelReturn.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/SpecialModelName.java index 2346a09a20b4..b968d9a1bfd2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java index e2c9cc69de8b..447514399d15 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java index 0fafea591aeb..d111978cc2b6 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java index 032ee0e253f4..57014f0d6e3f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java index 5f19eca41622..8fd742b187e5 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java index e6b1aea1570f..4b6922939e91 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 49e5c178cc2f..cbfa230c8a01 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java index 3d502128b84d..2560c4929c20 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java index d2b4bcc66cd9..3ce446cefe27 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelFile.java index eb0978f9a01d..7f7730a2bc54 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelFile.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelList.java index 3829ef4d013a..3a7dc9b941d9 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelList.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java index 628e4e58975b..b474bfebc98f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java index 172cd981a676..6d7f4f0b78e7 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java index 83503a712d2b..f66090ad012c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java index 6902a980c243..d6c3cffecb6e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java index c0bc2c355fad..681946aebb10 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java index 1459aa93dd2f..007c151d2599 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1b5042f61f59..bac432e8584b 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java index 789a62c847af..8b0b655f031f 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Foo; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java index 1a3e698983e5..f02117c54aae 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1552245d1dc8..5c7099e23035 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelFile.java index dfb1fbe25c8e..56241ca33e54 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelFile.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelList.java index b6f07ac1c504..9eaf3a486dd3 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelList.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java index c9f4504d3f0e..57eeece83431 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java index 912dd213133f..f58fec5336dc 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/ModelApiResponse.java index d3a12b7874dd..de3e6418a2a6 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/model/ModelApiResponse.java index dbade7dfd985..26f2b55e259c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/ModelApiResponse.java index dbade7dfd985..26f2b55e259c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/ModelApiResponse.java index dbade7dfd985..26f2b55e259c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/ModelApiResponse.java index d3a12b7874dd..de3e6418a2a6 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/ModelApiResponse.java index d3a12b7874dd..de3e6418a2a6 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java index db6873590460..7ba1d7c23fcb 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/CatAllOf.java index b5d2587fe85e..2ed18a6de6c3 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/CatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/DogAllOf.java index 269faf93678e..6c7208fe19b8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/DogAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java index 34ec3b13e072..af7ac236efe4 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FormatTest.java index bbb010c5ff19..c6b8753a4e66 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index db68308cdce3..49ca21e5a565 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Model200Response.java index 7aeb481a43a3..af86cf00edbb 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Model200Response.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelApiResponse.java index d541b6586f3c..3bcaaffb3d32 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelFile.java index 8ce42cac839e..95dfa998db35 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelFile.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelList.java index f09d013e2dca..ec97de0198c3 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelList.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelReturn.java index 836ae092d183..b9055976ff5a 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ModelReturn.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/SpecialModelName.java index 0340c7996ab1..0fc3694ffad8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java index db6873590460..7ba1d7c23fcb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/CatAllOf.java index b5d2587fe85e..2ed18a6de6c3 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/CatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DogAllOf.java index 269faf93678e..6c7208fe19b8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DogAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java index 34ec3b13e072..af7ac236efe4 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java index bbb010c5ff19..c6b8753a4e66 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index db68308cdce3..49ca21e5a565 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Model200Response.java index 7aeb481a43a3..af86cf00edbb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Model200Response.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelApiResponse.java index d541b6586f3c..3bcaaffb3d32 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelFile.java index 8ce42cac839e..95dfa998db35 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelFile.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelList.java index f09d013e2dca..ec97de0198c3 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelList.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelReturn.java index 836ae092d183..b9055976ff5a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelReturn.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java index 0340c7996ab1..0fc3694ffad8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java index ae1220fcefd1..feb9c4521ca6 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java index 83503a712d2b..f66090ad012c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java index 6902a980c243..d6c3cffecb6e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 937a9f7f6aeb..4beac603f1eb 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java index d640a11342c7..ce0919049780 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1b5042f61f59..bac432e8584b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java index 1a3e698983e5..f02117c54aae 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1552245d1dc8..5c7099e23035 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelFile.java index dfb1fbe25c8e..56241ca33e54 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelFile.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelList.java index b6f07ac1c504..9eaf3a486dd3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelList.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java index c9f4504d3f0e..57eeece83431 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java index 1fbc58e301e6..f89183eb3270 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java index ae1220fcefd1..feb9c4521ca6 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java index 83503a712d2b..f66090ad012c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java index 6902a980c243..d6c3cffecb6e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java index 937a9f7f6aeb..4beac603f1eb 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java index d640a11342c7..ce0919049780 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1b5042f61f59..bac432e8584b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java index 1a3e698983e5..f02117c54aae 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1552245d1dc8..5c7099e23035 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelFile.java index dfb1fbe25c8e..56241ca33e54 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelFile.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelList.java index b6f07ac1c504..9eaf3a486dd3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelList.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java index c9f4504d3f0e..57eeece83431 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java index 1fbc58e301e6..f89183eb3270 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java index ae1220fcefd1..feb9c4521ca6 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java index 83503a712d2b..f66090ad012c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java index 6902a980c243..d6c3cffecb6e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 937a9f7f6aeb..4beac603f1eb 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java index d640a11342c7..ce0919049780 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1b5042f61f59..bac432e8584b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java index 1a3e698983e5..f02117c54aae 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1552245d1dc8..5c7099e23035 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelFile.java index dfb1fbe25c8e..56241ca33e54 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelFile.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelList.java index b6f07ac1c504..9eaf3a486dd3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelList.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java index c9f4504d3f0e..57eeece83431 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java index 1fbc58e301e6..f89183eb3270 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java index ae1220fcefd1..feb9c4521ca6 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java index 83503a712d2b..f66090ad012c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java index 6902a980c243..d6c3cffecb6e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java index 937a9f7f6aeb..4beac603f1eb 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java index d640a11342c7..ce0919049780 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1b5042f61f59..bac432e8584b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java index 1a3e698983e5..f02117c54aae 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1552245d1dc8..5c7099e23035 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelFile.java index dfb1fbe25c8e..56241ca33e54 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelFile.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelList.java index b6f07ac1c504..9eaf3a486dd3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelList.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java index c9f4504d3f0e..57eeece83431 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java index 1fbc58e301e6..f89183eb3270 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java index 0a8bd5228731..23fd197e0faa 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java index 0a8bd5228731..23fd197e0faa 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java index 5091a8fa01f3..559b55340b91 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index 824974fe6142..dd13d7bdec4e 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -19,6 +20,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index 1ad2fc260c02..f08bec554e28 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; @@ -18,6 +19,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index 5ff013305270..e752d7d851f7 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; @@ -18,6 +19,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index f29a046fa29d..834d74556f35 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 45f1d105c802..01d454756ee7 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -24,6 +25,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 09dc39be6e83..3384df59d317 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; @@ -18,6 +19,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 1270afd57ba1..5167914f6fd7 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; @@ -19,6 +20,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 8ced5f5e4169..19aae2715ecd 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; @@ -18,6 +19,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 5dbced071c03..e179538482eb 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; @@ -18,6 +19,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 37f2d7b22f0c..8aa5465ad199 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; @@ -19,6 +20,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index 0dca87914aff..cbb43d463caf 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; @@ -18,6 +19,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java index d52a06bb429c..46157e727be0 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -22,6 +23,7 @@ @com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java index 08432295c3d2..6cf7296ae696 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,6 +22,7 @@ @com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java index ce03d3658685..140f7f8fb348 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,6 +22,7 @@ @com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java index 747b908c75fa..758e4bf1fc39 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -23,6 +24,7 @@ @com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java index d9b412be1a2a..07efbb703101 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -27,6 +28,7 @@ @com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 94d26e272480..b75cd19a6918 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,6 +22,7 @@ @com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java index df2b0df09245..c49848888342 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -22,6 +23,7 @@ @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java index 607b3d9db62f..5c89ae3304d4 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,6 +22,7 @@ @com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java index 2ba4741b6610..dccafedeef3e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,6 +22,7 @@ @com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java index 0eb9f005974f..bce5d854f17e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -22,6 +23,7 @@ @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java index 240ccd256470..96e62ae0abce 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,6 +22,7 @@ @com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index 1c40cb56ac25..ff725c49c3a0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -18,6 +19,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index f47941a937ae..b40fac356ce7 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; @@ -17,6 +18,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index 25131d8dc35a..d6ac1905f533 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; @@ -17,6 +18,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index 450377215592..4ba64037961f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -19,6 +20,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 5d6a57b69a1c..4b2053f60f51 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -23,6 +24,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index a6100dec7e69..373b33c1e243 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; @@ -17,6 +18,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index ff5f1cbfd767..87d2d098812e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; @@ -18,6 +19,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 61fd70ab5992..c5676fe8a91b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; @@ -17,6 +18,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 029b4bf191ea..a94a4c384087 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; @@ -17,6 +18,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 6e7190a8bb66..74b2177186ba 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; @@ -18,6 +19,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index d9c67e23a77a..9ee362ba26ca 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; @@ -17,6 +18,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java index 0a8bd5228731..23fd197e0faa 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java index 0a8bd5228731..23fd197e0faa 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java index 0a8bd5228731..23fd197e0faa 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java index 0a8bd5228731..23fd197e0faa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java index 0a8bd5228731..23fd197e0faa 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index 8e08090e24a3..025bcca8b97b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 6792f7900e9b..9c3e02b94529 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java index cf2427d7be17..44433a449d13 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index a8afa8fc0946..8d81e6c2ce36 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -24,6 +25,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 001a3cea2863..846cb351f3c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java index a308820b4be5..b3ce6a2a9c9b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index a932355454b9..7c53ec981595 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java index 55133349d684..7384ea7824cd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index 2c67234126d6..c3e5771a8d27 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 6f360adf416b..8bee0349830a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index 8e08090e24a3..025bcca8b97b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 6792f7900e9b..9c3e02b94529 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java index cf2427d7be17..44433a449d13 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index a8afa8fc0946..8d81e6c2ce36 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -24,6 +25,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 001a3cea2863..846cb351f3c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java index a308820b4be5..b3ce6a2a9c9b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index a932355454b9..7c53ec981595 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java index 55133349d684..7384ea7824cd 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index 2c67234126d6..c3e5771a8d27 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 6f360adf416b..8bee0349830a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,6 +19,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java index 0a8bd5228731..23fd197e0faa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java index ec9f1f735d14..7d2355fb949b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java index 07df0cf4f63b..025246cd689d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java index 03a99e51d04e..dfbf7374c3fe 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index 716aa26971ad..94ee20413420 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index 2baa6041b19d..3427304f7f0b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java index d80b97c6a2a4..3bb737c56a4f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java index 57d1ea9cf5a3..c4899656a3d7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java index 3245ee17d3fb..d52a1a1e618c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java index 74de2ea47b29..4eea940f3318 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java index d201058acd36..9ee87c9e5d1e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java index 8b156545d7fd..2405d307859d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java index 0a8bd5228731..23fd197e0faa 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -20,6 +21,7 @@ * BigCatAllOf */ +@JsonTypeName("BigCat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java index c4acf4858c3b..7f699ced5842 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * CatAllOf */ +@JsonTypeName("Cat_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java index d6ff0e0564fc..c081b7517a47 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * DogAllOf */ +@JsonTypeName("Dog_allOf") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java index 5e0e3b8a65e6..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -21,6 +22,7 @@ * EnumTest */ +@JsonTypeName("Enum_Test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java index c38fd7cc1104..153641cacd56 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; @@ -25,6 +26,7 @@ * FormatTest */ +@JsonTypeName("format_test") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 2b64dcf5f9d5..d235c68a51ff 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * HasOnlyReadOnly */ +@JsonTypeName("hasOnlyReadOnly") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java index 89575c6bad31..56b222f4e45b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index 98f2d63bf77f..131e671e9160 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelApiResponse */ +@JsonTypeName("ApiResponse") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java index 6b5e61562ada..7800a7d698f7 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * ModelList */ +@JsonTypeName("List") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java index 84b54d38a08e..a933badc4910 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,6 +21,7 @@ */ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java index effca9c97da4..cbc94826b926 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,6 +20,7 @@ * SpecialModelName */ +@JsonTypeName("$special[model.name]") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { From fcce44ab9bb254d0bdf05ae12f2fc267feada8d5 Mon Sep 17 00:00:00 2001 From: devhl-labs Date: Sat, 5 Feb 2022 04:53:26 -0500 Subject: [PATCH 013/111] [csharp-netcore] Add generichost samples (#11451) * added generichost samples * build samples * added guid * build samples --- appveyor.yml | 12 + ...nAPIClient-generichost-netcore5.0-nrt.yaml | 11 + ...-OpenAPIClient-generichost-netcore5.0.yaml | 11 + ...nAPIClient-generichost-netstandard2.0.yaml | 10 + .../.gitignore | 362 +++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 193 ++ .../.openapi-generator/VERSION | 1 + .../Org.OpenAPITools.sln | 27 + .../README.md | 259 ++ .../appveyor.yml | 9 + .../docs/apis/AnotherFakeApi.md | 80 + .../docs/apis/DefaultApi.md | 73 + .../docs/apis/FakeApi.md | 1126 +++++++ .../docs/apis/FakeClassnameTags123Api.md | 85 + .../docs/apis/PetApi.md | 689 +++++ .../docs/apis/StoreApi.md | 298 ++ .../docs/apis/UserApi.md | 573 ++++ .../docs/models/AdditionalPropertiesClass.md | 17 + .../docs/models/Animal.md | 11 + .../docs/models/ApiResponse.md | 12 + .../docs/models/Apple.md | 11 + .../docs/models/AppleReq.md | 11 + .../docs/models/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/models/ArrayOfNumberOnly.md | 10 + .../docs/models/ArrayTest.md | 12 + .../docs/models/Banana.md | 10 + .../docs/models/BananaReq.md | 11 + .../docs/models/BasquePig.md | 10 + .../docs/models/Capitalization.md | 15 + .../docs/models/Cat.md | 12 + .../docs/models/CatAllOf.md | 10 + .../docs/models/Category.md | 11 + .../docs/models/ChildCat.md | 11 + .../docs/models/ChildCatAllOf.md | 11 + .../docs/models/ClassModel.md | 11 + .../docs/models/ComplexQuadrilateral.md | 11 + .../docs/models/DanishPig.md | 10 + .../docs/models/DeprecatedObject.md | 10 + .../docs/models/Dog.md | 12 + .../docs/models/DogAllOf.md | 10 + .../docs/models/Drawing.md | 13 + .../docs/models/EnumArrays.md | 11 + .../docs/models/EnumClass.md | 9 + .../docs/models/EnumTest.md | 18 + .../docs/models/EquilateralTriangle.md | 11 + .../docs/models/File.md | 11 + .../docs/models/FileSchemaTestClass.md | 11 + .../docs/models/Foo.md | 10 + .../docs/models/FormatTest.md | 25 + .../docs/models/Fruit.md | 13 + .../docs/models/FruitReq.md | 13 + .../docs/models/GmFruit.md | 13 + .../docs/models/GrandparentAnimal.md | 10 + .../docs/models/HasOnlyReadOnly.md | 11 + .../docs/models/HealthCheckResult.md | 11 + .../docs/models/InlineResponseDefault.md | 10 + .../docs/models/IsoscelesTriangle.md | 11 + .../docs/models/List.md | 10 + .../docs/models/Mammal.md | 13 + .../docs/models/MapTest.md | 13 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/models/Model200Response.md | 12 + .../docs/models/ModelClient.md | 10 + .../docs/models/Name.md | 14 + .../docs/models/NullableClass.md | 21 + .../docs/models/NullableShape.md | 12 + .../docs/models/NumberOnly.md | 10 + .../docs/models/ObjectWithDeprecatedFields.md | 13 + .../docs/models/Order.md | 15 + .../docs/models/OuterComposite.md | 12 + .../docs/models/OuterEnum.md | 9 + .../docs/models/OuterEnumDefaultValue.md | 9 + .../docs/models/OuterEnumInteger.md | 9 + .../models/OuterEnumIntegerDefaultValue.md | 9 + .../docs/models/ParentPet.md | 10 + .../docs/models/Pet.md | 15 + .../docs/models/Pig.md | 10 + .../docs/models/Quadrilateral.md | 11 + .../docs/models/QuadrilateralInterface.md | 10 + .../docs/models/ReadOnlyFirst.md | 11 + .../docs/models/Return.md | 11 + .../docs/models/ScaleneTriangle.md | 11 + .../docs/models/Shape.md | 11 + .../docs/models/ShapeInterface.md | 10 + .../docs/models/ShapeOrNull.md | 12 + .../docs/models/SimpleQuadrilateral.md | 11 + .../docs/models/SpecialModelName.md | 11 + .../docs/models/Tag.md | 11 + .../docs/models/Triangle.md | 11 + .../docs/models/TriangleInterface.md | 10 + .../docs/models/User.md | 21 + .../docs/models/Whale.md | 12 + .../docs/models/Zebra.md | 11 + .../docs/scripts/git_push.ps1 | 75 + .../docs/scripts/git_push.sh | 49 + .../Api/AnotherFakeApiTests.cs | 65 + .../Org.OpenAPITools.Test/Api/ApiTestsBase.cs | 71 + .../Api/DefaultApiTests.cs | 64 + .../Api/DependencyInjectionTests.cs | 230 ++ .../Org.OpenAPITools.Test/Api/FakeApiTests.cs | 240 ++ .../Api/FakeClassnameTags123ApiTests.cs | 65 + .../Org.OpenAPITools.Test/Api/PetApiTests.cs | 156 + .../Api/StoreApiTests.cs | 96 + .../Org.OpenAPITools.Test/Api/UserApiTests.cs | 137 + .../Model/AdditionalPropertiesClassTests.cs | 126 + .../Model/AnimalTests.cs | 96 + .../Model/ApiResponseTests.cs | 86 + .../Model/AppleReqTests.cs | 78 + .../Org.OpenAPITools.Test/Model/AppleTests.cs | 78 + .../Model/ArrayOfArrayOfNumberOnlyTests.cs | 70 + .../Model/ArrayOfNumberOnlyTests.cs | 70 + .../Model/ArrayTestTests.cs | 86 + .../Model/BananaReqTests.cs | 78 + .../Model/BananaTests.cs | 70 + .../Model/BasquePigTests.cs | 70 + .../Model/CapitalizationTests.cs | 110 + .../Model/CatAllOfTests.cs | 70 + .../Org.OpenAPITools.Test/Model/CatTests.cs | 70 + .../Model/CategoryTests.cs | 78 + .../Model/ChildCatAllOfTests.cs | 78 + .../Model/ChildCatTests.cs | 78 + .../Model/ClassModelTests.cs | 70 + .../Model/ComplexQuadrilateralTests.cs | 78 + .../Model/DanishPigTests.cs | 70 + .../Model/DeprecatedObjectTests.cs | 70 + .../Model/DogAllOfTests.cs | 70 + .../Org.OpenAPITools.Test/Model/DogTests.cs | 70 + .../Model/DrawingTests.cs | 94 + .../Model/EnumArraysTests.cs | 78 + .../Model/EnumClassTests.cs | 62 + .../Model/EnumTestTests.cs | 134 + .../Model/EquilateralTriangleTests.cs | 78 + .../Model/FileSchemaTestClassTests.cs | 78 + .../Org.OpenAPITools.Test/Model/FileTests.cs | 70 + .../Org.OpenAPITools.Test/Model/FooTests.cs | 70 + .../Model/FormatTestTests.cs | 190 ++ .../Model/FruitReqTests.cs | 94 + .../Org.OpenAPITools.Test/Model/FruitTests.cs | 94 + .../Model/GmFruitTests.cs | 94 + .../Model/GrandparentAnimalTests.cs | 88 + .../Model/HasOnlyReadOnlyTests.cs | 78 + .../Model/HealthCheckResultTests.cs | 70 + .../Model/InlineResponseDefaultTests.cs | 70 + .../Model/IsoscelesTriangleTests.cs | 78 + .../Org.OpenAPITools.Test/Model/ListTests.cs | 70 + .../Model/MammalTests.cs | 94 + .../Model/MapTestTests.cs | 94 + ...ertiesAndAdditionalPropertiesClassTests.cs | 86 + .../Model/Model200ResponseTests.cs | 78 + .../Model/ModelClientTests.cs | 70 + .../Org.OpenAPITools.Test/Model/NameTests.cs | 94 + .../Model/NullableClassTests.cs | 158 + .../Model/NullableShapeTests.cs | 78 + .../Model/NumberOnlyTests.cs | 70 + .../Model/ObjectWithDeprecatedFieldsTests.cs | 94 + .../Org.OpenAPITools.Test/Model/OrderTests.cs | 110 + .../Model/OuterCompositeTests.cs | 86 + .../Model/OuterEnumDefaultValueTests.cs | 62 + .../OuterEnumIntegerDefaultValueTests.cs | 62 + .../Model/OuterEnumIntegerTests.cs | 62 + .../Model/OuterEnumTests.cs | 62 + .../Model/ParentPetTests.cs | 71 + .../Org.OpenAPITools.Test/Model/PetTests.cs | 110 + .../Org.OpenAPITools.Test/Model/PigTests.cs | 70 + .../Model/QuadrilateralInterfaceTests.cs | 70 + .../Model/QuadrilateralTests.cs | 78 + .../Model/ReadOnlyFirstTests.cs | 78 + .../Model/ReturnTests.cs | 70 + .../Model/ScaleneTriangleTests.cs | 78 + .../Model/ShapeInterfaceTests.cs | 70 + .../Model/ShapeOrNullTests.cs | 78 + .../Org.OpenAPITools.Test/Model/ShapeTests.cs | 78 + .../Model/SimpleQuadrilateralTests.cs | 78 + .../Model/SpecialModelNameTests.cs | 78 + .../Org.OpenAPITools.Test/Model/TagTests.cs | 78 + .../Model/TriangleInterfaceTests.cs | 70 + .../Model/TriangleTests.cs | 78 + .../Org.OpenAPITools.Test/Model/UserTests.cs | 158 + .../Org.OpenAPITools.Test/Model/WhaleTests.cs | 86 + .../Org.OpenAPITools.Test/Model/ZebraTests.cs | 78 + .../Org.OpenAPITools.Test.csproj | 21 + .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 258 ++ .../src/Org.OpenAPITools/Api/DefaultApi.cs | 231 ++ .../src/Org.OpenAPITools/Api/FakeApi.cs | 2676 +++++++++++++++++ .../Api/FakeClassnameTags123Api.cs | 273 ++ .../src/Org.OpenAPITools/Api/PetApi.cs | 1693 +++++++++++ .../src/Org.OpenAPITools/Api/StoreApi.cs | 692 +++++ .../src/Org.OpenAPITools/Api/UserApi.cs | 1292 ++++++++ .../Org.OpenAPITools/Client/ApiException.cs | 52 + .../Org.OpenAPITools/Client/ApiKeyToken.cs | 59 + .../Client/ApiResponseEventArgs.cs | 47 + .../Org.OpenAPITools/Client/ApiResponse`1.cs | 104 + .../src/Org.OpenAPITools/Client/BasicToken.cs | 44 + .../Org.OpenAPITools/Client/BearerToken.cs | 39 + .../Org.OpenAPITools/Client/ClientUtils.cs | 366 +++ .../Client/HostConfiguration.cs | 150 + .../Client/HttpSigningConfiguration.cs | 684 +++++ .../Client/HttpSigningToken.cs | 43 + .../src/Org.OpenAPITools/Client/IApi.cs | 21 + .../src/Org.OpenAPITools/Client/OAuthToken.cs | 39 + .../Client/OpenAPIDateConverter.cs | 29 + .../Client/RateLimitProvider`1.cs | 49 + .../src/Org.OpenAPITools/Client/TokenBase.cs | 71 + .../Client/TokenContainer`1.cs | 37 + .../Client/TokenProvider`1.cs | 44 + .../Model/AbstractOpenAPISchema.cs | 76 + .../Model/AdditionalPropertiesClass.cs | 224 ++ .../src/Org.OpenAPITools/Model/Animal.cs | 167 + .../src/Org.OpenAPITools/Model/ApiResponse.cs | 155 + .../src/Org.OpenAPITools/Model/Apple.cs | 159 + .../src/Org.OpenAPITools/Model/AppleReq.cs | 135 + .../Model/ArrayOfArrayOfNumberOnly.cs | 132 + .../Model/ArrayOfNumberOnly.cs | 132 + .../src/Org.OpenAPITools/Model/ArrayTest.cs | 158 + .../src/Org.OpenAPITools/Model/Banana.cs | 129 + .../src/Org.OpenAPITools/Model/BananaReq.cs | 132 + .../src/Org.OpenAPITools/Model/BasquePig.cs | 140 + .../Org.OpenAPITools/Model/Capitalization.cs | 198 ++ .../src/Org.OpenAPITools/Model/Cat.cs | 156 + .../src/Org.OpenAPITools/Model/CatAllOf.cs | 129 + .../src/Org.OpenAPITools/Model/Category.cs | 150 + .../src/Org.OpenAPITools/Model/ChildCat.cs | 181 ++ .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 156 + .../src/Org.OpenAPITools/Model/ClassModel.cs | 132 + .../Model/ComplexQuadrilateral.cs | 153 + .../src/Org.OpenAPITools/Model/DanishPig.cs | 140 + .../Model/DeprecatedObject.cs | 132 + .../src/Org.OpenAPITools/Model/Dog.cs | 159 + .../src/Org.OpenAPITools/Model/DogAllOf.cs | 132 + .../src/Org.OpenAPITools/Model/Drawing.cs | 160 + .../src/Org.OpenAPITools/Model/EnumArrays.cs | 180 ++ .../src/Org.OpenAPITools/Model/EnumClass.cs | 55 + .../src/Org.OpenAPITools/Model/EnumTest.cs | 323 ++ .../Model/EquilateralTriangle.cs | 153 + .../src/Org.OpenAPITools/Model/File.cs | 133 + .../Model/FileSchemaTestClass.cs | 145 + .../src/Org.OpenAPITools/Model/Foo.cs | 132 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 414 +++ .../src/Org.OpenAPITools/Model/Fruit.cs | 291 ++ .../src/Org.OpenAPITools/Model/FruitReq.cs | 300 ++ .../src/Org.OpenAPITools/Model/GmFruit.cs | 263 ++ .../Model/GrandparentAnimal.cs | 154 + .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 158 + .../Model/HealthCheckResult.cs | 132 + .../Model/InlineResponseDefault.cs | 132 + .../Model/IsoscelesTriangle.cs | 138 + .../src/Org.OpenAPITools/Model/List.cs | 132 + .../src/Org.OpenAPITools/Model/Mammal.cs | 338 +++ .../src/Org.OpenAPITools/Model/MapTest.cs | 189 ++ ...dPropertiesAndAdditionalPropertiesClass.cs | 158 + .../Model/Model200Response.cs | 142 + .../src/Org.OpenAPITools/Model/ModelClient.cs | 132 + .../src/Org.OpenAPITools/Model/Name.cs | 182 ++ .../Org.OpenAPITools/Model/NullableClass.cs | 265 ++ .../Org.OpenAPITools/Model/NullableShape.cs | 301 ++ .../src/Org.OpenAPITools/Model/NumberOnly.cs | 129 + .../Model/ObjectWithDeprecatedFields.cs | 171 ++ .../src/Org.OpenAPITools/Model/Order.cs | 210 ++ .../Org.OpenAPITools/Model/OuterComposite.cs | 152 + .../src/Org.OpenAPITools/Model/OuterEnum.cs | 55 + .../Model/OuterEnumDefaultValue.cs | 55 + .../Model/OuterEnumInteger.cs | 51 + .../Model/OuterEnumIntegerDefaultValue.cs | 51 + .../src/Org.OpenAPITools/Model/ParentPet.cs | 146 + .../src/Org.OpenAPITools/Model/Pet.cs | 231 ++ .../src/Org.OpenAPITools/Model/Pig.cs | 292 ++ .../Org.OpenAPITools/Model/Quadrilateral.cs | 292 ++ .../Model/QuadrilateralInterface.cs | 140 + .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 151 + .../src/Org.OpenAPITools/Model/Return.cs | 129 + .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 153 + .../src/Org.OpenAPITools/Model/Shape.cs | 292 ++ .../Org.OpenAPITools/Model/ShapeInterface.cs | 140 + .../src/Org.OpenAPITools/Model/ShapeOrNull.cs | 301 ++ .../Model/SimpleQuadrilateral.cs | 153 + .../Model/SpecialModelName.cs | 142 + .../src/Org.OpenAPITools/Model/Tag.cs | 142 + .../src/Org.OpenAPITools/Model/Triangle.cs | 338 +++ .../Model/TriangleInterface.cs | 140 + .../src/Org.OpenAPITools/Model/User.cs | 274 ++ .../src/Org.OpenAPITools/Model/Whale.cs | 160 + .../src/Org.OpenAPITools/Model/Zebra.cs | 177 ++ .../Org.OpenAPITools/Org.OpenAPITools.csproj | 34 + .../.gitignore | 362 +++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 193 ++ .../.openapi-generator/VERSION | 1 + .../Org.OpenAPITools.sln | 27 + .../README.md | 259 ++ .../appveyor.yml | 9 + .../docs/apis/AnotherFakeApi.md | 80 + .../docs/apis/DefaultApi.md | 73 + .../docs/apis/FakeApi.md | 1126 +++++++ .../docs/apis/FakeClassnameTags123Api.md | 85 + .../docs/apis/PetApi.md | 689 +++++ .../docs/apis/StoreApi.md | 298 ++ .../docs/apis/UserApi.md | 573 ++++ .../docs/models/AdditionalPropertiesClass.md | 17 + .../docs/models/Animal.md | 11 + .../docs/models/ApiResponse.md | 12 + .../docs/models/Apple.md | 11 + .../docs/models/AppleReq.md | 11 + .../docs/models/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/models/ArrayOfNumberOnly.md | 10 + .../docs/models/ArrayTest.md | 12 + .../docs/models/Banana.md | 10 + .../docs/models/BananaReq.md | 11 + .../docs/models/BasquePig.md | 10 + .../docs/models/Capitalization.md | 15 + .../docs/models/Cat.md | 12 + .../docs/models/CatAllOf.md | 10 + .../docs/models/Category.md | 11 + .../docs/models/ChildCat.md | 11 + .../docs/models/ChildCatAllOf.md | 11 + .../docs/models/ClassModel.md | 11 + .../docs/models/ComplexQuadrilateral.md | 11 + .../docs/models/DanishPig.md | 10 + .../docs/models/DeprecatedObject.md | 10 + .../docs/models/Dog.md | 12 + .../docs/models/DogAllOf.md | 10 + .../docs/models/Drawing.md | 13 + .../docs/models/EnumArrays.md | 11 + .../docs/models/EnumClass.md | 9 + .../docs/models/EnumTest.md | 18 + .../docs/models/EquilateralTriangle.md | 11 + .../docs/models/File.md | 11 + .../docs/models/FileSchemaTestClass.md | 11 + .../docs/models/Foo.md | 10 + .../docs/models/FormatTest.md | 25 + .../docs/models/Fruit.md | 13 + .../docs/models/FruitReq.md | 13 + .../docs/models/GmFruit.md | 13 + .../docs/models/GrandparentAnimal.md | 10 + .../docs/models/HasOnlyReadOnly.md | 11 + .../docs/models/HealthCheckResult.md | 11 + .../docs/models/InlineResponseDefault.md | 10 + .../docs/models/IsoscelesTriangle.md | 11 + .../docs/models/List.md | 10 + .../docs/models/Mammal.md | 13 + .../docs/models/MapTest.md | 13 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/models/Model200Response.md | 12 + .../docs/models/ModelClient.md | 10 + .../docs/models/Name.md | 14 + .../docs/models/NullableClass.md | 21 + .../docs/models/NullableShape.md | 12 + .../docs/models/NumberOnly.md | 10 + .../docs/models/ObjectWithDeprecatedFields.md | 13 + .../docs/models/Order.md | 15 + .../docs/models/OuterComposite.md | 12 + .../docs/models/OuterEnum.md | 9 + .../docs/models/OuterEnumDefaultValue.md | 9 + .../docs/models/OuterEnumInteger.md | 9 + .../models/OuterEnumIntegerDefaultValue.md | 9 + .../docs/models/ParentPet.md | 10 + .../docs/models/Pet.md | 15 + .../docs/models/Pig.md | 10 + .../docs/models/Quadrilateral.md | 11 + .../docs/models/QuadrilateralInterface.md | 10 + .../docs/models/ReadOnlyFirst.md | 11 + .../docs/models/Return.md | 11 + .../docs/models/ScaleneTriangle.md | 11 + .../docs/models/Shape.md | 11 + .../docs/models/ShapeInterface.md | 10 + .../docs/models/ShapeOrNull.md | 12 + .../docs/models/SimpleQuadrilateral.md | 11 + .../docs/models/SpecialModelName.md | 11 + .../docs/models/Tag.md | 11 + .../docs/models/Triangle.md | 11 + .../docs/models/TriangleInterface.md | 10 + .../docs/models/User.md | 21 + .../docs/models/Whale.md | 12 + .../docs/models/Zebra.md | 11 + .../docs/scripts/git_push.ps1 | 75 + .../docs/scripts/git_push.sh | 49 + .../Api/AnotherFakeApiTests.cs | 65 + .../Org.OpenAPITools.Test/Api/ApiTestsBase.cs | 71 + .../Api/DefaultApiTests.cs | 64 + .../Api/DependencyInjectionTests.cs | 230 ++ .../Org.OpenAPITools.Test/Api/FakeApiTests.cs | 240 ++ .../Api/FakeClassnameTags123ApiTests.cs | 65 + .../Org.OpenAPITools.Test/Api/PetApiTests.cs | 156 + .../Api/StoreApiTests.cs | 96 + .../Org.OpenAPITools.Test/Api/UserApiTests.cs | 137 + .../Model/AdditionalPropertiesClassTests.cs | 126 + .../Model/AnimalTests.cs | 96 + .../Model/ApiResponseTests.cs | 86 + .../Model/AppleReqTests.cs | 78 + .../Org.OpenAPITools.Test/Model/AppleTests.cs | 78 + .../Model/ArrayOfArrayOfNumberOnlyTests.cs | 70 + .../Model/ArrayOfNumberOnlyTests.cs | 70 + .../Model/ArrayTestTests.cs | 86 + .../Model/BananaReqTests.cs | 78 + .../Model/BananaTests.cs | 70 + .../Model/BasquePigTests.cs | 70 + .../Model/CapitalizationTests.cs | 110 + .../Model/CatAllOfTests.cs | 70 + .../Org.OpenAPITools.Test/Model/CatTests.cs | 70 + .../Model/CategoryTests.cs | 78 + .../Model/ChildCatAllOfTests.cs | 78 + .../Model/ChildCatTests.cs | 78 + .../Model/ClassModelTests.cs | 70 + .../Model/ComplexQuadrilateralTests.cs | 78 + .../Model/DanishPigTests.cs | 70 + .../Model/DeprecatedObjectTests.cs | 70 + .../Model/DogAllOfTests.cs | 70 + .../Org.OpenAPITools.Test/Model/DogTests.cs | 70 + .../Model/DrawingTests.cs | 94 + .../Model/EnumArraysTests.cs | 78 + .../Model/EnumClassTests.cs | 62 + .../Model/EnumTestTests.cs | 134 + .../Model/EquilateralTriangleTests.cs | 78 + .../Model/FileSchemaTestClassTests.cs | 78 + .../Org.OpenAPITools.Test/Model/FileTests.cs | 70 + .../Org.OpenAPITools.Test/Model/FooTests.cs | 70 + .../Model/FormatTestTests.cs | 190 ++ .../Model/FruitReqTests.cs | 94 + .../Org.OpenAPITools.Test/Model/FruitTests.cs | 94 + .../Model/GmFruitTests.cs | 94 + .../Model/GrandparentAnimalTests.cs | 88 + .../Model/HasOnlyReadOnlyTests.cs | 78 + .../Model/HealthCheckResultTests.cs | 70 + .../Model/InlineResponseDefaultTests.cs | 70 + .../Model/IsoscelesTriangleTests.cs | 78 + .../Org.OpenAPITools.Test/Model/ListTests.cs | 70 + .../Model/MammalTests.cs | 94 + .../Model/MapTestTests.cs | 94 + ...ertiesAndAdditionalPropertiesClassTests.cs | 86 + .../Model/Model200ResponseTests.cs | 78 + .../Model/ModelClientTests.cs | 70 + .../Org.OpenAPITools.Test/Model/NameTests.cs | 94 + .../Model/NullableClassTests.cs | 158 + .../Model/NullableShapeTests.cs | 78 + .../Model/NumberOnlyTests.cs | 70 + .../Model/ObjectWithDeprecatedFieldsTests.cs | 94 + .../Org.OpenAPITools.Test/Model/OrderTests.cs | 110 + .../Model/OuterCompositeTests.cs | 86 + .../Model/OuterEnumDefaultValueTests.cs | 62 + .../OuterEnumIntegerDefaultValueTests.cs | 62 + .../Model/OuterEnumIntegerTests.cs | 62 + .../Model/OuterEnumTests.cs | 62 + .../Model/ParentPetTests.cs | 71 + .../Org.OpenAPITools.Test/Model/PetTests.cs | 110 + .../Org.OpenAPITools.Test/Model/PigTests.cs | 70 + .../Model/QuadrilateralInterfaceTests.cs | 70 + .../Model/QuadrilateralTests.cs | 78 + .../Model/ReadOnlyFirstTests.cs | 78 + .../Model/ReturnTests.cs | 70 + .../Model/ScaleneTriangleTests.cs | 78 + .../Model/ShapeInterfaceTests.cs | 70 + .../Model/ShapeOrNullTests.cs | 78 + .../Org.OpenAPITools.Test/Model/ShapeTests.cs | 78 + .../Model/SimpleQuadrilateralTests.cs | 78 + .../Model/SpecialModelNameTests.cs | 78 + .../Org.OpenAPITools.Test/Model/TagTests.cs | 78 + .../Model/TriangleInterfaceTests.cs | 70 + .../Model/TriangleTests.cs | 78 + .../Org.OpenAPITools.Test/Model/UserTests.cs | 158 + .../Org.OpenAPITools.Test/Model/WhaleTests.cs | 86 + .../Org.OpenAPITools.Test/Model/ZebraTests.cs | 78 + .../Org.OpenAPITools.Test.csproj | 20 + .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 247 ++ .../src/Org.OpenAPITools/Api/DefaultApi.cs | 221 ++ .../src/Org.OpenAPITools/Api/FakeApi.cs | 2404 +++++++++++++++ .../Api/FakeClassnameTags123Api.cs | 262 ++ .../src/Org.OpenAPITools/Api/PetApi.cs | 1572 ++++++++++ .../src/Org.OpenAPITools/Api/StoreApi.cs | 626 ++++ .../src/Org.OpenAPITools/Api/UserApi.cs | 1181 ++++++++ .../Org.OpenAPITools/Client/ApiException.cs | 52 + .../Org.OpenAPITools/Client/ApiKeyToken.cs | 59 + .../Client/ApiResponseEventArgs.cs | 47 + .../Org.OpenAPITools/Client/ApiResponse`1.cs | 104 + .../src/Org.OpenAPITools/Client/BasicToken.cs | 44 + .../Org.OpenAPITools/Client/BearerToken.cs | 39 + .../Org.OpenAPITools/Client/ClientUtils.cs | 366 +++ .../Client/HostConfiguration.cs | 150 + .../Client/HttpSigningConfiguration.cs | 684 +++++ .../Client/HttpSigningToken.cs | 43 + .../src/Org.OpenAPITools/Client/IApi.cs | 21 + .../src/Org.OpenAPITools/Client/OAuthToken.cs | 39 + .../Client/OpenAPIDateConverter.cs | 29 + .../Client/RateLimitProvider`1.cs | 49 + .../src/Org.OpenAPITools/Client/TokenBase.cs | 71 + .../Client/TokenContainer`1.cs | 37 + .../Client/TokenProvider`1.cs | 44 + .../Model/AbstractOpenAPISchema.cs | 76 + .../Model/AdditionalPropertiesClass.cs | 224 ++ .../src/Org.OpenAPITools/Model/Animal.cs | 172 ++ .../src/Org.OpenAPITools/Model/ApiResponse.cs | 155 + .../src/Org.OpenAPITools/Model/Apple.cs | 159 + .../src/Org.OpenAPITools/Model/AppleReq.cs | 139 + .../Model/ArrayOfArrayOfNumberOnly.cs | 132 + .../Model/ArrayOfNumberOnly.cs | 132 + .../src/Org.OpenAPITools/Model/ArrayTest.cs | 158 + .../src/Org.OpenAPITools/Model/Banana.cs | 129 + .../src/Org.OpenAPITools/Model/BananaReq.cs | 132 + .../src/Org.OpenAPITools/Model/BasquePig.cs | 144 + .../Org.OpenAPITools/Model/Capitalization.cs | 198 ++ .../src/Org.OpenAPITools/Model/Cat.cs | 156 + .../src/Org.OpenAPITools/Model/CatAllOf.cs | 129 + .../src/Org.OpenAPITools/Model/Category.cs | 154 + .../src/Org.OpenAPITools/Model/ChildCat.cs | 181 ++ .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 156 + .../src/Org.OpenAPITools/Model/ClassModel.cs | 132 + .../Model/ComplexQuadrilateral.cs | 161 + .../src/Org.OpenAPITools/Model/DanishPig.cs | 144 + .../Model/DeprecatedObject.cs | 132 + .../src/Org.OpenAPITools/Model/Dog.cs | 159 + .../src/Org.OpenAPITools/Model/DogAllOf.cs | 132 + .../src/Org.OpenAPITools/Model/Drawing.cs | 160 + .../src/Org.OpenAPITools/Model/EnumArrays.cs | 180 ++ .../src/Org.OpenAPITools/Model/EnumClass.cs | 55 + .../src/Org.OpenAPITools/Model/EnumTest.cs | 323 ++ .../Model/EquilateralTriangle.cs | 161 + .../src/Org.OpenAPITools/Model/File.cs | 133 + .../Model/FileSchemaTestClass.cs | 145 + .../src/Org.OpenAPITools/Model/Foo.cs | 133 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 418 +++ .../src/Org.OpenAPITools/Model/Fruit.cs | 291 ++ .../src/Org.OpenAPITools/Model/FruitReq.cs | 300 ++ .../src/Org.OpenAPITools/Model/GmFruit.cs | 263 ++ .../Model/GrandparentAnimal.cs | 158 + .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 158 + .../Model/HealthCheckResult.cs | 132 + .../Model/InlineResponseDefault.cs | 132 + .../Model/IsoscelesTriangle.cs | 146 + .../src/Org.OpenAPITools/Model/List.cs | 132 + .../src/Org.OpenAPITools/Model/Mammal.cs | 338 +++ .../src/Org.OpenAPITools/Model/MapTest.cs | 189 ++ ...dPropertiesAndAdditionalPropertiesClass.cs | 158 + .../Model/Model200Response.cs | 142 + .../src/Org.OpenAPITools/Model/ModelClient.cs | 132 + .../src/Org.OpenAPITools/Model/Name.cs | 182 ++ .../Org.OpenAPITools/Model/NullableClass.cs | 265 ++ .../Org.OpenAPITools/Model/NullableShape.cs | 301 ++ .../src/Org.OpenAPITools/Model/NumberOnly.cs | 129 + .../Model/ObjectWithDeprecatedFields.cs | 171 ++ .../src/Org.OpenAPITools/Model/Order.cs | 210 ++ .../Org.OpenAPITools/Model/OuterComposite.cs | 152 + .../src/Org.OpenAPITools/Model/OuterEnum.cs | 55 + .../Model/OuterEnumDefaultValue.cs | 55 + .../Model/OuterEnumInteger.cs | 51 + .../Model/OuterEnumIntegerDefaultValue.cs | 51 + .../src/Org.OpenAPITools/Model/ParentPet.cs | 146 + .../src/Org.OpenAPITools/Model/Pet.cs | 235 ++ .../src/Org.OpenAPITools/Model/Pig.cs | 292 ++ .../Org.OpenAPITools/Model/Quadrilateral.cs | 292 ++ .../Model/QuadrilateralInterface.cs | 144 + .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 151 + .../src/Org.OpenAPITools/Model/Return.cs | 129 + .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 161 + .../src/Org.OpenAPITools/Model/Shape.cs | 292 ++ .../Org.OpenAPITools/Model/ShapeInterface.cs | 144 + .../src/Org.OpenAPITools/Model/ShapeOrNull.cs | 301 ++ .../Model/SimpleQuadrilateral.cs | 161 + .../Model/SpecialModelName.cs | 142 + .../src/Org.OpenAPITools/Model/Tag.cs | 142 + .../src/Org.OpenAPITools/Model/Triangle.cs | 338 +++ .../Model/TriangleInterface.cs | 144 + .../src/Org.OpenAPITools/Model/User.cs | 274 ++ .../src/Org.OpenAPITools/Model/Whale.cs | 164 + .../src/Org.OpenAPITools/Model/Zebra.cs | 181 ++ .../Org.OpenAPITools/Org.OpenAPITools.csproj | 33 + .../.gitignore | 362 +++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 193 ++ .../.openapi-generator/VERSION | 1 + .../Org.OpenAPITools.sln | 27 + .../README.md | 259 ++ .../appveyor.yml | 9 + .../docs/apis/AnotherFakeApi.md | 80 + .../docs/apis/DefaultApi.md | 73 + .../docs/apis/FakeApi.md | 1126 +++++++ .../docs/apis/FakeClassnameTags123Api.md | 85 + .../docs/apis/PetApi.md | 689 +++++ .../docs/apis/StoreApi.md | 298 ++ .../docs/apis/UserApi.md | 573 ++++ .../docs/models/AdditionalPropertiesClass.md | 17 + .../docs/models/Animal.md | 11 + .../docs/models/ApiResponse.md | 12 + .../docs/models/Apple.md | 11 + .../docs/models/AppleReq.md | 11 + .../docs/models/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/models/ArrayOfNumberOnly.md | 10 + .../docs/models/ArrayTest.md | 12 + .../docs/models/Banana.md | 10 + .../docs/models/BananaReq.md | 11 + .../docs/models/BasquePig.md | 10 + .../docs/models/Capitalization.md | 15 + .../docs/models/Cat.md | 12 + .../docs/models/CatAllOf.md | 10 + .../docs/models/Category.md | 11 + .../docs/models/ChildCat.md | 11 + .../docs/models/ChildCatAllOf.md | 11 + .../docs/models/ClassModel.md | 11 + .../docs/models/ComplexQuadrilateral.md | 11 + .../docs/models/DanishPig.md | 10 + .../docs/models/DeprecatedObject.md | 10 + .../docs/models/Dog.md | 12 + .../docs/models/DogAllOf.md | 10 + .../docs/models/Drawing.md | 13 + .../docs/models/EnumArrays.md | 11 + .../docs/models/EnumClass.md | 9 + .../docs/models/EnumTest.md | 18 + .../docs/models/EquilateralTriangle.md | 11 + .../docs/models/File.md | 11 + .../docs/models/FileSchemaTestClass.md | 11 + .../docs/models/Foo.md | 10 + .../docs/models/FormatTest.md | 25 + .../docs/models/Fruit.md | 13 + .../docs/models/FruitReq.md | 13 + .../docs/models/GmFruit.md | 13 + .../docs/models/GrandparentAnimal.md | 10 + .../docs/models/HasOnlyReadOnly.md | 11 + .../docs/models/HealthCheckResult.md | 11 + .../docs/models/InlineResponseDefault.md | 10 + .../docs/models/IsoscelesTriangle.md | 11 + .../docs/models/List.md | 10 + .../docs/models/Mammal.md | 13 + .../docs/models/MapTest.md | 13 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/models/Model200Response.md | 12 + .../docs/models/ModelClient.md | 10 + .../docs/models/Name.md | 14 + .../docs/models/NullableClass.md | 21 + .../docs/models/NullableShape.md | 12 + .../docs/models/NumberOnly.md | 10 + .../docs/models/ObjectWithDeprecatedFields.md | 13 + .../docs/models/Order.md | 15 + .../docs/models/OuterComposite.md | 12 + .../docs/models/OuterEnum.md | 9 + .../docs/models/OuterEnumDefaultValue.md | 9 + .../docs/models/OuterEnumInteger.md | 9 + .../models/OuterEnumIntegerDefaultValue.md | 9 + .../docs/models/ParentPet.md | 10 + .../docs/models/Pet.md | 15 + .../docs/models/Pig.md | 10 + .../docs/models/Quadrilateral.md | 11 + .../docs/models/QuadrilateralInterface.md | 10 + .../docs/models/ReadOnlyFirst.md | 11 + .../docs/models/Return.md | 11 + .../docs/models/ScaleneTriangle.md | 11 + .../docs/models/Shape.md | 11 + .../docs/models/ShapeInterface.md | 10 + .../docs/models/ShapeOrNull.md | 12 + .../docs/models/SimpleQuadrilateral.md | 11 + .../docs/models/SpecialModelName.md | 11 + .../docs/models/Tag.md | 11 + .../docs/models/Triangle.md | 11 + .../docs/models/TriangleInterface.md | 10 + .../docs/models/User.md | 21 + .../docs/models/Whale.md | 12 + .../docs/models/Zebra.md | 11 + .../docs/scripts/git_push.ps1 | 75 + .../docs/scripts/git_push.sh | 49 + .../Api/AnotherFakeApiTests.cs | 65 + .../Org.OpenAPITools.Test/Api/ApiTestsBase.cs | 71 + .../Api/DefaultApiTests.cs | 64 + .../Api/DependencyInjectionTests.cs | 230 ++ .../Org.OpenAPITools.Test/Api/FakeApiTests.cs | 240 ++ .../Api/FakeClassnameTags123ApiTests.cs | 65 + .../Org.OpenAPITools.Test/Api/PetApiTests.cs | 156 + .../Api/StoreApiTests.cs | 96 + .../Org.OpenAPITools.Test/Api/UserApiTests.cs | 137 + .../Model/AdditionalPropertiesClassTests.cs | 126 + .../Model/AnimalTests.cs | 96 + .../Model/ApiResponseTests.cs | 86 + .../Model/AppleReqTests.cs | 78 + .../Org.OpenAPITools.Test/Model/AppleTests.cs | 78 + .../Model/ArrayOfArrayOfNumberOnlyTests.cs | 70 + .../Model/ArrayOfNumberOnlyTests.cs | 70 + .../Model/ArrayTestTests.cs | 86 + .../Model/BananaReqTests.cs | 78 + .../Model/BananaTests.cs | 70 + .../Model/BasquePigTests.cs | 70 + .../Model/CapitalizationTests.cs | 110 + .../Model/CatAllOfTests.cs | 70 + .../Org.OpenAPITools.Test/Model/CatTests.cs | 70 + .../Model/CategoryTests.cs | 78 + .../Model/ChildCatAllOfTests.cs | 78 + .../Model/ChildCatTests.cs | 78 + .../Model/ClassModelTests.cs | 70 + .../Model/ComplexQuadrilateralTests.cs | 78 + .../Model/DanishPigTests.cs | 70 + .../Model/DeprecatedObjectTests.cs | 70 + .../Model/DogAllOfTests.cs | 70 + .../Org.OpenAPITools.Test/Model/DogTests.cs | 70 + .../Model/DrawingTests.cs | 94 + .../Model/EnumArraysTests.cs | 78 + .../Model/EnumClassTests.cs | 62 + .../Model/EnumTestTests.cs | 134 + .../Model/EquilateralTriangleTests.cs | 78 + .../Model/FileSchemaTestClassTests.cs | 78 + .../Org.OpenAPITools.Test/Model/FileTests.cs | 70 + .../Org.OpenAPITools.Test/Model/FooTests.cs | 70 + .../Model/FormatTestTests.cs | 190 ++ .../Model/FruitReqTests.cs | 94 + .../Org.OpenAPITools.Test/Model/FruitTests.cs | 94 + .../Model/GmFruitTests.cs | 94 + .../Model/GrandparentAnimalTests.cs | 88 + .../Model/HasOnlyReadOnlyTests.cs | 78 + .../Model/HealthCheckResultTests.cs | 70 + .../Model/InlineResponseDefaultTests.cs | 70 + .../Model/IsoscelesTriangleTests.cs | 78 + .../Org.OpenAPITools.Test/Model/ListTests.cs | 70 + .../Model/MammalTests.cs | 94 + .../Model/MapTestTests.cs | 94 + ...ertiesAndAdditionalPropertiesClassTests.cs | 86 + .../Model/Model200ResponseTests.cs | 78 + .../Model/ModelClientTests.cs | 70 + .../Org.OpenAPITools.Test/Model/NameTests.cs | 94 + .../Model/NullableClassTests.cs | 158 + .../Model/NullableShapeTests.cs | 78 + .../Model/NumberOnlyTests.cs | 70 + .../Model/ObjectWithDeprecatedFieldsTests.cs | 94 + .../Org.OpenAPITools.Test/Model/OrderTests.cs | 110 + .../Model/OuterCompositeTests.cs | 86 + .../Model/OuterEnumDefaultValueTests.cs | 62 + .../OuterEnumIntegerDefaultValueTests.cs | 62 + .../Model/OuterEnumIntegerTests.cs | 62 + .../Model/OuterEnumTests.cs | 62 + .../Model/ParentPetTests.cs | 71 + .../Org.OpenAPITools.Test/Model/PetTests.cs | 110 + .../Org.OpenAPITools.Test/Model/PigTests.cs | 70 + .../Model/QuadrilateralInterfaceTests.cs | 70 + .../Model/QuadrilateralTests.cs | 78 + .../Model/ReadOnlyFirstTests.cs | 78 + .../Model/ReturnTests.cs | 70 + .../Model/ScaleneTriangleTests.cs | 78 + .../Model/ShapeInterfaceTests.cs | 70 + .../Model/ShapeOrNullTests.cs | 78 + .../Org.OpenAPITools.Test/Model/ShapeTests.cs | 78 + .../Model/SimpleQuadrilateralTests.cs | 78 + .../Model/SpecialModelNameTests.cs | 78 + .../Org.OpenAPITools.Test/Model/TagTests.cs | 78 + .../Model/TriangleInterfaceTests.cs | 70 + .../Model/TriangleTests.cs | 78 + .../Org.OpenAPITools.Test/Model/UserTests.cs | 158 + .../Org.OpenAPITools.Test/Model/WhaleTests.cs | 86 + .../Org.OpenAPITools.Test/Model/ZebraTests.cs | 78 + .../Org.OpenAPITools.Test.csproj | 20 + .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 247 ++ .../src/Org.OpenAPITools/Api/DefaultApi.cs | 221 ++ .../src/Org.OpenAPITools/Api/FakeApi.cs | 2404 +++++++++++++++ .../Api/FakeClassnameTags123Api.cs | 262 ++ .../src/Org.OpenAPITools/Api/PetApi.cs | 1572 ++++++++++ .../src/Org.OpenAPITools/Api/StoreApi.cs | 626 ++++ .../src/Org.OpenAPITools/Api/UserApi.cs | 1181 ++++++++ .../Org.OpenAPITools/Client/ApiException.cs | 52 + .../Org.OpenAPITools/Client/ApiKeyToken.cs | 59 + .../Client/ApiResponseEventArgs.cs | 47 + .../Org.OpenAPITools/Client/ApiResponse`1.cs | 104 + .../src/Org.OpenAPITools/Client/BasicToken.cs | 44 + .../Org.OpenAPITools/Client/BearerToken.cs | 39 + .../Org.OpenAPITools/Client/ClientUtils.cs | 366 +++ .../Client/HostConfiguration.cs | 150 + .../Client/HttpSigningConfiguration.cs | 684 +++++ .../Client/HttpSigningToken.cs | 43 + .../src/Org.OpenAPITools/Client/IApi.cs | 21 + .../src/Org.OpenAPITools/Client/OAuthToken.cs | 39 + .../Client/OpenAPIDateConverter.cs | 29 + .../Client/RateLimitProvider`1.cs | 80 + .../src/Org.OpenAPITools/Client/TokenBase.cs | 71 + .../Client/TokenContainer`1.cs | 37 + .../Client/TokenProvider`1.cs | 44 + .../Model/AbstractOpenAPISchema.cs | 76 + .../Model/AdditionalPropertiesClass.cs | 224 ++ .../src/Org.OpenAPITools/Model/Animal.cs | 172 ++ .../src/Org.OpenAPITools/Model/ApiResponse.cs | 155 + .../src/Org.OpenAPITools/Model/Apple.cs | 159 + .../src/Org.OpenAPITools/Model/AppleReq.cs | 139 + .../Model/ArrayOfArrayOfNumberOnly.cs | 132 + .../Model/ArrayOfNumberOnly.cs | 132 + .../src/Org.OpenAPITools/Model/ArrayTest.cs | 158 + .../src/Org.OpenAPITools/Model/Banana.cs | 129 + .../src/Org.OpenAPITools/Model/BananaReq.cs | 132 + .../src/Org.OpenAPITools/Model/BasquePig.cs | 144 + .../Org.OpenAPITools/Model/Capitalization.cs | 198 ++ .../src/Org.OpenAPITools/Model/Cat.cs | 156 + .../src/Org.OpenAPITools/Model/CatAllOf.cs | 129 + .../src/Org.OpenAPITools/Model/Category.cs | 154 + .../src/Org.OpenAPITools/Model/ChildCat.cs | 181 ++ .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 156 + .../src/Org.OpenAPITools/Model/ClassModel.cs | 132 + .../Model/ComplexQuadrilateral.cs | 161 + .../src/Org.OpenAPITools/Model/DanishPig.cs | 144 + .../Model/DeprecatedObject.cs | 132 + .../src/Org.OpenAPITools/Model/Dog.cs | 159 + .../src/Org.OpenAPITools/Model/DogAllOf.cs | 132 + .../src/Org.OpenAPITools/Model/Drawing.cs | 160 + .../src/Org.OpenAPITools/Model/EnumArrays.cs | 180 ++ .../src/Org.OpenAPITools/Model/EnumClass.cs | 55 + .../src/Org.OpenAPITools/Model/EnumTest.cs | 323 ++ .../Model/EquilateralTriangle.cs | 161 + .../src/Org.OpenAPITools/Model/File.cs | 133 + .../Model/FileSchemaTestClass.cs | 145 + .../src/Org.OpenAPITools/Model/Foo.cs | 133 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 418 +++ .../src/Org.OpenAPITools/Model/Fruit.cs | 291 ++ .../src/Org.OpenAPITools/Model/FruitReq.cs | 300 ++ .../src/Org.OpenAPITools/Model/GmFruit.cs | 263 ++ .../Model/GrandparentAnimal.cs | 158 + .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 158 + .../Model/HealthCheckResult.cs | 132 + .../Model/InlineResponseDefault.cs | 132 + .../Model/IsoscelesTriangle.cs | 146 + .../src/Org.OpenAPITools/Model/List.cs | 132 + .../src/Org.OpenAPITools/Model/Mammal.cs | 338 +++ .../src/Org.OpenAPITools/Model/MapTest.cs | 189 ++ ...dPropertiesAndAdditionalPropertiesClass.cs | 158 + .../Model/Model200Response.cs | 142 + .../src/Org.OpenAPITools/Model/ModelClient.cs | 132 + .../src/Org.OpenAPITools/Model/Name.cs | 182 ++ .../Org.OpenAPITools/Model/NullableClass.cs | 265 ++ .../Org.OpenAPITools/Model/NullableShape.cs | 301 ++ .../src/Org.OpenAPITools/Model/NumberOnly.cs | 129 + .../Model/ObjectWithDeprecatedFields.cs | 171 ++ .../src/Org.OpenAPITools/Model/Order.cs | 210 ++ .../Org.OpenAPITools/Model/OuterComposite.cs | 152 + .../src/Org.OpenAPITools/Model/OuterEnum.cs | 55 + .../Model/OuterEnumDefaultValue.cs | 55 + .../Model/OuterEnumInteger.cs | 51 + .../Model/OuterEnumIntegerDefaultValue.cs | 51 + .../src/Org.OpenAPITools/Model/ParentPet.cs | 146 + .../src/Org.OpenAPITools/Model/Pet.cs | 235 ++ .../src/Org.OpenAPITools/Model/Pig.cs | 292 ++ .../Org.OpenAPITools/Model/Quadrilateral.cs | 292 ++ .../Model/QuadrilateralInterface.cs | 144 + .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 151 + .../src/Org.OpenAPITools/Model/Return.cs | 129 + .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 161 + .../src/Org.OpenAPITools/Model/Shape.cs | 292 ++ .../Org.OpenAPITools/Model/ShapeInterface.cs | 144 + .../src/Org.OpenAPITools/Model/ShapeOrNull.cs | 301 ++ .../Model/SimpleQuadrilateral.cs | 161 + .../Model/SpecialModelName.cs | 142 + .../src/Org.OpenAPITools/Model/Tag.cs | 142 + .../src/Org.OpenAPITools/Model/Triangle.cs | 338 +++ .../Model/TriangleInterface.cs | 144 + .../src/Org.OpenAPITools/Model/User.cs | 274 ++ .../src/Org.OpenAPITools/Model/Whale.cs | 164 + .../src/Org.OpenAPITools/Model/Zebra.cs | 181 ++ .../Org.OpenAPITools/Org.OpenAPITools.csproj | 33 + 844 files changed, 102969 insertions(+) create mode 100644 bin/configs/csharp-netcore-OpenAPIClient-generichost-netcore5.0-nrt.yaml create mode 100644 bin/configs/csharp-netcore-OpenAPIClient-generichost-netcore5.0.yaml create mode 100644 bin/configs/csharp-netcore-OpenAPIClient-generichost-netstandard2.0.yaml create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.gitignore create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator-ignore create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/VERSION create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/Org.OpenAPITools.sln create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/README.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/appveyor.yml create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/AnotherFakeApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/PetApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/StoreApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/UserApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Animal.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ApiResponse.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Apple.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/AppleReq.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Banana.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/BananaReq.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/BasquePig.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Capitalization.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Cat.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/CatAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Category.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCat.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCatAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ClassModel.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ComplexQuadrilateral.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DanishPig.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DeprecatedObject.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Dog.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DogAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Drawing.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumArrays.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EquilateralTriangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/File.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FileSchemaTestClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Foo.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Fruit.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FruitReq.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/GmFruit.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/GrandparentAnimal.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HealthCheckResult.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/InlineResponseDefault.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/IsoscelesTriangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/List.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Mammal.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MapTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Model200Response.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ModelClient.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Name.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableShape.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NumberOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Order.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterComposite.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnum.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumInteger.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ParentPet.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pet.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pig.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Quadrilateral.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/QuadrilateralInterface.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ReadOnlyFirst.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Return.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ScaleneTriangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Shape.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ShapeInterface.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ShapeOrNull.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/SimpleQuadrilateral.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/SpecialModelName.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Tag.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Triangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TriangleInterface.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/User.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Whale.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Zebra.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/scripts/git_push.ps1 create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/scripts/git_push.sh create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/PetApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/UserApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AnimalTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CategoryTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DrawingTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ListTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MammalTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MapTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NameTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OrderTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PetTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PigTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReturnTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TagTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/UserTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/WhaleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ZebraTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/AnotherFakeApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/StoreApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/UserApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiException.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiKeyToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiResponse`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/BasicToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/BearerToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ClientUtils.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HttpSigningToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/IApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/OAuthToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenBase.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenContainer`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenProvider`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCat.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/InlineResponseDefault.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnum.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumInteger.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ParentPet.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Org.OpenAPITools.csproj create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.gitignore create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator-ignore create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/VERSION create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/Org.OpenAPITools.sln create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/README.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/appveyor.yml create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/AnotherFakeApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/PetApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/StoreApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/UserApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Animal.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ApiResponse.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Apple.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/AppleReq.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Banana.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/BananaReq.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/BasquePig.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Capitalization.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Cat.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/CatAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Category.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCat.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCatAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ClassModel.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ComplexQuadrilateral.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DanishPig.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DeprecatedObject.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Dog.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DogAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Drawing.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumArrays.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EquilateralTriangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/File.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FileSchemaTestClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Foo.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Fruit.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FruitReq.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/GmFruit.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/GrandparentAnimal.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/HealthCheckResult.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/InlineResponseDefault.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/IsoscelesTriangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/List.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Mammal.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MapTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Model200Response.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ModelClient.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Name.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NullableClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NullableShape.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NumberOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Order.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterComposite.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnum.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumInteger.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ParentPet.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pet.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pig.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Quadrilateral.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/QuadrilateralInterface.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ReadOnlyFirst.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Return.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ScaleneTriangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Shape.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ShapeInterface.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ShapeOrNull.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/SimpleQuadrilateral.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/SpecialModelName.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Tag.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Triangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TriangleInterface.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/User.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Whale.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Zebra.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/scripts/git_push.ps1 create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/scripts/git_push.sh create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/PetApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/UserApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ListTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NameTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PetTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PigTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TagTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/UserTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/StoreApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiException.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiKeyToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiResponse`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/BasicToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/BearerToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ClientUtils.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HttpSigningToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/IApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/OAuthToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenBase.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenContainer`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenProvider`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCat.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnum.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumInteger.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ParentPet.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.gitignore create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator-ignore create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/VERSION create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/Org.OpenAPITools.sln create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/README.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/appveyor.yml create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/AnotherFakeApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/PetApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/StoreApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/UserApi.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Animal.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ApiResponse.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Apple.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/AppleReq.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Banana.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/BananaReq.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/BasquePig.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Capitalization.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Cat.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/CatAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Category.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCat.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCatAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ClassModel.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ComplexQuadrilateral.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DanishPig.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DeprecatedObject.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Dog.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DogAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Drawing.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumArrays.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EquilateralTriangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/File.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FileSchemaTestClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Foo.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Fruit.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FruitReq.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/GmFruit.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/GrandparentAnimal.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/HealthCheckResult.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/InlineResponseDefault.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/IsoscelesTriangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/List.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Mammal.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MapTest.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Model200Response.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ModelClient.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Name.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NullableClass.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NullableShape.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NumberOnly.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Order.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterComposite.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnum.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumInteger.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ParentPet.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pet.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pig.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Quadrilateral.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/QuadrilateralInterface.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ReadOnlyFirst.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Return.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ScaleneTriangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Shape.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ShapeInterface.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ShapeOrNull.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/SimpleQuadrilateral.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/SpecialModelName.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Tag.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Triangle.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TriangleInterface.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/User.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Whale.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Zebra.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/scripts/git_push.ps1 create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/scripts/git_push.sh create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/PetApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/UserApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ListTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NameTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PetTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PigTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TagTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/UserTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/StoreApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiException.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiKeyToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiResponse`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/BasicToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/BearerToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ClientUtils.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HttpSigningToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/IApi.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/OAuthToken.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenBase.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenContainer`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenProvider`1.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCat.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnum.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumInteger.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ParentPet.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/appveyor.yml b/appveyor.yml index b415f5950210..6d5579f0b45e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,6 +48,12 @@ build_script: - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClientCoreAndNet47\Org.OpenAPITools.sln # build C# API client (httpclient) - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-httpclient\Org.OpenAPITools.sln + # build C# API client (generichost) + - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-netstandard2.0\Org.OpenAPITools.sln + # build C# API client (generichost) + - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0\Org.OpenAPITools.sln + # build C# API client (generichost) + - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0-nrt\Org.OpenAPITools.sln # build C# API client (netcore) - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient\Org.OpenAPITools.sln - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClientCore\Org.OpenAPITools.sln @@ -75,6 +81,12 @@ test_script: - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClientCoreAndNet47\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj # test c# API client (httpclient) - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-httpclient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + # test c# API client (generichost) + - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-netstandard2.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + # test c# API client (generichost) + - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + # test c# API client (generichost) + - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0-nrt\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj # test c# API client (netcore) - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj diff --git a/bin/configs/csharp-netcore-OpenAPIClient-generichost-netcore5.0-nrt.yaml b/bin/configs/csharp-netcore-OpenAPIClient-generichost-netcore5.0-nrt.yaml new file mode 100644 index 000000000000..7479eebeccf2 --- /dev/null +++ b/bin/configs/csharp-netcore-OpenAPIClient-generichost-netcore5.0-nrt.yaml @@ -0,0 +1,11 @@ +# for csharp-netcore generichost +generatorName: csharp-netcore +outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +library: generichost +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + targetFramework: net6.0 + nullableReferenceTypes: true diff --git a/bin/configs/csharp-netcore-OpenAPIClient-generichost-netcore5.0.yaml b/bin/configs/csharp-netcore-OpenAPIClient-generichost-netcore5.0.yaml new file mode 100644 index 000000000000..ac25b781088d --- /dev/null +++ b/bin/configs/csharp-netcore-OpenAPIClient-generichost-netcore5.0.yaml @@ -0,0 +1,11 @@ +# for csharp-netcore generichost +generatorName: csharp-netcore +outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0 +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +library: generichost +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + targetFramework: net6.0 + nullableReferenceTypes: false diff --git a/bin/configs/csharp-netcore-OpenAPIClient-generichost-netstandard2.0.yaml b/bin/configs/csharp-netcore-OpenAPIClient-generichost-netstandard2.0.yaml new file mode 100644 index 000000000000..664a5d377e3a --- /dev/null +++ b/bin/configs/csharp-netcore-OpenAPIClient-generichost-netstandard2.0.yaml @@ -0,0 +1,10 @@ +# for csharp-netcore generichost +generatorName: csharp-netcore +outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0 +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +library: generichost +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + targetFramework: netstandard2.0 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.gitignore b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.gitignore new file mode 100644 index 000000000000..1ee53850b84c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator-ignore b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES new file mode 100644 index 000000000000..2f141a0eb477 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES @@ -0,0 +1,193 @@ +.gitignore +Org.OpenAPITools.sln +README.md +appveyor.yml +docs/apis/AnotherFakeApi.md +docs/apis/DefaultApi.md +docs/apis/FakeApi.md +docs/apis/FakeClassnameTags123Api.md +docs/apis/PetApi.md +docs/apis/StoreApi.md +docs/apis/UserApi.md +docs/models/AdditionalPropertiesClass.md +docs/models/Animal.md +docs/models/ApiResponse.md +docs/models/Apple.md +docs/models/AppleReq.md +docs/models/ArrayOfArrayOfNumberOnly.md +docs/models/ArrayOfNumberOnly.md +docs/models/ArrayTest.md +docs/models/Banana.md +docs/models/BananaReq.md +docs/models/BasquePig.md +docs/models/Capitalization.md +docs/models/Cat.md +docs/models/CatAllOf.md +docs/models/Category.md +docs/models/ChildCat.md +docs/models/ChildCatAllOf.md +docs/models/ClassModel.md +docs/models/ComplexQuadrilateral.md +docs/models/DanishPig.md +docs/models/DeprecatedObject.md +docs/models/Dog.md +docs/models/DogAllOf.md +docs/models/Drawing.md +docs/models/EnumArrays.md +docs/models/EnumClass.md +docs/models/EnumTest.md +docs/models/EquilateralTriangle.md +docs/models/File.md +docs/models/FileSchemaTestClass.md +docs/models/Foo.md +docs/models/FormatTest.md +docs/models/Fruit.md +docs/models/FruitReq.md +docs/models/GmFruit.md +docs/models/GrandparentAnimal.md +docs/models/HasOnlyReadOnly.md +docs/models/HealthCheckResult.md +docs/models/InlineResponseDefault.md +docs/models/IsoscelesTriangle.md +docs/models/List.md +docs/models/Mammal.md +docs/models/MapTest.md +docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/Model200Response.md +docs/models/ModelClient.md +docs/models/Name.md +docs/models/NullableClass.md +docs/models/NullableShape.md +docs/models/NumberOnly.md +docs/models/ObjectWithDeprecatedFields.md +docs/models/Order.md +docs/models/OuterComposite.md +docs/models/OuterEnum.md +docs/models/OuterEnumDefaultValue.md +docs/models/OuterEnumInteger.md +docs/models/OuterEnumIntegerDefaultValue.md +docs/models/ParentPet.md +docs/models/Pet.md +docs/models/Pig.md +docs/models/Quadrilateral.md +docs/models/QuadrilateralInterface.md +docs/models/ReadOnlyFirst.md +docs/models/Return.md +docs/models/ScaleneTriangle.md +docs/models/Shape.md +docs/models/ShapeInterface.md +docs/models/ShapeOrNull.md +docs/models/SimpleQuadrilateral.md +docs/models/SpecialModelName.md +docs/models/Tag.md +docs/models/Triangle.md +docs/models/TriangleInterface.md +docs/models/User.md +docs/models/Whale.md +docs/models/Zebra.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiKeyToken.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/BasicToken.cs +src/Org.OpenAPITools/Client/BearerToken.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningToken.cs +src/Org.OpenAPITools/Client/IApi.cs +src/Org.OpenAPITools/Client/OAuthToken.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/AppleReq.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/BananaReq.cs +src/Org.OpenAPITools/Model/BasquePig.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ChildCat.cs +src/Org.OpenAPITools/Model/ChildCatAllOf.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +src/Org.OpenAPITools/Model/DanishPig.cs +src/Org.OpenAPITools/Model/DeprecatedObject.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/Drawing.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/EquilateralTriangle.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/Foo.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Model/FruitReq.cs +src/Org.OpenAPITools/Model/GmFruit.cs +src/Org.OpenAPITools/Model/GrandparentAnimal.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/HealthCheckResult.cs +src/Org.OpenAPITools/Model/InlineResponseDefault.cs +src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/Mammal.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NullableClass.cs +src/Org.OpenAPITools/Model/NullableShape.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumInteger.cs +src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +src/Org.OpenAPITools/Model/ParentPet.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/Pig.cs +src/Org.OpenAPITools/Model/Quadrilateral.cs +src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/ScaleneTriangle.cs +src/Org.OpenAPITools/Model/Shape.cs +src/Org.OpenAPITools/Model/ShapeInterface.cs +src/Org.OpenAPITools/Model/ShapeOrNull.cs +src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/Triangle.cs +src/Org.OpenAPITools/Model/TriangleInterface.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/Whale.cs +src/Org.OpenAPITools/Model/Zebra.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/VERSION new file mode 100644 index 000000000000..0984c4c1ad21 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/Org.OpenAPITools.sln b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/Org.OpenAPITools.sln new file mode 100644 index 000000000000..5b15451c9dcf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/README.md new file mode 100644 index 000000000000..6658de71997e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/README.md @@ -0,0 +1,259 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net6.0', + 'validatable=true', + 'nullableReferenceTypes=true', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + ApiResponse foo = await api.Call123TestSpecialTagsWithHttpInfoAsync("todo"); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [Polly](https://www.nuget.org/packages/Polly/) - 7.2.2 or later +- [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Authentication schemes defined for the API: + + +### 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 + + +### bearer_test + + +- **Type**: Bearer Authentication + + +### http_basic_test + + +- **Type**: HTTP basic authentication + + +### http_signature_test + + + + +### 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 + +## Build +- SDK version: 1.0.0 +- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen + +## Api Information +- appName: OpenAPI Petstore +- appVersion: 1.0.0 +- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true +- withXml: + +## [OpenApi Generator Parameteres](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: true +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net6.0 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/appveyor.yml b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/appveyor.yml new file mode 100644 index 000000000000..f76f63cee506 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/AnotherFakeApi.md new file mode 100644 index 000000000000..93f82cb5bdb1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/AnotherFakeApi.md @@ -0,0 +1,80 @@ +# Org.OpenAPITools.Api.AnotherFakeApi + +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 modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Call123TestSpecialTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md new file mode 100644 index 000000000000..345af7fa914f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md @@ -0,0 +1,73 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FooGet**](DefaultApi.md#fooget) | **GET** /foo | + + + +# **FooGet** +> InlineResponseDefault FooGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FooGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + InlineResponseDefault result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md new file mode 100644 index 000000000000..ae352309dda4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md @@ -0,0 +1,1126 @@ +# Org.OpenAPITools.Api.FakeApi + +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 +[**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 | +[**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums +[**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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeHealthGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) [[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 (bool? body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = true; // bool? | Input boolean as post body (optional) + + try + { + bool result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) [[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? outerComposite = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var outerComposite = new OuterComposite?(); // OuterComposite? | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + +[[Back to top]](#) [[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** +> decimal FakeOuterNumberSerialize (decimal? body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = 8.14D; // decimal? | Input number as post body (optional) + + try + { + decimal result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **decimal?**| Input number as post body | [optional] + +### Return type + +**decimal** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) [[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 (string? body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = "body_example"; // string? | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetArrayOfEnums** +> List<OuterEnum> GetArrayOfEnums () + +Array of Enums + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetArrayOfEnumsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Array of Enums + List result = apiInstance.GetArrayOfEnums(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + +[[Back to top]](#) [[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** +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithFileSchemaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + + try + { + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[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** +> void TestBodyWithQueryParams (string query, User user) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var query = "query_example"; // string | + var user = new User(); // User | + + try + { + apiInstance.TestBodyWithQueryParams(query, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[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 modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClientModelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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** +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string? _string = null, System.IO.Stream? binary = null, DateTime? date = null, DateTime? dateTime = null, string? password = null, string? callback = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: http_basic_test + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(config); + var number = 8.14D; // decimal | None + var _double = 1.2D; // double | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None + var integer = 56; // int? | None (optional) + var int32 = 56; // int? | None (optional) + var int64 = 789L; // long? | None (optional) + var _float = 3.4F; // float? | None (optional) + var _string = "_string_example"; // string? | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream? | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string? | None (optional) + var callback = "callback_example"; // string? | None (optional) + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **decimal**| None | + **_double** | **double**| None | + **patternWithoutDelimiter** | **string**| None | + **_byte** | **byte[]**| None | + **integer** | **int?**| None | [optional] + **int32** | **int?**| None | [optional] + **int64** | **long?**| None | [optional] + **_float** | **float?**| None | [optional] + **_string** | **string?**| None | [optional] + **binary** | **System.IO.Stream?****System.IO.Stream?**| None | [optional] + **date** | **DateTime?**| None | [optional] + **dateTime** | **DateTime?**| None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] + **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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[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** +> void TestEnumParameters (List? enumHeaderStringArray = null, string? enumHeaderString = null, List? enumQueryStringArray = null, string? enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List? enumFormStringArray = null, string? enumFormString = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var enumHeaderStringArray = new List?(); // List? | Header parameter enum test (string array) (optional) + var enumHeaderString = "_abc"; // string? | Header parameter enum test (string) (optional) (default to -efg) + var enumQueryStringArray = new List?(); // List? | Query parameter enum test (string array) (optional) + var enumQueryString = "_abc"; // string? | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) + var enumFormStringArray = new List?(); // List? | Form parameter enum test (string array) (optional) (default to $) + var enumFormString = "_abc"; // string? | Form parameter enum test (string) (optional) (default to -efg) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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] + **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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +[[Back to top]](#) [[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** +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestGroupParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure Bearer token for authorization: bearer_test + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new FakeApi(config); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters + var stringGroup = 56; // int? | String in group parameters (optional) + var booleanGroup = true; // bool? | Boolean in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) + + try + { + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | + **stringGroup** | **int?**| String in group parameters | [optional] + **booleanGroup** | **bool?**| Boolean in group parameters | [optional] + **int64Group** | **long?**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + +[[Back to top]](#) [[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** +> void TestInlineAdditionalProperties (Dictionary requestBody) + +test inline additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Dictionary<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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeClassnameTags123Api.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..0708e362fb24 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeClassnameTags123Api.md @@ -0,0 +1,85 @@ +# Org.OpenAPITools.Api.FakeClassnameTags123Api + +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 modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClassnameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/PetApi.md new file mode 100644 index 000000000000..dcea2d8dd65e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/PetApi.md @@ -0,0 +1,689 @@ +# Org.OpenAPITools.Api.PetApi + +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** +> void AddPet (Pet pet) + +Add a new pet to the store + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[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** +> void DeletePet (long petId, string? apiKey = null) + +Deletes a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string? | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[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<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[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** +> List<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<string>**](string.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[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 (long petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[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** +> void UpdatePet (Pet pet) + +Update an existing pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[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** +> void UpdatePetWithForm (long petId, string? name = null, string? status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string? | Updated name of the pet (optional) + var status = "status_example"; // string? | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[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 (long petId, string? additionalMetadata = null, System.IO.Stream? file = null) + +uploads an image + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string? | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream? | file to upload (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet to update | + **additionalMetadata** | **string?**| Additional data to pass to server | [optional] + **file** | **System.IO.Stream?****System.IO.Stream?**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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 (long petId, System.IO.Stream requiredFile, string? additionalMetadata = null) + +uploads an image (required) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string? | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet to update | + **requiredFile** | **System.IO.Stream****System.IO.Stream**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/StoreApi.md new file mode 100644 index 000000000000..a1e45f5d7926 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/StoreApi.md @@ -0,0 +1,298 @@ +# Org.OpenAPITools.Api.StoreApi + +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** +> void DeleteOrder (string 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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[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** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Dictionary** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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 (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789L; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[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 order) + +Place an order for a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/UserApi.md new file mode 100644 index 000000000000..70ff20fa8965 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/UserApi.md @@ -0,0 +1,573 @@ +# Org.OpenAPITools.Api.UserApi + +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** +> void CreateUser (User user) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[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 (string username) + +Get user by user name + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[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 (string username, string password) + +Logs user into the system + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[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** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void UpdateUser (string username, User user) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | name that need to be deleted + var user = new User(); // User | Updated user object + + try + { + // Updated user + apiInstance.UpdateUser(username, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/AdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..1f9194500099 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/AdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**Anytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype3** | **Dictionary<string, Object>** | | [optional] +**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**MapWithUndeclaredPropertiesString** | **Dictionary<string, string>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Animal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Animal.md new file mode 100644 index 000000000000..1a1760bd8697 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Animal.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ApiResponse.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ApiResponse.md new file mode 100644 index 000000000000..bc808ceeae39 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ApiResponse.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ApiResponse + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Apple.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Apple.md new file mode 100644 index 000000000000..d40b527b3e04 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Apple.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/AppleReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/AppleReq.md new file mode 100644 index 000000000000..325521123f12 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/AppleReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.AppleReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..a23ba59e609c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayOfNumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..10b8413439b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayTest.md new file mode 100644 index 000000000000..32365e6d4d04 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ArrayTest.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **List<string>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Banana.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Banana.md new file mode 100644 index 000000000000..d32e90cf2985 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/BananaReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/BananaReq.md new file mode 100644 index 000000000000..c8372b73c5f7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/BananaReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.BananaReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/BasquePig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/BasquePig.md new file mode 100644 index 000000000000..db4f7a362268 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/BasquePig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BasquePig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Capitalization.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Capitalization.md new file mode 100644 index 000000000000..fde98a967ef8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Capitalization.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | **string** | | [optional] +**CapitalCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**ATT_NAME** | **string** | Name of the pet | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Cat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Cat.md new file mode 100644 index 000000000000..310a5e6575ec --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Cat.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/CatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/CatAllOf.md new file mode 100644 index 000000000000..3b4d9832501e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/CatAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Category.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Category.md new file mode 100644 index 000000000000..6eb0a2e13eaa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Category.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [default to "default-name"] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCat.md new file mode 100644 index 000000000000..88fe8f7a7fdd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCat.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [default to PetTypeEnum.ChildCat] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCatAllOf.md new file mode 100644 index 000000000000..9e853764bc66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCatAllOf.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ClassModel.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ClassModel.md new file mode 100644 index 000000000000..bb35816c9148 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ClassModel.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ClassModel +Model for testing model with \"_class\" property + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ComplexQuadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ComplexQuadrilateral.md new file mode 100644 index 000000000000..14da4bba22ed --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ComplexQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ComplexQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DanishPig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DanishPig.md new file mode 100644 index 000000000000..4d6ec1400a7e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DanishPig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DanishPig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DeprecatedObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DeprecatedObject.md new file mode 100644 index 000000000000..e90c59555a0d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DeprecatedObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DeprecatedObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Dog.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Dog.md new file mode 100644 index 000000000000..70cdc80e83e0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Dog.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DogAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DogAllOf.md new file mode 100644 index 000000000000..31618dfb2197 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/DogAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DogAllOf + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Drawing.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Drawing.md new file mode 100644 index 000000000000..18117e6c938c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Drawing.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Drawing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MainShape** | [**Shape**](Shape.md) | | [optional] +**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**Shapes** | [**List<Shape>**](Shape.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumArrays.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumArrays.md new file mode 100644 index 000000000000..c40bb19edd5e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumArrays.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EnumArrays + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumClass.md new file mode 100644 index 000000000000..d259f0f46968 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumClass.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumTest.md new file mode 100644 index 000000000000..d2b72b5368fb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumTest.md @@ -0,0 +1,18 @@ +# Org.OpenAPITools.Model.EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | **string** | | [optional] +**EnumStringRequired** | **string** | | +**EnumInteger** | **int** | | [optional] +**EnumIntegerOnly** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EquilateralTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EquilateralTriangle.md new file mode 100644 index 000000000000..8360b5c16a5b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EquilateralTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EquilateralTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/File.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/File.md new file mode 100644 index 000000000000..58b9c2fc3698 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/File.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.File +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FileSchemaTestClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FileSchemaTestClass.md new file mode 100644 index 000000000000..a47efad77d8a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Foo.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Foo.md new file mode 100644 index 000000000000..b9e7d261736f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Foo.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Foo + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md new file mode 100644 index 000000000000..b0d2f47b2eb6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md @@ -0,0 +1,25 @@ +# Org.OpenAPITools.Model.FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] +**Decimal** | **decimal** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | +**Binary** | **System.IO.Stream** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] +**Password** | **string** | | +**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Fruit.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Fruit.md new file mode 100644 index 000000000000..cb095b74f324 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Fruit.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] +**LengthCm** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FruitReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FruitReq.md new file mode 100644 index 000000000000..5afd947f4a63 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FruitReq.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.FruitReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [optional] +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/GmFruit.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/GmFruit.md new file mode 100644 index 000000000000..049f6f5c1574 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/GmFruit.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.GmFruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] +**LengthCm** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/GrandparentAnimal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/GrandparentAnimal.md new file mode 100644 index 000000000000..eca96162b6f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/GrandparentAnimal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GrandparentAnimal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HasOnlyReadOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HasOnlyReadOnly.md new file mode 100644 index 000000000000..060a614a6981 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Foo** | **string** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HealthCheckResult.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HealthCheckResult.md new file mode 100644 index 000000000000..8d91f2d854c2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HealthCheckResult.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HealthCheckResult +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | [**string?**](string?.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/InlineResponseDefault.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/InlineResponseDefault.md new file mode 100644 index 000000000000..0c1b0d5bb022 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/InlineResponseDefault.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.InlineResponseDefault + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/IsoscelesTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/IsoscelesTriangle.md new file mode 100644 index 000000000000..07c62ac93382 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/IsoscelesTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.IsoscelesTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/List.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/List.md new file mode 100644 index 000000000000..417d332b3afd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/List.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Mammal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Mammal.md new file mode 100644 index 000000000000..79d95fce63a3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Mammal.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Mammal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [optional] +**ClassName** | **string** | | +**Type** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MapTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MapTest.md new file mode 100644 index 000000000000..03bcebd3d9b2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MapTest.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | **Dictionary<string, string>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..031d2b960653 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Model200Response.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Model200Response.md new file mode 100644 index 000000000000..8bc8049f46f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Model200Response.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Model200Response +Model for testing model name starting with number + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ModelClient.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ModelClient.md new file mode 100644 index 000000000000..9e0e83645f30 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ModelClient.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ModelClient + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Name.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Name.md new file mode 100644 index 000000000000..1fbf5dd5e8b6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Name.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Name +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] [readonly] +**Property** | **string** | | [optional] +**_123Number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableClass.md new file mode 100644 index 000000000000..88058fc4929a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableClass.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | **int?** | | [optional] +**NumberProp** | **decimal?** | | [optional] +**BooleanProp** | **bool?** | | [optional] +**StringProp** | [**string?**](string?.md) | | [optional] +**DateProp** | **DateTime?** | | [optional] +**DatetimeProp** | **DateTime?** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableShape.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableShape.md new file mode 100644 index 000000000000..570ef48f98fc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableShape.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.NullableShape +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NumberOnly.md new file mode 100644 index 000000000000..1b83cce764d3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ObjectWithDeprecatedFields.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..b737f7d757af --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ObjectWithDeprecatedFields.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.ObjectWithDeprecatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **string** | | [optional] +**Id** | **decimal** | | [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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Order.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Order.md new file mode 100644 index 000000000000..ca5d8992a513 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Order.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] +**Status** | **string** | Order Status | [optional] +**Complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterComposite.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterComposite.md new file mode 100644 index 000000000000..abf676810fb6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterComposite.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | **decimal** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnum.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnum.md new file mode 100644 index 000000000000..36844bc4b175 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumDefaultValue.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..351383f0aeae --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumInteger.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumInteger.md new file mode 100644 index 000000000000..1013b5b19565 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..55e314e3102d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ParentPet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ParentPet.md new file mode 100644 index 000000000000..bdf570056372 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ParentPet.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ParentPet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pet.md new file mode 100644 index 000000000000..6a9d41feb0d6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pet.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **string** | | +**PhotoUrls** | **List<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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pig.md new file mode 100644 index 000000000000..fd7bb9359ac4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Pig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Quadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Quadrilateral.md new file mode 100644 index 000000000000..bb7507997a2f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Quadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Quadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/QuadrilateralInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/QuadrilateralInterface.md new file mode 100644 index 000000000000..756ba09c6ddf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/QuadrilateralInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.QuadrilateralInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ReadOnlyFirst.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ReadOnlyFirst.md new file mode 100644 index 000000000000..afaf2ee4fb6c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Baz** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Return.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Return.md new file mode 100644 index 000000000000..a1dadccc421d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Return.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Return +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ScaleneTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ScaleneTriangle.md new file mode 100644 index 000000000000..d3f15354bccc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ScaleneTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ScaleneTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Shape.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Shape.md new file mode 100644 index 000000000000..5627c30bbfc7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Shape.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Shape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ShapeInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ShapeInterface.md new file mode 100644 index 000000000000..882d31868305 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ShapeInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ShapeInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ShapeOrNull.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ShapeOrNull.md new file mode 100644 index 000000000000..a348f4f8bff5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ShapeOrNull.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ShapeOrNull +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/SimpleQuadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/SimpleQuadrilateral.md new file mode 100644 index 000000000000..a36c9957a609 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/SimpleQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SimpleQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/SpecialModelName.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/SpecialModelName.md new file mode 100644 index 000000000000..fa146367bdea --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/SpecialModelName.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | **long** | | [optional] +**_SpecialModelName** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Tag.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Tag.md new file mode 100644 index 000000000000..2b2d9674d619 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Tag.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Triangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Triangle.md new file mode 100644 index 000000000000..74232c3ced98 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Triangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Triangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TriangleInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TriangleInterface.md new file mode 100644 index 000000000000..4127c08b14f3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TriangleInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TriangleInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/User.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/User.md new file mode 100644 index 000000000000..a0f0d2238998 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/User.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Username** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Email** | **string** | | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] +**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**AnyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**AnyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Whale.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Whale.md new file mode 100644 index 000000000000..afbc08409d22 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Whale.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Whale + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [optional] +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Zebra.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Zebra.md new file mode 100644 index 000000000000..4c5a820bac04 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Zebra.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Zebra + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | | [optional] +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/scripts/git_push.ps1 new file mode 100644 index 000000000000..0a2d4e52280a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your prefered git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/scripts/git_push.sh b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/scripts/git_push.sh new file mode 100644 index 000000000000..882104922184 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 000000000000..fea7e39428f6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing AnotherFakeApi + /// + public sealed class AnotherFakeApiTests : ApiTestsBase + { + private readonly IAnotherFakeApi _instance; + + public AnotherFakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test Call123TestSpecialTags + /// + [Fact (Skip = "not implemented")] + public async Task Call123TestSpecialTagsAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.Call123TestSpecialTagsAsync(modelClient); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 000000000000..88d6fc1f4880 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + ApiKeyToken apiKeyToken = new ApiKeyToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken(context.Configuration[""], context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + }); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 000000000000..062cf4363669 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test FooGet + /// + [Fact (Skip = "not implemented")] + public async Task FooGetAsyncTest() + { + var response = await _instance.FooGetAsync(); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 000000000000..4eee3d2b6eb4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,230 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, options) => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, options) => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var anotherFakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs new file mode 100644 index 000000000000..8ddc102dd849 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeApi + /// + public sealed class FakeApiTests : ApiTestsBase + { + private readonly IFakeApi _instance; + + public FakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test FakeHealthGet + /// + [Fact (Skip = "not implemented")] + public async Task FakeHealthGetAsyncTest() + { + var response = await _instance.FakeHealthGetAsync(); + Assert.IsType(response); + } + + /// + /// Test FakeOuterBooleanSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterBooleanSerializeAsyncTest() + { + bool? body = default; + var response = await _instance.FakeOuterBooleanSerializeAsync(body); + Assert.IsType(response); + } + + /// + /// Test FakeOuterCompositeSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterCompositeSerializeAsyncTest() + { + OuterComposite? outerComposite = default; + var response = await _instance.FakeOuterCompositeSerializeAsync(outerComposite); + Assert.IsType(response); + } + + /// + /// Test FakeOuterNumberSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterNumberSerializeAsyncTest() + { + decimal? body = default; + var response = await _instance.FakeOuterNumberSerializeAsync(body); + Assert.IsType(response); + } + + /// + /// Test FakeOuterStringSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterStringSerializeAsyncTest() + { + string? body = default; + var response = await _instance.FakeOuterStringSerializeAsync(body); + Assert.IsType(response); + } + + /// + /// Test GetArrayOfEnums + /// + [Fact (Skip = "not implemented")] + public async Task GetArrayOfEnumsAsyncTest() + { + var response = await _instance.GetArrayOfEnumsAsync(); + Assert.IsType>(response); + } + + /// + /// Test TestBodyWithFileSchema + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithFileSchemaAsyncTest() + { + FileSchemaTestClass fileSchemaTestClass = default; + await _instance.TestBodyWithFileSchemaAsync(fileSchemaTestClass); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithQueryParamsAsyncTest() + { + string query = default; + User user = default; + await _instance.TestBodyWithQueryParamsAsync(query, user); + } + + /// + /// Test TestClientModel + /// + [Fact (Skip = "not implemented")] + public async Task TestClientModelAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClientModelAsync(modelClient); + Assert.IsType(response); + } + + /// + /// Test TestEndpointParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEndpointParametersAsyncTest() + { + decimal number = default; + double _double = default; + string patternWithoutDelimiter = default; + byte[] _byte = default; + int? integer = default; + int? int32 = default; + long? int64 = default; + float? _float = default; + string? _string = default; + System.IO.Stream? binary = default; + DateTime? date = default; + DateTime? dateTime = default; + string? password = default; + string? callback = default; + await _instance.TestEndpointParametersAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + + /// + /// Test TestEnumParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEnumParametersAsyncTest() + { + List? enumHeaderStringArray = default; + string? enumHeaderString = default; + List? enumQueryStringArray = default; + string? enumQueryString = default; + int? enumQueryInteger = default; + double? enumQueryDouble = default; + List? enumFormStringArray = default; + string? enumFormString = default; + await _instance.TestEnumParametersAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /// + /// Test TestGroupParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestGroupParametersAsyncTest() + { + int requiredStringGroup = default; + bool requiredBooleanGroup = default; + long requiredInt64Group = default; + int? stringGroup = default; + bool? booleanGroup = default; + long? int64Group = default; + await _instance.TestGroupParametersAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /// + /// Test TestInlineAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineAdditionalPropertiesAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestInlineAdditionalPropertiesAsync(requestBody); + } + + /// + /// Test TestJsonFormData + /// + [Fact (Skip = "not implemented")] + public async Task TestJsonFormDataAsyncTest() + { + string param = default; + string param2 = default; + await _instance.TestJsonFormDataAsync(param, param2); + } + + /// + /// Test TestQueryParameterCollectionFormat + /// + [Fact (Skip = "not implemented")] + public async Task TestQueryParameterCollectionFormatAsyncTest() + { + List pipe = default; + List ioutil = default; + List http = default; + List url = default; + List context = default; + await _instance.TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 000000000000..0e8d44fe985a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + public sealed class FakeClassnameTags123ApiTests : ApiTestsBase + { + private readonly IFakeClassnameTags123Api _instance; + + public FakeClassnameTags123ApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test TestClassname + /// + [Fact (Skip = "not implemented")] + public async Task TestClassnameAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClassnameAsync(modelClient); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/PetApiTests.cs new file mode 100644 index 000000000000..30734616d1f3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + public sealed class PetApiTests : ApiTestsBase + { + private readonly IPetApi _instance; + + public PetApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test AddPet + /// + [Fact (Skip = "not implemented")] + public async Task AddPetAsyncTest() + { + Pet pet = default; + await _instance.AddPetAsync(pet); + } + + /// + /// Test DeletePet + /// + [Fact (Skip = "not implemented")] + public async Task DeletePetAsyncTest() + { + long petId = default; + string? apiKey = default; + await _instance.DeletePetAsync(petId, apiKey); + } + + /// + /// Test FindPetsByStatus + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByStatusAsyncTest() + { + List status = default; + var response = await _instance.FindPetsByStatusAsync(status); + Assert.IsType>(response); + } + + /// + /// Test FindPetsByTags + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByTagsAsyncTest() + { + List tags = default; + var response = await _instance.FindPetsByTagsAsync(tags); + Assert.IsType>(response); + } + + /// + /// Test GetPetById + /// + [Fact (Skip = "not implemented")] + public async Task GetPetByIdAsyncTest() + { + long petId = default; + var response = await _instance.GetPetByIdAsync(petId); + Assert.IsType(response); + } + + /// + /// Test UpdatePet + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetAsyncTest() + { + Pet pet = default; + await _instance.UpdatePetAsync(pet); + } + + /// + /// Test UpdatePetWithForm + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetWithFormAsyncTest() + { + long petId = default; + string? name = default; + string? status = default; + await _instance.UpdatePetWithFormAsync(petId, name, status); + } + + /// + /// Test UploadFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileAsyncTest() + { + long petId = default; + string? additionalMetadata = default; + System.IO.Stream? file = default; + var response = await _instance.UploadFileAsync(petId, additionalMetadata, file); + Assert.IsType(response); + } + + /// + /// Test UploadFileWithRequiredFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileWithRequiredFileAsyncTest() + { + long petId = default; + System.IO.Stream requiredFile = default; + string? additionalMetadata = default; + var response = await _instance.UploadFileWithRequiredFileAsync(petId, requiredFile, additionalMetadata); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs new file mode 100644 index 000000000000..98748893e324 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + public sealed class StoreApiTests : ApiTestsBase + { + private readonly IStoreApi _instance; + + public StoreApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test DeleteOrder + /// + [Fact (Skip = "not implemented")] + public async Task DeleteOrderAsyncTest() + { + string orderId = default; + await _instance.DeleteOrderAsync(orderId); + } + + /// + /// Test GetInventory + /// + [Fact (Skip = "not implemented")] + public async Task GetInventoryAsyncTest() + { + var response = await _instance.GetInventoryAsync(); + Assert.IsType>(response); + } + + /// + /// Test GetOrderById + /// + [Fact (Skip = "not implemented")] + public async Task GetOrderByIdAsyncTest() + { + long orderId = default; + var response = await _instance.GetOrderByIdAsync(orderId); + Assert.IsType(response); + } + + /// + /// Test PlaceOrder + /// + [Fact (Skip = "not implemented")] + public async Task PlaceOrderAsyncTest() + { + Order order = default; + var response = await _instance.PlaceOrderAsync(order); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/UserApiTests.cs new file mode 100644 index 000000000000..0df256733af7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -0,0 +1,137 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + public sealed class UserApiTests : ApiTestsBase + { + private readonly IUserApi _instance; + + public UserApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test CreateUser + /// + [Fact (Skip = "not implemented")] + public async Task CreateUserAsyncTest() + { + User user = default; + await _instance.CreateUserAsync(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithArrayInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithArrayInputAsync(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithListInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithListInputAsync(user); + } + + /// + /// Test DeleteUser + /// + [Fact (Skip = "not implemented")] + public async Task DeleteUserAsyncTest() + { + string username = default; + await _instance.DeleteUserAsync(username); + } + + /// + /// Test GetUserByName + /// + [Fact (Skip = "not implemented")] + public async Task GetUserByNameAsyncTest() + { + string username = default; + var response = await _instance.GetUserByNameAsync(username); + Assert.IsType(response); + } + + /// + /// Test LoginUser + /// + [Fact (Skip = "not implemented")] + public async Task LoginUserAsyncTest() + { + string username = default; + string password = default; + var response = await _instance.LoginUserAsync(username, password); + Assert.IsType(response); + } + + /// + /// Test LogoutUser + /// + [Fact (Skip = "not implemented")] + public async Task LogoutUserAsyncTest() + { + await _instance.LogoutUserAsync(); + } + + /// + /// Test UpdateUser + /// + [Fact (Skip = "not implemented")] + public async Task UpdateUserAsyncTest() + { + string username = default; + User user = default; + await _instance.UpdateUserAsync(username, user); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs new file mode 100644 index 000000000000..9ab029ed0979 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -0,0 +1,126 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing AdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AdditionalPropertiesClass + //private AdditionalPropertiesClass instance; + + public AdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of AdditionalPropertiesClass + //instance = new AdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AdditionalPropertiesClass + /// + [Fact] + public void AdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" AdditionalPropertiesClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MapProperty' + /// + [Fact] + public void MapPropertyTest() + { + // TODO unit test for the property 'MapProperty' + } + /// + /// Test the property 'MapOfMapProperty' + /// + [Fact] + public void MapOfMapPropertyTest() + { + // TODO unit test for the property 'MapOfMapProperty' + } + /// + /// Test the property 'Anytype1' + /// + [Fact] + public void Anytype1Test() + { + // TODO unit test for the property 'Anytype1' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype1' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype1Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype1' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype2' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype2Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype2' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype3' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype3Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype3' + } + /// + /// Test the property 'EmptyMap' + /// + [Fact] + public void EmptyMapTest() + { + // TODO unit test for the property 'EmptyMap' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesString' + /// + [Fact] + public void MapWithUndeclaredPropertiesStringTest() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AnimalTests.cs new file mode 100644 index 000000000000..291231a91bef --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Animal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Animal + //private Animal instance; + + public AnimalTests() + { + // TODO uncomment below to create an instance of Animal + //instance = new Animal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Animal + /// + [Fact] + public void AnimalInstanceTest() + { + // TODO uncomment below to test "IsType" Animal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Dog from type Animal + /// + [Fact] + public void DogDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Dog from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Dog().ToJson())); + } + /// + /// Test deserialize a Cat from type Animal + /// + [Fact] + public void CatDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Cat from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Cat().ToJson())); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs new file mode 100644 index 000000000000..2a2e098e6082 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Fact] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs new file mode 100644 index 000000000000..f945f6593685 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing AppleReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AppleReq + //private AppleReq instance; + + public AppleReqTests() + { + // TODO uncomment below to create an instance of AppleReq + //instance = new AppleReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AppleReq + /// + [Fact] + public void AppleReqInstanceTest() + { + // TODO uncomment below to test "IsType" AppleReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 000000000000..468d60184ada --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 000000000000..0b259d7d3916 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly + //private ArrayOfArrayOfNumberOnly instance; + + public ArrayOfArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly + //instance = new ArrayOfArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Fact] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfArrayOfNumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Fact] + public void ArrayArrayNumberTest() + { + // TODO unit test for the property 'ArrayArrayNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs new file mode 100644 index 000000000000..27f312ad25f5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfNumberOnly + //private ArrayOfNumberOnly instance; + + public ArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfNumberOnly + //instance = new ArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfNumberOnly + /// + [Fact] + public void ArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfNumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayNumber' + /// + [Fact] + public void ArrayNumberTest() + { + // TODO unit test for the property 'ArrayNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs new file mode 100644 index 000000000000..a433e8c87cf7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayTest + //private ArrayTest instance; + + public ArrayTestTests() + { + // TODO uncomment below to create an instance of ArrayTest + //instance = new ArrayTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayTest + /// + [Fact] + public void ArrayTestInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayOfString' + /// + [Fact] + public void ArrayOfStringTest() + { + // TODO unit test for the property 'ArrayOfString' + } + /// + /// Test the property 'ArrayArrayOfInteger' + /// + [Fact] + public void ArrayArrayOfIntegerTest() + { + // TODO unit test for the property 'ArrayArrayOfInteger' + } + /// + /// Test the property 'ArrayArrayOfModel' + /// + [Fact] + public void ArrayArrayOfModelTest() + { + // TODO unit test for the property 'ArrayArrayOfModel' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs new file mode 100644 index 000000000000..8a6eeb82eeea --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing BananaReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BananaReq + //private BananaReq instance; + + public BananaReqTests() + { + // TODO uncomment below to create an instance of BananaReq + //instance = new BananaReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BananaReq + /// + [Fact] + public void BananaReqInstanceTest() + { + // TODO uncomment below to test "IsType" BananaReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 000000000000..8d8cc376b038 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs new file mode 100644 index 000000000000..3cdccaa75959 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing BasquePig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BasquePigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BasquePig + //private BasquePig instance; + + public BasquePigTests() + { + // TODO uncomment below to create an instance of BasquePig + //instance = new BasquePig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BasquePig + /// + [Fact] + public void BasquePigInstanceTest() + { + // TODO uncomment below to test "IsType" BasquePig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs new file mode 100644 index 000000000000..185c83666fc7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Capitalization + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CapitalizationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Capitalization + //private Capitalization instance; + + public CapitalizationTests() + { + // TODO uncomment below to create an instance of Capitalization + //instance = new Capitalization(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Capitalization + /// + [Fact] + public void CapitalizationInstanceTest() + { + // TODO uncomment below to test "IsType" Capitalization + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SmallCamel' + /// + [Fact] + public void SmallCamelTest() + { + // TODO unit test for the property 'SmallCamel' + } + /// + /// Test the property 'CapitalCamel' + /// + [Fact] + public void CapitalCamelTest() + { + // TODO unit test for the property 'CapitalCamel' + } + /// + /// Test the property 'SmallSnake' + /// + [Fact] + public void SmallSnakeTest() + { + // TODO unit test for the property 'SmallSnake' + } + /// + /// Test the property 'CapitalSnake' + /// + [Fact] + public void CapitalSnakeTest() + { + // TODO unit test for the property 'CapitalSnake' + } + /// + /// Test the property 'SCAETHFlowPoints' + /// + [Fact] + public void SCAETHFlowPointsTest() + { + // TODO unit test for the property 'SCAETHFlowPoints' + } + /// + /// Test the property 'ATT_NAME' + /// + [Fact] + public void ATT_NAMETest() + { + // TODO unit test for the property 'ATT_NAME' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs new file mode 100644 index 000000000000..fb51c28489cb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing CatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CatAllOf + //private CatAllOf instance; + + public CatAllOfTests() + { + // TODO uncomment below to create an instance of CatAllOf + //instance = new CatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of CatAllOf + /// + [Fact] + public void CatAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" CatAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatTests.cs new file mode 100644 index 000000000000..701ba7602823 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Cat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Cat + //private Cat instance; + + public CatTests() + { + // TODO uncomment below to create an instance of Cat + //instance = new Cat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Cat + /// + [Fact] + public void CatInstanceTest() + { + // TODO uncomment below to test "IsType" Cat + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CategoryTests.cs new file mode 100644 index 000000000000..6ce48e601e47 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Category + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CategoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + public CategoryTests() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Category + /// + [Fact] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs new file mode 100644 index 000000000000..49a539324904 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ChildCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCatAllOf + //private ChildCatAllOf instance; + + public ChildCatAllOfTests() + { + // TODO uncomment below to create an instance of ChildCatAllOf + //instance = new ChildCatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCatAllOf + /// + [Fact] + public void ChildCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCatAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs new file mode 100644 index 000000000000..68566fd8d560 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ChildCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCat + //private ChildCat instance; + + public ChildCatTests() + { + // TODO uncomment below to create an instance of ChildCat + //instance = new ChildCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCat + /// + [Fact] + public void ChildCatInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCat + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs new file mode 100644 index 000000000000..d29472e83aaf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ClassModel + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ClassModelTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ClassModel + //private ClassModel instance; + + public ClassModelTests() + { + // TODO uncomment below to create an instance of ClassModel + //instance = new ClassModel(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ClassModel + /// + [Fact] + public void ClassModelInstanceTest() + { + // TODO uncomment below to test "IsType" ClassModel + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs new file mode 100644 index 000000000000..b3529280c8d6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ComplexQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ComplexQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ComplexQuadrilateral + //private ComplexQuadrilateral instance; + + public ComplexQuadrilateralTests() + { + // TODO uncomment below to create an instance of ComplexQuadrilateral + //instance = new ComplexQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ComplexQuadrilateral + /// + [Fact] + public void ComplexQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" ComplexQuadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs new file mode 100644 index 000000000000..572d9bffa790 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DanishPig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DanishPigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DanishPig + //private DanishPig instance; + + public DanishPigTests() + { + // TODO uncomment below to create an instance of DanishPig + //instance = new DanishPig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DanishPig + /// + [Fact] + public void DanishPigInstanceTest() + { + // TODO uncomment below to test "IsType" DanishPig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs new file mode 100644 index 000000000000..1da5f4011c95 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DeprecatedObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DeprecatedObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DeprecatedObject + //private DeprecatedObject instance; + + public DeprecatedObjectTests() + { + // TODO uncomment below to create an instance of DeprecatedObject + //instance = new DeprecatedObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DeprecatedObject + /// + [Fact] + public void DeprecatedObjectInstanceTest() + { + // TODO uncomment below to test "IsType" DeprecatedObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs new file mode 100644 index 000000000000..b22a44420963 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DogAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DogAllOf + //private DogAllOf instance; + + public DogAllOfTests() + { + // TODO uncomment below to create an instance of DogAllOf + //instance = new DogAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DogAllOf + /// + [Fact] + public void DogAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" DogAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogTests.cs new file mode 100644 index 000000000000..992f93a51fd5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Dog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Dog + //private Dog instance; + + public DogTests() + { + // TODO uncomment below to create an instance of Dog + //instance = new Dog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Dog + /// + [Fact] + public void DogInstanceTest() + { + // TODO uncomment below to test "IsType" Dog + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DrawingTests.cs new file mode 100644 index 000000000000..0709ad9eeb3b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Drawing + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DrawingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Drawing + //private Drawing instance; + + public DrawingTests() + { + // TODO uncomment below to create an instance of Drawing + //instance = new Drawing(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Drawing + /// + [Fact] + public void DrawingInstanceTest() + { + // TODO uncomment below to test "IsType" Drawing + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MainShape' + /// + [Fact] + public void MainShapeTest() + { + // TODO unit test for the property 'MainShape' + } + /// + /// Test the property 'ShapeOrNull' + /// + [Fact] + public void ShapeOrNullTest() + { + // TODO unit test for the property 'ShapeOrNull' + } + /// + /// Test the property 'NullableShape' + /// + [Fact] + public void NullableShapeTest() + { + // TODO unit test for the property 'NullableShape' + } + /// + /// Test the property 'Shapes' + /// + [Fact] + public void ShapesTest() + { + // TODO unit test for the property 'Shapes' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs new file mode 100644 index 000000000000..5779ca294775 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumArrays + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArrays + //private EnumArrays instance; + + public EnumArraysTests() + { + // TODO uncomment below to create an instance of EnumArrays + //instance = new EnumArrays(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArrays + /// + [Fact] + public void EnumArraysInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArrays + //Assert.IsType(instance); + } + + + /// + /// Test the property 'JustSymbol' + /// + [Fact] + public void JustSymbolTest() + { + // TODO unit test for the property 'JustSymbol' + } + /// + /// Test the property 'ArrayEnum' + /// + [Fact] + public void ArrayEnumTest() + { + // TODO unit test for the property 'ArrayEnum' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs new file mode 100644 index 000000000000..a17738c5cbc5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumClass + //private EnumClass instance; + + public EnumClassTests() + { + // TODO uncomment below to create an instance of EnumClass + //instance = new EnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumClass + /// + [Fact] + public void EnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" EnumClass + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs new file mode 100644 index 000000000000..4f81b845d493 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTest + //private EnumTest instance; + + public EnumTestTests() + { + // TODO uncomment below to create an instance of EnumTest + //instance = new EnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTest + /// + [Fact] + public void EnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EnumString' + /// + [Fact] + public void EnumStringTest() + { + // TODO unit test for the property 'EnumString' + } + /// + /// Test the property 'EnumStringRequired' + /// + [Fact] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + /// + /// Test the property 'EnumInteger' + /// + [Fact] + public void EnumIntegerTest() + { + // TODO unit test for the property 'EnumInteger' + } + /// + /// Test the property 'EnumIntegerOnly' + /// + [Fact] + public void EnumIntegerOnlyTest() + { + // TODO unit test for the property 'EnumIntegerOnly' + } + /// + /// Test the property 'EnumNumber' + /// + [Fact] + public void EnumNumberTest() + { + // TODO unit test for the property 'EnumNumber' + } + /// + /// Test the property 'OuterEnum' + /// + [Fact] + public void OuterEnumTest() + { + // TODO unit test for the property 'OuterEnum' + } + /// + /// Test the property 'OuterEnumInteger' + /// + [Fact] + public void OuterEnumIntegerTest() + { + // TODO unit test for the property 'OuterEnumInteger' + } + /// + /// Test the property 'OuterEnumDefaultValue' + /// + [Fact] + public void OuterEnumDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumDefaultValue' + } + /// + /// Test the property 'OuterEnumIntegerDefaultValue' + /// + [Fact] + public void OuterEnumIntegerDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumIntegerDefaultValue' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs new file mode 100644 index 000000000000..4663cb667de6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EquilateralTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EquilateralTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EquilateralTriangle + //private EquilateralTriangle instance; + + public EquilateralTriangleTests() + { + // TODO uncomment below to create an instance of EquilateralTriangle + //instance = new EquilateralTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EquilateralTriangle + /// + [Fact] + public void EquilateralTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" EquilateralTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs new file mode 100644 index 000000000000..9f45b4fe89d5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FileSchemaTestClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileSchemaTestClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FileSchemaTestClass + //private FileSchemaTestClass instance; + + public FileSchemaTestClassTests() + { + // TODO uncomment below to create an instance of FileSchemaTestClass + //instance = new FileSchemaTestClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FileSchemaTestClass + /// + [Fact] + public void FileSchemaTestClassInstanceTest() + { + // TODO uncomment below to test "IsType" FileSchemaTestClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + /// + /// Test the property 'Files' + /// + [Fact] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileTests.cs new file mode 100644 index 000000000000..761bb72a844f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing File + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileTests : IDisposable + { + // TODO uncomment below to declare an instance variable for File + //private File instance; + + public FileTests() + { + // TODO uncomment below to create an instance of File + //instance = new File(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of File + /// + [Fact] + public void FileInstanceTest() + { + // TODO uncomment below to test "IsType" File + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SourceURI' + /// + [Fact] + public void SourceURITest() + { + // TODO unit test for the property 'SourceURI' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooTests.cs new file mode 100644 index 000000000000..0b6ed52edbd4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Foo + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Foo + //private Foo instance; + + public FooTests() + { + // TODO uncomment below to create an instance of Foo + //instance = new Foo(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Foo + /// + [Fact] + public void FooInstanceTest() + { + // TODO uncomment below to test "IsType" Foo + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs new file mode 100644 index 000000000000..97332800e9af --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -0,0 +1,190 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FormatTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FormatTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FormatTest + //private FormatTest instance; + + public FormatTestTests() + { + // TODO uncomment below to create an instance of FormatTest + //instance = new FormatTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FormatTest + /// + [Fact] + public void FormatTestInstanceTest() + { + // TODO uncomment below to test "IsType" FormatTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Integer' + /// + [Fact] + public void IntegerTest() + { + // TODO unit test for the property 'Integer' + } + /// + /// Test the property 'Int32' + /// + [Fact] + public void Int32Test() + { + // TODO unit test for the property 'Int32' + } + /// + /// Test the property 'Int64' + /// + [Fact] + public void Int64Test() + { + // TODO unit test for the property 'Int64' + } + /// + /// Test the property 'Number' + /// + [Fact] + public void NumberTest() + { + // TODO unit test for the property 'Number' + } + /// + /// Test the property 'Float' + /// + [Fact] + public void FloatTest() + { + // TODO unit test for the property 'Float' + } + /// + /// Test the property 'Double' + /// + [Fact] + public void DoubleTest() + { + // TODO unit test for the property 'Double' + } + /// + /// Test the property 'Decimal' + /// + [Fact] + public void DecimalTest() + { + // TODO unit test for the property 'Decimal' + } + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + /// + /// Test the property 'Byte' + /// + [Fact] + public void ByteTest() + { + // TODO unit test for the property 'Byte' + } + /// + /// Test the property 'Binary' + /// + [Fact] + public void BinaryTest() + { + // TODO unit test for the property 'Binary' + } + /// + /// Test the property 'Date' + /// + [Fact] + public void DateTest() + { + // TODO unit test for the property 'Date' + } + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'PatternWithDigits' + /// + [Fact] + public void PatternWithDigitsTest() + { + // TODO unit test for the property 'PatternWithDigits' + } + /// + /// Test the property 'PatternWithDigitsAndDelimiter' + /// + [Fact] + public void PatternWithDigitsAndDelimiterTest() + { + // TODO unit test for the property 'PatternWithDigitsAndDelimiter' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs new file mode 100644 index 000000000000..5ea9e3ffc1d5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FruitReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FruitReq + //private FruitReq instance; + + public FruitReqTests() + { + // TODO uncomment below to create an instance of FruitReq + //instance = new FruitReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FruitReq + /// + [Fact] + public void FruitReqInstanceTest() + { + // TODO uncomment below to test "IsType" FruitReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 000000000000..91e069bb42fa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs new file mode 100644 index 000000000000..08fb0e07a1c8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GmFruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GmFruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GmFruit + //private GmFruit instance; + + public GmFruitTests() + { + // TODO uncomment below to create an instance of GmFruit + //instance = new GmFruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GmFruit + /// + [Fact] + public void GmFruitInstanceTest() + { + // TODO uncomment below to test "IsType" GmFruit + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs new file mode 100644 index 000000000000..75f4fd8b0e52 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -0,0 +1,88 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GrandparentAnimal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GrandparentAnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GrandparentAnimal + //private GrandparentAnimal instance; + + public GrandparentAnimalTests() + { + // TODO uncomment below to create an instance of GrandparentAnimal + //instance = new GrandparentAnimal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GrandparentAnimal + /// + [Fact] + public void GrandparentAnimalInstanceTest() + { + // TODO uncomment below to test "IsType" GrandparentAnimal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ParentPet from type GrandparentAnimal + /// + [Fact] + public void ParentPetDeserializeFromGrandparentAnimalTest() + { + // TODO uncomment below to test deserialize a ParentPet from type GrandparentAnimal + //Assert.IsType(JsonConvert.DeserializeObject(new ParentPet().ToJson())); + } + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs new file mode 100644 index 000000000000..651a9f0ce30c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing HasOnlyReadOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HasOnlyReadOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HasOnlyReadOnly + //private HasOnlyReadOnly instance; + + public HasOnlyReadOnlyTests() + { + // TODO uncomment below to create an instance of HasOnlyReadOnly + //instance = new HasOnlyReadOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HasOnlyReadOnly + /// + [Fact] + public void HasOnlyReadOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" HasOnlyReadOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Foo' + /// + [Fact] + public void FooTest() + { + // TODO unit test for the property 'Foo' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs new file mode 100644 index 000000000000..857190a3334d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing HealthCheckResult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HealthCheckResultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HealthCheckResult + //private HealthCheckResult instance; + + public HealthCheckResultTests() + { + // TODO uncomment below to create an instance of HealthCheckResult + //instance = new HealthCheckResult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HealthCheckResult + /// + [Fact] + public void HealthCheckResultInstanceTest() + { + // TODO uncomment below to test "IsType" HealthCheckResult + //Assert.IsType(instance); + } + + + /// + /// Test the property 'NullableMessage' + /// + [Fact] + public void NullableMessageTest() + { + // TODO unit test for the property 'NullableMessage' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs new file mode 100644 index 000000000000..7731f80c16db --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing InlineResponseDefault + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class InlineResponseDefaultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for InlineResponseDefault + //private InlineResponseDefault instance; + + public InlineResponseDefaultTests() + { + // TODO uncomment below to create an instance of InlineResponseDefault + //instance = new InlineResponseDefault(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of InlineResponseDefault + /// + [Fact] + public void InlineResponseDefaultInstanceTest() + { + // TODO uncomment below to test "IsType" InlineResponseDefault + //Assert.IsType(instance); + } + + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs new file mode 100644 index 000000000000..755c417cc54f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing IsoscelesTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class IsoscelesTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for IsoscelesTriangle + //private IsoscelesTriangle instance; + + public IsoscelesTriangleTests() + { + // TODO uncomment below to create an instance of IsoscelesTriangle + //instance = new IsoscelesTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of IsoscelesTriangle + /// + [Fact] + public void IsoscelesTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" IsoscelesTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ListTests.cs new file mode 100644 index 000000000000..2ed828d05208 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing List + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for List + //private List instance; + + public ListTests() + { + // TODO uncomment below to create an instance of List + //instance = new List(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of List + /// + [Fact] + public void ListInstanceTest() + { + // TODO uncomment below to test "IsType" List + //Assert.IsType(instance); + } + + + /// + /// Test the property '_123List' + /// + [Fact] + public void _123ListTest() + { + // TODO unit test for the property '_123List' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MammalTests.cs new file mode 100644 index 000000000000..7b46cbf06450 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Mammal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MammalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Mammal + //private Mammal instance; + + public MammalTests() + { + // TODO uncomment below to create an instance of Mammal + //instance = new Mammal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Mammal + /// + [Fact] + public void MammalInstanceTest() + { + // TODO uncomment below to test "IsType" Mammal + //Assert.IsType(instance); + } + + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MapTestTests.cs new file mode 100644 index 000000000000..20036e1c905e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MapTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTest + //private MapTest instance; + + public MapTestTests() + { + // TODO uncomment below to create an instance of MapTest + //instance = new MapTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTest + /// + [Fact] + public void MapTestInstanceTest() + { + // TODO uncomment below to test "IsType" MapTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MapMapOfString' + /// + [Fact] + public void MapMapOfStringTest() + { + // TODO unit test for the property 'MapMapOfString' + } + /// + /// Test the property 'MapOfEnumString' + /// + [Fact] + public void MapOfEnumStringTest() + { + // TODO unit test for the property 'MapOfEnumString' + } + /// + /// Test the property 'DirectMap' + /// + [Fact] + public void DirectMapTest() + { + // TODO unit test for the property 'DirectMap' + } + /// + /// Test the property 'IndirectMap' + /// + [Fact] + public void IndirectMapTest() + { + // TODO unit test for the property 'IndirectMap' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs new file mode 100644 index 000000000000..f56cd715f45f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixedPropertiesAndAdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedPropertiesAndAdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass + //private MixedPropertiesAndAdditionalPropertiesClass instance; + + public MixedPropertiesAndAdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass + //instance = new MixedPropertiesAndAdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass + /// + [Fact] + public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" MixedPropertiesAndAdditionalPropertiesClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Map' + /// + [Fact] + public void MapTest() + { + // TODO unit test for the property 'Map' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs new file mode 100644 index 000000000000..e25478618f20 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Model200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class Model200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Model200Response + //private Model200Response instance; + + public Model200ResponseTests() + { + // TODO uncomment below to create an instance of Model200Response + //instance = new Model200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Model200Response + /// + [Fact] + public void Model200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" Model200Response + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs new file mode 100644 index 000000000000..24a9e2631586 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ModelClient + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ModelClientTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ModelClient + //private ModelClient instance; + + public ModelClientTests() + { + // TODO uncomment below to create an instance of ModelClient + //instance = new ModelClient(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ModelClient + /// + [Fact] + public void ModelClientInstanceTest() + { + // TODO uncomment below to test "IsType" ModelClient + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Client' + /// + [Fact] + public void _ClientTest() + { + // TODO unit test for the property '_Client' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NameTests.cs new file mode 100644 index 000000000000..c390049e66dc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Name + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Name + //private Name instance; + + public NameTests() + { + // TODO uncomment below to create an instance of Name + //instance = new Name(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Name + /// + [Fact] + public void NameInstanceTest() + { + // TODO uncomment below to test "IsType" Name + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Name' + /// + [Fact] + public void _NameTest() + { + // TODO unit test for the property '_Name' + } + /// + /// Test the property 'SnakeCase' + /// + [Fact] + public void SnakeCaseTest() + { + // TODO unit test for the property 'SnakeCase' + } + /// + /// Test the property 'Property' + /// + [Fact] + public void PropertyTest() + { + // TODO unit test for the property 'Property' + } + /// + /// Test the property '_123Number' + /// + [Fact] + public void _123NumberTest() + { + // TODO unit test for the property '_123Number' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs new file mode 100644 index 000000000000..8f00505612a9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NullableClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableClass + //private NullableClass instance; + + public NullableClassTests() + { + // TODO uncomment below to create an instance of NullableClass + //instance = new NullableClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableClass + /// + [Fact] + public void NullableClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'IntegerProp' + /// + [Fact] + public void IntegerPropTest() + { + // TODO unit test for the property 'IntegerProp' + } + /// + /// Test the property 'NumberProp' + /// + [Fact] + public void NumberPropTest() + { + // TODO unit test for the property 'NumberProp' + } + /// + /// Test the property 'BooleanProp' + /// + [Fact] + public void BooleanPropTest() + { + // TODO unit test for the property 'BooleanProp' + } + /// + /// Test the property 'StringProp' + /// + [Fact] + public void StringPropTest() + { + // TODO unit test for the property 'StringProp' + } + /// + /// Test the property 'DateProp' + /// + [Fact] + public void DatePropTest() + { + // TODO unit test for the property 'DateProp' + } + /// + /// Test the property 'DatetimeProp' + /// + [Fact] + public void DatetimePropTest() + { + // TODO unit test for the property 'DatetimeProp' + } + /// + /// Test the property 'ArrayNullableProp' + /// + [Fact] + public void ArrayNullablePropTest() + { + // TODO unit test for the property 'ArrayNullableProp' + } + /// + /// Test the property 'ArrayAndItemsNullableProp' + /// + [Fact] + public void ArrayAndItemsNullablePropTest() + { + // TODO unit test for the property 'ArrayAndItemsNullableProp' + } + /// + /// Test the property 'ArrayItemsNullable' + /// + [Fact] + public void ArrayItemsNullableTest() + { + // TODO unit test for the property 'ArrayItemsNullable' + } + /// + /// Test the property 'ObjectNullableProp' + /// + [Fact] + public void ObjectNullablePropTest() + { + // TODO unit test for the property 'ObjectNullableProp' + } + /// + /// Test the property 'ObjectAndItemsNullableProp' + /// + [Fact] + public void ObjectAndItemsNullablePropTest() + { + // TODO unit test for the property 'ObjectAndItemsNullableProp' + } + /// + /// Test the property 'ObjectItemsNullable' + /// + [Fact] + public void ObjectItemsNullableTest() + { + // TODO unit test for the property 'ObjectItemsNullable' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs new file mode 100644 index 000000000000..5662f91d6e64 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NullableShape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableShape + //private NullableShape instance; + + public NullableShapeTests() + { + // TODO uncomment below to create an instance of NullableShape + //instance = new NullableShape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableShape + /// + [Fact] + public void NullableShapeInstanceTest() + { + // TODO uncomment below to test "IsType" NullableShape + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs new file mode 100644 index 000000000000..3a06cb020b2a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NumberOnly + //private NumberOnly instance; + + public NumberOnlyTests() + { + // TODO uncomment below to create an instance of NumberOnly + //instance = new NumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NumberOnly + /// + [Fact] + public void NumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" NumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'JustNumber' + /// + [Fact] + public void JustNumberTest() + { + // TODO unit test for the property 'JustNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs new file mode 100644 index 000000000000..82f93fab48c5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ObjectWithDeprecatedFields + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ObjectWithDeprecatedFieldsTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ObjectWithDeprecatedFields + //private ObjectWithDeprecatedFields instance; + + public ObjectWithDeprecatedFieldsTests() + { + // TODO uncomment below to create an instance of ObjectWithDeprecatedFields + //instance = new ObjectWithDeprecatedFields(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ObjectWithDeprecatedFields + /// + [Fact] + public void ObjectWithDeprecatedFieldsInstanceTest() + { + // TODO uncomment below to test "IsType" ObjectWithDeprecatedFields + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'DeprecatedRef' + /// + [Fact] + public void DeprecatedRefTest() + { + // TODO unit test for the property 'DeprecatedRef' + } + /// + /// Test the property 'Bars' + /// + [Fact] + public void BarsTest() + { + // TODO unit test for the property 'Bars' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OrderTests.cs new file mode 100644 index 000000000000..cf5c561c5476 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Fact] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'PetId' + /// + [Fact] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + /// + /// Test the property 'Quantity' + /// + [Fact] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + /// + /// Test the property 'ShipDate' + /// + [Fact] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + /// + /// Test the property 'Complete' + /// + [Fact] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs new file mode 100644 index 000000000000..2efda0db59c4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterComposite + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterCompositeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + public OuterCompositeTests() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterComposite + /// + [Fact] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsType" OuterComposite + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MyNumber' + /// + [Fact] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + /// + /// Test the property 'MyString' + /// + [Fact] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + /// + /// Test the property 'MyBoolean' + /// + [Fact] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs new file mode 100644 index 000000000000..986fff774c46 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumDefaultValue + //private OuterEnumDefaultValue instance; + + public OuterEnumDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumDefaultValue + //instance = new OuterEnumDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumDefaultValue + /// + [Fact] + public void OuterEnumDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumDefaultValue + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs new file mode 100644 index 000000000000..015d5dab945e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumIntegerDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumIntegerDefaultValue + //private OuterEnumIntegerDefaultValue instance; + + public OuterEnumIntegerDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumIntegerDefaultValue + //instance = new OuterEnumIntegerDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumIntegerDefaultValue + /// + [Fact] + public void OuterEnumIntegerDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumIntegerDefaultValue + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs new file mode 100644 index 000000000000..385e899110a4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumInteger + //private OuterEnumInteger instance; + + public OuterEnumIntegerTests() + { + // TODO uncomment below to create an instance of OuterEnumInteger + //instance = new OuterEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumInteger + /// + [Fact] + public void OuterEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumInteger + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs new file mode 100644 index 000000000000..f47304767b9e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnum + //private OuterEnum instance; + + public OuterEnumTests() + { + // TODO uncomment below to create an instance of OuterEnum + //instance = new OuterEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnum + /// + [Fact] + public void OuterEnumInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnum + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs new file mode 100644 index 000000000000..1e17568ed331 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ParentPet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ParentPetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ParentPet + //private ParentPet instance; + + public ParentPetTests() + { + // TODO uncomment below to create an instance of ParentPet + //instance = new ParentPet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ParentPet + /// + [Fact] + public void ParentPetInstanceTest() + { + // TODO uncomment below to test "IsType" ParentPet + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PetTests.cs new file mode 100644 index 000000000000..154e66f8dfc0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + public PetTests() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pet + /// + [Fact] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsType" Pet + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PhotoUrls' + /// + [Fact] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PigTests.cs new file mode 100644 index 000000000000..55cf2189046b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Pig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pig + //private Pig instance; + + public PigTests() + { + // TODO uncomment below to create an instance of Pig + //instance = new Pig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pig + /// + [Fact] + public void PigInstanceTest() + { + // TODO uncomment below to test "IsType" Pig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs new file mode 100644 index 000000000000..6eef9f4c816d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing QuadrilateralInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for QuadrilateralInterface + //private QuadrilateralInterface instance; + + public QuadrilateralInterfaceTests() + { + // TODO uncomment below to create an instance of QuadrilateralInterface + //instance = new QuadrilateralInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of QuadrilateralInterface + /// + [Fact] + public void QuadrilateralInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" QuadrilateralInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs new file mode 100644 index 000000000000..26826681a478 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Quadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Quadrilateral + //private Quadrilateral instance; + + public QuadrilateralTests() + { + // TODO uncomment below to create an instance of Quadrilateral + //instance = new Quadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Quadrilateral + /// + [Fact] + public void QuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" Quadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs new file mode 100644 index 000000000000..dc3d0fad54cd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ReadOnlyFirst + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReadOnlyFirstTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ReadOnlyFirst + //private ReadOnlyFirst instance; + + public ReadOnlyFirstTests() + { + // TODO uncomment below to create an instance of ReadOnlyFirst + //instance = new ReadOnlyFirst(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ReadOnlyFirst + /// + [Fact] + public void ReadOnlyFirstInstanceTest() + { + // TODO uncomment below to test "IsType" ReadOnlyFirst + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Baz' + /// + [Fact] + public void BazTest() + { + // TODO unit test for the property 'Baz' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReturnTests.cs new file mode 100644 index 000000000000..c8c1d6510d2f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReturnTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + public ReturnTests() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Return + /// + [Fact] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsType" Return + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Return' + /// + [Fact] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs new file mode 100644 index 000000000000..04cb9f1ab6b1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ScaleneTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ScaleneTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ScaleneTriangle + //private ScaleneTriangle instance; + + public ScaleneTriangleTests() + { + // TODO uncomment below to create an instance of ScaleneTriangle + //instance = new ScaleneTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ScaleneTriangle + /// + [Fact] + public void ScaleneTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" ScaleneTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs new file mode 100644 index 000000000000..7bd0bc86f963 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ShapeInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeInterface + //private ShapeInterface instance; + + public ShapeInterfaceTests() + { + // TODO uncomment below to create an instance of ShapeInterface + //instance = new ShapeInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeInterface + /// + [Fact] + public void ShapeInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs new file mode 100644 index 000000000000..d0af114157c9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ShapeOrNull + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeOrNullTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeOrNull + //private ShapeOrNull instance; + + public ShapeOrNullTests() + { + // TODO uncomment below to create an instance of ShapeOrNull + //instance = new ShapeOrNull(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeOrNull + /// + [Fact] + public void ShapeOrNullInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeOrNull + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeTests.cs new file mode 100644 index 000000000000..b01bd531f857 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Shape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Shape + //private Shape instance; + + public ShapeTests() + { + // TODO uncomment below to create an instance of Shape + //instance = new Shape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Shape + /// + [Fact] + public void ShapeInstanceTest() + { + // TODO uncomment below to test "IsType" Shape + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs new file mode 100644 index 000000000000..6648e9809281 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SimpleQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SimpleQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SimpleQuadrilateral + //private SimpleQuadrilateral instance; + + public SimpleQuadrilateralTests() + { + // TODO uncomment below to create an instance of SimpleQuadrilateral + //instance = new SimpleQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SimpleQuadrilateral + /// + [Fact] + public void SimpleQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" SimpleQuadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 000000000000..0f0e1ff12a9e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SpecialModelName + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialModelNameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SpecialModelName + //private SpecialModelName instance; + + public SpecialModelNameTests() + { + // TODO uncomment below to create an instance of SpecialModelName + //instance = new SpecialModelName(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SpecialModelName + /// + [Fact] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsType" SpecialModelName + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SpecialPropertyName' + /// + [Fact] + public void SpecialPropertyNameTest() + { + // TODO unit test for the property 'SpecialPropertyName' + } + /// + /// Test the property '_SpecialModelName' + /// + [Fact] + public void _SpecialModelNameTest() + { + // TODO unit test for the property '_SpecialModelName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TagTests.cs new file mode 100644 index 000000000000..6d56232d0a76 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Fact] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs new file mode 100644 index 000000000000..fba65470bee6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TriangleInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TriangleInterface + //private TriangleInterface instance; + + public TriangleInterfaceTests() + { + // TODO uncomment below to create an instance of TriangleInterface + //instance = new TriangleInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TriangleInterface + /// + [Fact] + public void TriangleInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" TriangleInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleTests.cs new file mode 100644 index 000000000000..bdaab0b47965 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Triangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Triangle + //private Triangle instance; + + public TriangleTests() + { + // TODO uncomment below to create an instance of Triangle + //instance = new Triangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Triangle + /// + [Fact] + public void TriangleInstanceTest() + { + // TODO uncomment below to test "IsType" Triangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/UserTests.cs new file mode 100644 index 000000000000..a7b095e4c28e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Fact] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'Phone' + /// + [Fact] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + /// + /// Test the property 'UserStatus' + /// + [Fact] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + /// + /// Test the property 'ObjectWithNoDeclaredProps' + /// + [Fact] + public void ObjectWithNoDeclaredPropsTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredProps' + } + /// + /// Test the property 'ObjectWithNoDeclaredPropsNullable' + /// + [Fact] + public void ObjectWithNoDeclaredPropsNullableTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' + } + /// + /// Test the property 'AnyTypeProp' + /// + [Fact] + public void AnyTypePropTest() + { + // TODO unit test for the property 'AnyTypeProp' + } + /// + /// Test the property 'AnyTypePropNullable' + /// + [Fact] + public void AnyTypePropNullableTest() + { + // TODO unit test for the property 'AnyTypePropNullable' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/WhaleTests.cs new file mode 100644 index 000000000000..09610791943c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Whale + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class WhaleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Whale + //private Whale instance; + + public WhaleTests() + { + // TODO uncomment below to create an instance of Whale + //instance = new Whale(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Whale + /// + [Fact] + public void WhaleInstanceTest() + { + // TODO uncomment below to test "IsType" Whale + //Assert.IsType(instance); + } + + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ZebraTests.cs new file mode 100644 index 000000000000..f44e92131400 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Zebra + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Zebra + //private Zebra instance; + + public ZebraTests() + { + // TODO uncomment below to create an instance of Zebra + //instance = new Zebra(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Zebra + /// + [Fact] + public void ZebraInstanceTest() + { + // TODO uncomment below to test "IsType" Zebra + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 000000000000..be4790511afb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,21 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net6.0 + false + annotations + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/AnotherFakeApi.cs new file mode 100644 index 000000000000..39ca9f95c47e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -0,0 +1,258 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApi : IApi + { + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ModelClient?>> + Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient> + Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient?> + Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class AnotherFakeApi : IAnotherFakeApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler? ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + + if ((modelClient as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Patch; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/another-fake/dummy")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 000000000000..171b696702d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,231 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApi : IApi + { + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<InlineResponseDefault?>> + Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<InlineResponseDefault> + Task FooGetAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<InlineResponseDefault?> + Task FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class DefaultApi : IDefaultApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler? ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/foo"; + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/foo")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs new file mode 100644 index 000000000000..5f8f4525c9d7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs @@ -0,0 +1,2676 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApi : IApi + { + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<HealthCheckResult?>> + Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<HealthCheckResult> + Task FakeHealthGetAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<HealthCheckResult?> + Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<bool?>> + Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<bool> + Task FakeOuterBooleanSerializeAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<bool?> + Task FakeOuterBooleanSerializeOrDefaultAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<OuterComposite?>> + Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite? outerComposite = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<OuterComposite> + Task FakeOuterCompositeSerializeAsync(OuterComposite? outerComposite = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<OuterComposite?> + Task FakeOuterCompositeSerializeOrDefaultAsync(OuterComposite? outerComposite = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<decimal?>> + Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<decimal> + Task FakeOuterNumberSerializeAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<decimal?> + Task FakeOuterNumberSerializeOrDefaultAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<string?>> + Task> FakeOuterStringSerializeWithHttpInfoAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<string> + Task FakeOuterStringSerializeAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<string?> + Task FakeOuterStringSerializeOrDefaultAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<OuterEnum>?>> + Task?>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<OuterEnum>> + Task?> GetArrayOfEnumsAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<OuterEnum>?> + Task?> GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> TestBodyWithQueryParamsWithHttpInfoAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task TestBodyWithQueryParamsOrDefaultAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ModelClient?>> + Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient> + Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient?> + Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> TestEndpointParametersWithHttpInfoAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string? _string = null, System.IO.Stream? binary = null, DateTime? date = null, DateTime? dateTime = null, string? password = null, string? callback = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestEndpointParametersAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string? _string = null, System.IO.Stream? binary = null, DateTime? date = null, DateTime? dateTime = null, string? password = null, string? callback = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task TestEndpointParametersOrDefaultAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string? _string = null, System.IO.Stream? binary = null, DateTime? date = null, DateTime? dateTime = null, string? password = null, string? callback = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> TestEnumParametersWithHttpInfoAsync(List? enumHeaderStringArray = null, string? enumHeaderString = null, List? enumQueryStringArray = null, string? enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List? enumFormStringArray = null, string? enumFormString = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestEnumParametersAsync(List? enumHeaderStringArray = null, string? enumHeaderString = null, List? enumQueryStringArray = null, string? enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List? enumFormStringArray = null, string? enumFormString = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task TestEnumParametersOrDefaultAsync(List? enumHeaderStringArray = null, string? enumHeaderString = null, List? enumQueryStringArray = null, string? enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List? enumFormStringArray = null, string? enumFormString = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> TestGroupParametersWithHttpInfoAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestGroupParametersAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task TestGroupParametersOrDefaultAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeApi : IFakeApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler? ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/health")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeOrDefaultAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + + if ((body as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/boolean")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeAsync(OuterComposite? outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeOrDefaultAsync(OuterComposite? outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite? outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + + if ((outerComposite as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(outerComposite, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/composite")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeOrDefaultAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + + if ((body as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/number")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeOrDefaultAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterStringSerializeWithHttpInfoAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + + if ((body as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/string")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task?> GetArrayOfEnumsAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?> result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task?> GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?>? result = null; + try + { + result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task?>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/array-of-enums")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse?> apiResponse = new ApiResponse?>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (fileSchemaTestClass == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + + if ((fileSchemaTestClass as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(fileSchemaTestClass, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-file-schema")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestBodyWithQueryParamsWithHttpInfoAsync(query, user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsOrDefaultAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestBodyWithQueryParamsWithHttpInfoAsync(query, user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestBodyWithQueryParamsWithHttpInfoAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (query == null) + throw new ArgumentNullException(nameof(query)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["query"] = Uri.EscapeDataString(query.ToString()!); + + uriBuilder.Query = parseQueryString.ToString(); + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-query-params")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + if ((modelClient as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Patch; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string? _string = null, System.IO.Stream? binary = null, DateTime? date = null, DateTime? dateTime = null, string? password = null, string? callback = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestEndpointParametersWithHttpInfoAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersOrDefaultAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string? _string = null, System.IO.Stream? binary = null, DateTime? date = null, DateTime? dateTime = null, string? password = null, string? callback = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestEndpointParametersWithHttpInfoAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestEndpointParametersWithHttpInfoAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string? _string = null, System.IO.Stream? binary = null, DateTime? date = null, DateTime? dateTime = null, string? password = null, string? callback = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (number == null) + throw new ArgumentNullException(nameof(number)); + + if (_double == null) + throw new ArgumentNullException(nameof(_double)); + + if (patternWithoutDelimiter == null) + throw new ArgumentNullException(nameof(patternWithoutDelimiter)); + + if (_byte == null) + throw new ArgumentNullException(nameof(_byte)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (integer != null) + formParams.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer))); + + if (int32 != null) + formParams.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32))); + + if (int64 != null) + formParams.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64))); + + formParams.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + + if (_float != null) + formParams.Add(new KeyValuePair("float", ClientUtils.ParameterToString(_float))); + + formParams.Add(new KeyValuePair("double", ClientUtils.ParameterToString(_double))); + + if (_string != null) + formParams.Add(new KeyValuePair("string", ClientUtils.ParameterToString(_string))); + + formParams.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + + formParams.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(_byte))); + + if (binary != null) + multipartContent.Add(new StreamContent(binary)); + + if (date != null) + formParams.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date))); + + if (dateTime != null) + formParams.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime))); + + if (password != null) + formParams.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password))); + + if (callback != null) + formParams.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback))); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(basicToken); + + basicToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersAsync(List? enumHeaderStringArray = null, string? enumHeaderString = null, List? enumQueryStringArray = null, string? enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List? enumFormStringArray = null, string? enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersOrDefaultAsync(List? enumHeaderStringArray = null, string? enumHeaderString = null, List? enumQueryStringArray = null, string? enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List? enumFormStringArray = null, string? enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestEnumParametersWithHttpInfoAsync(List? enumHeaderStringArray = null, string? enumHeaderString = null, List? enumQueryStringArray = null, string? enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List? enumFormStringArray = null, string? enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + if (enumQueryStringArray != null) + parseQueryString["enum_query_string_array"] = Uri.EscapeDataString(enumQueryStringArray.ToString()!); + + if (enumQueryString != null) + parseQueryString["enum_query_string"] = Uri.EscapeDataString(enumQueryString.ToString()!); + + if (enumQueryInteger != null) + parseQueryString["enum_query_integer"] = Uri.EscapeDataString(enumQueryInteger.ToString()!); + + if (enumQueryDouble != null) + parseQueryString["enum_query_double"] = Uri.EscapeDataString(enumQueryDouble.ToString()!); + + uriBuilder.Query = parseQueryString.ToString(); + + if (enumHeaderStringArray != null) + request.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray)); + + if (enumHeaderString != null) + request.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString)); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (enumFormStringArray != null) + formParams.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray))); + + if (enumFormString != null) + formParams.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString))); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestGroupParametersWithHttpInfoAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersOrDefaultAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestGroupParametersWithHttpInfoAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestGroupParametersWithHttpInfoAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (requiredStringGroup == null) + throw new ArgumentNullException(nameof(requiredStringGroup)); + + if (requiredBooleanGroup == null) + throw new ArgumentNullException(nameof(requiredBooleanGroup)); + + if (requiredInt64Group == null) + throw new ArgumentNullException(nameof(requiredInt64Group)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["required_string_group"] = Uri.EscapeDataString(requiredStringGroup.ToString()!); + parseQueryString["required_int64_group"] = Uri.EscapeDataString(requiredInt64Group.ToString()!); + + if (stringGroup != null) + parseQueryString["string_group"] = Uri.EscapeDataString(stringGroup.ToString()!); + + if (int64Group != null) + parseQueryString["int64_group"] = Uri.EscapeDataString(int64Group.ToString()!); + + uriBuilder.Query = parseQueryString.ToString(); + + request.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + + if (booleanGroup != null) + request.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(bearerToken); + + bearerToken.UseInHeader(request, ""); + + request.Method = HttpMethod.Delete; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + + if ((requestBody as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestBody, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/inline-additionalProperties")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (param == null) + throw new ArgumentNullException(nameof(param)); + + if (param2 == null) + throw new ArgumentNullException(nameof(param2)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + formParams.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + + formParams.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/jsonFormData")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (pipe == null) + throw new ArgumentNullException(nameof(pipe)); + + if (ioutil == null) + throw new ArgumentNullException(nameof(ioutil)); + + if (http == null) + throw new ArgumentNullException(nameof(http)); + + if (url == null) + throw new ArgumentNullException(nameof(url)); + + if (context == null) + throw new ArgumentNullException(nameof(context)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["pipe"] = Uri.EscapeDataString(pipe.ToString()!); + parseQueryString["ioutil"] = Uri.EscapeDataString(ioutil.ToString()!); + parseQueryString["http"] = Uri.EscapeDataString(http.ToString()!); + parseQueryString["url"] = Uri.EscapeDataString(url.ToString()!); + parseQueryString["context"] = Uri.EscapeDataString(context.ToString()!); + + uriBuilder.Query = parseQueryString.ToString(); + + request.RequestUri = uriBuilder.Uri; + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/test-query-parameters")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs new file mode 100644 index 000000000000..39d5c0908bbc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,273 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123Api : IApi + { + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ModelClient?>> + Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient> + Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient?> + Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler? ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + if ((modelClient as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings)); + + List tokens = new List(); + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey); + + apiKey.UseInQuery(request, uriBuilder, parseQueryString, "api_key_query"); + + uriBuilder.Query = parseQueryString.ToString(); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Patch; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake_classname_test")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs new file mode 100644 index 000000000000..f9d802892a22 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs @@ -0,0 +1,1693 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApi : IApi + { + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task AddPetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> DeletePetWithHttpInfoAsync(long petId, string? apiKey = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task DeletePetAsync(long petId, string? apiKey = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task DeletePetOrDefaultAsync(long petId, string? apiKey = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<Pet>?>> + Task?>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Pet>> + Task?> FindPetsByStatusAsync(List status, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Pet>?> + Task?> FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<Pet>?>> + Task?>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Pet>> + Task?> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Pet>?> + Task?> FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Pet?>> + Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Pet> + Task GetPetByIdAsync(long petId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Pet?> + Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string? name = null, string? status = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task UpdatePetWithFormAsync(long petId, string? name = null, string? status = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task UpdatePetWithFormOrDefaultAsync(long petId, string? name = null, string? status = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ApiResponse?>> + Task> UploadFileWithHttpInfoAsync(long petId, string? additionalMetadata = null, System.IO.Stream? file = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ApiResponse> + Task UploadFileAsync(long petId, string? additionalMetadata = null, System.IO.Stream? file = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ApiResponse?> + Task UploadFileOrDefaultAsync(long petId, string? additionalMetadata = null, System.IO.Stream? file = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ApiResponse?>> + Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ApiResponse> + Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ApiResponse?> + Task UploadFileWithRequiredFileOrDefaultAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PetApi : IPetApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler? ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet"; + + if ((pet as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetAsync(long petId, string? apiKey = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetOrDefaultAsync(long petId, string? apiKey = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> DeletePetWithHttpInfoAsync(long petId, string? apiKey = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (petId == null) + throw new ArgumentNullException(nameof(petId)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + if (apiKey != null) + request.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + request.Method = HttpMethod.Delete; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task?> FindPetsByStatusAsync(List status, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?> result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task?> FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?>? result = null; + try + { + result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task?>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (status == null) + throw new ArgumentNullException(nameof(status)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["status"] = Uri.EscapeDataString(status.ToString()!); + + uriBuilder.Query = parseQueryString.ToString(); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByStatus")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse?> apiResponse = new ApiResponse?>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task?> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?> result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task?> FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?>? result = null; + try + { + result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task?>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (tags == null) + throw new ArgumentNullException(nameof(tags)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["tags"] = Uri.EscapeDataString(tags.ToString()!); + + uriBuilder.Query = parseQueryString.ToString(); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByTags")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse?> apiResponse = new ApiResponse?>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (petId == null) + throw new ArgumentNullException(nameof(petId)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + List tokens = new List(); + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey); + + apiKey.UseInHeader(request, "api_key"); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet"; + + if ((pet as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormAsync(long petId, string? name = null, string? status = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormOrDefaultAsync(long petId, string? name = null, string? status = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string? name = null, string? status = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (petId == null) + throw new ArgumentNullException(nameof(petId)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (name != null) + formParams.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name))); + + if (status != null) + formParams.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status))); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileAsync(long petId, string? additionalMetadata = null, System.IO.Stream? file = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UploadFileWithHttpInfoAsync(petId, additionalMetadata, file, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileOrDefaultAsync(long petId, string? additionalMetadata = null, System.IO.Stream? file = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await UploadFileWithHttpInfoAsync(petId, additionalMetadata, file, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UploadFileWithHttpInfoAsync(long petId, string? additionalMetadata = null, System.IO.Stream? file = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (petId == null) + throw new ArgumentNullException(nameof(petId)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (additionalMetadata != null) + formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + + if (file != null) + multipartContent.Add(new StreamContent(file)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}/uploadImage")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UploadFileWithRequiredFileWithHttpInfoAsync(petId, requiredFile, additionalMetadata, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileOrDefaultAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await UploadFileWithRequiredFileWithHttpInfoAsync(petId, requiredFile, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (petId == null) + throw new ArgumentNullException(nameof(petId)); + + if (requiredFile == null) + throw new ArgumentNullException(nameof(requiredFile)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (additionalMetadata != null) + formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + + multipartContent.Add(new StreamContent(requiredFile)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/{petId}/uploadImageWithRequiredFile")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/StoreApi.cs new file mode 100644 index 000000000000..e4adfc47c8f9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/StoreApi.cs @@ -0,0 +1,692 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApi : IApi + { + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Dictionary<string, int>?>> + Task?>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Dictionary<string, int>> + Task?> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Dictionary<string, int>?> + Task?> GetInventoryOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Order?>> + Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Order> + Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Order?> + Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Order?>> + Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Order> + Task PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Order?> + Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StoreApi : IStoreApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler? ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (orderId == null) + throw new ArgumentNullException(nameof(orderId)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + request.RequestUri = uriBuilder.Uri; + + request.Method = HttpMethod.Delete; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task?> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?> result = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task?> GetInventoryOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?>? result = null; + try + { + result = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task?>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + + List tokens = new List(); + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey); + + apiKey.UseInHeader(request, "api_key"); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/inventory")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse?> apiResponse = new ApiResponse?>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (orderId == null) + throw new ArgumentNullException(nameof(orderId)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (order == null) + throw new ArgumentNullException(nameof(order)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + + if ((order as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(order, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/UserApi.cs new file mode 100644 index 000000000000..c49fd35541c1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/UserApi.cs @@ -0,0 +1,1292 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApi : IApi + { + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Created user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<User?>> + Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<User> + Task GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Get user by user name + /// + /// + /// + /// + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<User?> + Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<string?>> + Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<string> + Task LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<string?> + Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object?>> + Task> UpdateUserWithHttpInfoAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task UpdateUserAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object?> + Task UpdateUserOrDefaultAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class UserApi : IUserApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler? ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user"; + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithArray")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithList")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + request.RequestUri = uriBuilder.Uri; + + request.Method = HttpMethod.Delete; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (password == null) + throw new ArgumentNullException(nameof(password)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["username"] = Uri.EscapeDataString(username.ToString()!); + parseQueryString["password"] = Uri.EscapeDataString(password.ToString()!); + + uriBuilder.Query = parseQueryString.ToString(); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/login")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + + request.RequestUri = uriBuilder.Uri; + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/logout")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UpdateUserWithHttpInfoAsync(username, user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserOrDefaultAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse? result = null; + try + { + result = await UpdateUserWithHttpInfoAsync(username, user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UpdateUserWithHttpInfoAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 000000000000..067639ab9ff2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,52 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string? ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the reponse + /// + /// + /// + /// + public ApiException(string? reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiKeyToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiKeyToken.cs new file mode 100644 index 000000000000..32793bac5ccb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiKeyToken.cs @@ -0,0 +1,59 @@ +// + +#nullable enable + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + public ApiKeyToken(string value, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the cookie. + /// + /// + /// + public virtual void UseInCookie(System.Net.Http.HttpRequestMessage request, string cookieName) + { + request.Headers.Add("Cookie", $"{ cookieName }=_raw"); + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Add(headerName, _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + /// + public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString, string parameterName) + { + parseQueryString[parameterName] = Uri.EscapeDataString(_raw).ToString()!; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 000000000000..e5da60003214 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,47 @@ +using System; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health. + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The time the request was sent. + /// + public DateTime RequestedAt { get; } + /// + /// The time the response was received. + /// + public DateTime ReceivedAt { get; } + /// + /// The HttpStatusCode received. + /// + public HttpStatusCode HttpStatus { get; } + /// + /// The path requested. + /// + public string Path { get; } + /// + /// The elapsed time from request to response. + /// + public TimeSpan ToTimeSpan => this.ReceivedAt - this.RequestedAt; + + /// + /// The event args used to track server health. + /// + /// + /// + /// + /// + public ApiResponseEventArgs(DateTime requestedAt, DateTime receivedAt, HttpStatusCode httpStatus, string path) + { + RequestedAt = requestedAt; + ReceivedAt = receivedAt; + HttpStatus = httpStatus; + Path = path; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 000000000000..29d184dddaec --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,104 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Net; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + #region Properties + + /// + /// The deserialized content + /// + public T? Content { get; set; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The raw data + /// + public string RawContent { get; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string? ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + #endregion Properties + + /// + /// Construct the reponse using an HttpResponseMessage + /// + /// + /// + public ApiResponse(System.Net.Http.HttpResponseMessage response, string rawContent) + { + StatusCode = response.StatusCode; + Headers = response.Headers; + IsSuccessStatusCode = response.IsSuccessStatusCode; + ReasonPhrase = response.ReasonPhrase; + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/BasicToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/BasicToken.cs new file mode 100644 index 000000000000..6bcdbe9cc502 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/BasicToken.cs @@ -0,0 +1,44 @@ +// + +#nullable enable + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Org.OpenAPITools.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/BearerToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/BearerToken.cs new file mode 100644 index 000000000000..00f289f0b5fa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/BearerToken.cs @@ -0,0 +1,39 @@ +// + +#nullable enable + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a token from a bearer token. + /// + public class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 000000000000..4bc32f6b9831 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,366 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; +using System.Net.Http; +using Org.OpenAPITools.Api; +using KellermanSoftware.CompareNetObjects; + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + compareLogic = new CompareLogic(); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Custom JSON serializer + /// + public static Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get; set; } = new Newtonsoft.Json.JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = Newtonsoft.Json.ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore, + ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver + { + NamingStrategy = new Newtonsoft.Json.Serialization.CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string? ParameterToString(object obj, string? format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is System.Collections.ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// The base path of the API + /// + public const string BASE_ADDRESS = "http://petstore.swagger.io:80/v2"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v2"; + + /// + /// The host of the API + /// + public const string HOST = "petstore.swagger.io"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, config); + + AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + private static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circiut breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 000000000000..7b8ea652b167 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action? client = null, Action? builder = null) + where TAnotherFakeApi : class, IAnotherFakeApi + where TDefaultApi : class, IDefaultApi + where TFakeApi : class, IFakeApi + where TFakeClassnameTags123Api : class, IFakeClassnameTags123Api + where TPetApi : class, IPetApi + where TStoreApi : class, IStoreApi + where TUserApi : class, IUserApi + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients( + Action? client = null, Action? builder = null) + { + AddApiHttpClients(client, builder); + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(Client.ClientUtils.JsonSerializerSettings); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs new file mode 100644 index 000000000000..0c4101dd74a2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -0,0 +1,684 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace Org.OpenAPITools.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + #region + /// + /// Create an instance + /// + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString? keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + { + KeyId = keyId; + KeyFilePath = keyFilePath; + KeyPassPhrase = keyPassPhrase; + HttpSigningHeader = httpSigningHeader; + HashAlgorithm = hashAlgorithm; + SigningAlgorithm = signingAlgorithm; + SignatureValidityPeriod = signatureValidityPeriod; + } + #endregion + + #region Properties + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString? KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } = HashAlgorithmName.SHA256; + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validaty period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + #endregion + + #region enum + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + #endregion + + #region Methods + /// + /// Gets the Headers for HttpSigning + /// + /// + /// + /// + internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + if (request.RequestUri == null) + throw new NullReferenceException("The request URI was null"); + + const string HEADER_REQUEST_TARGET = "(request-target)"; + + // The time when the HTTP signature expires. The API server should reject HTTP requests that have expired. + const string HEADER_EXPIRES = "(expires)"; + + //The 'Date' header. + const string HEADER_DATE = "Date"; + + //The 'Host' header. + const string HEADER_HOST = "Host"; + + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + + var httpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + HttpSigningHeader.Add("(created)"); + + var dateTime = DateTime.Now; + string digest = String.Empty; + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + + foreach (var header in HttpSigningHeader) + if (header.Equals(HEADER_REQUEST_TARGET)) + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + httpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + HttpSignedRequestHeader.Add(HEADER_HOST, request.RequestUri.ToString()); + } + else if (header.Equals(HEADER_CREATED)) + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, digest); + httpSignatureHeader.Add(header.ToLower(), digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in request.Headers) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + httpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + + if (!isHeaderFound) + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + + var headersKeysString = String.Join(" ", httpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in httpSignatureHeader) + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + //Concatinate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + string? headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + headerSignatureStr = GetRSASignature(signatureStringHash); + + else if (keyType == PrivateKeyType.ECDSA) + headerSignatureStr = GetECDSASignature(signatureStringHash); + + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (httpSignatureHeader.ContainsKey(HEADER_CREATED)) + authorizationHeaderValue += string.Format(",created={0}", httpSignatureHeader[HEADER_CREATED]); + + if (httpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + authorizationHeaderValue += string.Format(",expires={0}", httpSignatureHeader[HEADER_EXPIRES]); + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(string hashName, string stringToBeHashed) + { + var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + var stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (KeyPassPhrase == null) + throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); + + RSA? rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + + if (rsa == null) + return string.Empty; + else if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + if (!File.Exists(KeyFilePath)) + { + throw new Exception("key file path does not exist."); + } + + var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + var keyStr = File.ReadAllText(KeyFilePath); + var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); + var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); + var ecdsa = ECDsa.Create(); + +#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) + var byteCount = 0; + if (KeyPassPhrase != null) + { + IntPtr unmanagedString = IntPtr.Zero; + try + { + // convert secure string to byte array + unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(KeyPassPhrase); + + string ptrToStringUni = Marshal.PtrToStringUni(unmanagedString) ?? throw new NullReferenceException(); + + ecdsa.ImportEncryptedPkcs8PrivateKey(Encoding.UTF8.GetBytes(ptrToStringUni), keyBytes, out byteCount); + } + finally + { + if (unmanagedString != IntPtr.Zero) + Marshal.ZeroFreeBSTR(unmanagedString); + } + } + else + { + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); + } + var signedBytes = ecdsa.SignHash(dataToSign); + var derBytes = ConvertToECDSAANS1Format(signedBytes); + var signedString = System.Convert.ToBase64String(derBytes); + + return signedString; +#else + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); +#endif + + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + rBytes.Add(signedBytes[i]); + + for (int i = 32; i < 64; i++) + sBytes.Add(signedBytes[i]); + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r lenth, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider? GetRSAProviderFromPemFile(String pemfile, SecureString? keyPassPharse = null) + { + const String pempubheader = "-----BEGIN PUBLIC KEY-----"; + const String pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[]? pemkey = null; + + if (!File.Exists(pemfile)) + throw new Exception("private key file does not exist."); + + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + isPrivateKeyFile = false; + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse); + + if (pemkey == null) + return null; + + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[]? ConvertPrivateKeyToBytes(String instr, SecureString? keyPassPharse = null) + { + const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; + String pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + return null; + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + String pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine()!.StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + return null; + + String saltline = str.ReadLine()!; // TODO: what do we do here if ReadLine is null? + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + return null; + + String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + + if (!(str.ReadLine() == "")) + return null; + + //------ remaining b64 data is encrypted RSA key ---- + String encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 fromat + return null; + } + + // TODO: what do we do here if keyPassPharse is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPharse!, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + return null; + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[]? rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + + return rsakey; + } + } + + private RSACryptoServiceProvider? DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + binr.ReadByte(); //advance 1 byte + else if (twobytes == 0x8230) + binr.ReadInt16(); //advance 2 bytes + else + return null; + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + return null; + + bt = binr.ReadByte(); + if (bt != 0x00) + return null; + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + return 0; + + bt = binr.ReadByte(); + + if (bt == 0x81) + count = binr.ReadByte(); // data size in next byte + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + count = bt; // we already have the data size + + while (binr.ReadByte() == 0x00) + //remove high order zeros in data + count -= 1; + + binr.BaseStream.Seek(-1, SeekOrigin.Current); + + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = new MD5CryptoServiceProvider(); + byte[]? result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + result = data00; //initialize + else + { + Array.Copy(result!, hashtarget, result!.Length); // TODO: what do we do if result is null here? + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result!, 0, result!.Length); // TODO: what do we do if result is null here? + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[]? DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + throw new Exception("Key file path does not exist."); + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + keyType = PrivateKeyType.RSA; + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + keyType = PrivateKeyType.ECDSA; + + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + throw new Exception("Either the key is invalid or key is not supported"); + + return keyType; + } + #endregion + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HttpSigningToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HttpSigningToken.cs new file mode 100644 index 000000000000..e7a8d2d51be2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HttpSigningToken.cs @@ -0,0 +1,43 @@ +// + +#nullable enable + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an HttpSigningConfiguration + /// + public class HttpSignatureToken : TokenBase + { + private HttpSigningConfiguration _configuration; + + /// + /// Constructs an HttpSignatureToken object. + /// + /// + /// + public HttpSignatureToken(HttpSigningConfiguration configuration, TimeSpan? timeout = null) : base(timeout) + { + _configuration = configuration; + } + + /// + /// Places the token in the header. + /// + /// + /// + /// + public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken? cancellationToken = null) + { + var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); + + foreach (var signedHeader in signedHeaders) + request.Headers.Add(signedHeader.Key, signedHeader.Value); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/IApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/IApi.cs new file mode 100644 index 000000000000..53c5a858ffa5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/IApi.cs @@ -0,0 +1,21 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Client +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + event ClientUtils.EventHandler? ApiResponded; + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/OAuthToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/OAuthToken.cs new file mode 100644 index 000000000000..38c744ac2a1c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/OAuthToken.cs @@ -0,0 +1,39 @@ +// + +#nullable enable + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed with OAuth. + /// + public class OAuthToken : TokenBase + { + private string _raw; + + /// + /// Consturcts an OAuthToken object. + /// + /// + /// + public OAuthToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs new file mode 100644 index 000000000000..a5253e582013 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 000000000000..3056e7cc89f3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,49 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Channel AvailableTokens { get; } + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens = Channel.CreateBounded(options); + + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => AvailableTokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null) + => await AvailableTokens.Reader.ReadAsync(cancellation.GetValueOrDefault()).ConfigureAwait(false); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 000000000000..0faa2977dcf0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,71 @@ +// + +#nullable enable + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler? TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 000000000000..3fba287ad9d3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,37 @@ +// + +#nullable enable + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 000000000000..0d7217682272 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,44 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs new file mode 100644 index 000000000000..b3fc4c3c7a3a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Org.OpenAPITools.Model +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs new file mode 100644 index 000000000000..b3ddad35a07d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,224 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesClass + /// + [DataContract(Name = "AdditionalPropertiesClass")] + public partial class AdditionalPropertiesClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mapProperty. + /// mapOfMapProperty. + /// anytype1. + /// mapWithUndeclaredPropertiesAnytype1. + /// mapWithUndeclaredPropertiesAnytype2. + /// mapWithUndeclaredPropertiesAnytype3. + /// an object with no declared properties and no undeclared properties, hence it's an empty map.. + /// mapWithUndeclaredPropertiesString. + public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>), Object anytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype2 = default(Object), Dictionary mapWithUndeclaredPropertiesAnytype3 = default(Dictionary), Object emptyMap = default(Object), Dictionary mapWithUndeclaredPropertiesString = default(Dictionary)) + { + this.MapProperty = mapProperty; + this.MapOfMapProperty = mapOfMapProperty; + this.Anytype1 = anytype1; + this.MapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + this.MapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + this.MapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + this.EmptyMap = emptyMap; + this.MapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name = "map_property", EmitDefaultValue = false)] + public Dictionary MapProperty { get; set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name = "map_of_map_property", EmitDefaultValue = false)] + public Dictionary> MapOfMapProperty { get; set; } + + /// + /// Gets or Sets Anytype1 + /// + [DataMember(Name = "anytype_1", EmitDefaultValue = true)] + public Object Anytype1 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype1 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_1", EmitDefaultValue = false)] + public Object MapWithUndeclaredPropertiesAnytype1 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype2 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_2", EmitDefaultValue = false)] + public Object MapWithUndeclaredPropertiesAnytype2 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype3 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_3", EmitDefaultValue = false)] + public Dictionary MapWithUndeclaredPropertiesAnytype3 { get; set; } + + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + [DataMember(Name = "empty_map", EmitDefaultValue = false)] + public Object EmptyMap { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesString + /// + [DataMember(Name = "map_with_undeclared_properties_string", EmitDefaultValue = false)] + public Dictionary MapWithUndeclaredPropertiesString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype1: ").Append(MapWithUndeclaredPropertiesAnytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype2: ").Append(MapWithUndeclaredPropertiesAnytype2).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype3: ").Append(MapWithUndeclaredPropertiesAnytype3).Append("\n"); + sb.Append(" EmptyMap: ").Append(EmptyMap).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesString: ").Append(MapWithUndeclaredPropertiesString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as AdditionalPropertiesClass).AreEqual; + } + + /// + /// Returns true if AdditionalPropertiesClass instances are equal + /// + /// Instance of AdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(AdditionalPropertiesClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapProperty != null) + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } + if (this.MapOfMapProperty != null) + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } + if (this.Anytype1 != null) + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype1 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype2 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype3 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } + if (this.EmptyMap != null) + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesString != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs new file mode 100644 index 000000000000..834d0665bd81 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs @@ -0,0 +1,167 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Animal + /// + [DataContract(Name = "Animal")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] + public partial class Animal : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Animal() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + /// color (default to "red"). + public Animal(string className = default(string), string color = "red") + { + this.ClassName = className; + this.Color = color; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name = "color", EmitDefaultValue = false)] + public string Color { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Animal).AreEqual; + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.Color != null) + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs new file mode 100644 index 000000000000..79873f4ddfed --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -0,0 +1,155 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ApiResponse + /// + [DataContract(Name = "ApiResponse")] + public partial class ApiResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// type. + /// message. + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) + { + this.Code = code; + this.Type = type; + this.Message = message; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name = "code", EmitDefaultValue = false)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ApiResponse).AreEqual; + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Code.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 000000000000..8b1f87d1aa9a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,159 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Apple + /// + [DataContract(Name = "apple")] + public partial class Apple : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// cultivar. + /// origin. + public Apple(string cultivar = default(string), string origin = default(string)) + { + this.Cultivar = cultivar; + this.Origin = origin; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Cultivar + /// + [DataMember(Name = "cultivar", EmitDefaultValue = false)] + public string Cultivar { get; set; } + + /// + /// Gets or Sets Origin + /// + [DataMember(Name = "origin", EmitDefaultValue = false)] + public string Origin { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Apple {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Origin: ").Append(Origin).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Apple).AreEqual; + } + + /// + /// Returns true if Apple instances are equal + /// + /// Instance of Apple to be compared + /// Boolean + public bool Equals(Apple input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cultivar != null) + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + if (this.Origin != null) + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // Cultivar (string) pattern + Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + if (false == regexCultivar.Match(this.Cultivar).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); + } + + // Origin (string) pattern + Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexOrigin.Match(this.Origin).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); + } + + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs new file mode 100644 index 000000000000..798d6d457dfe --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs @@ -0,0 +1,135 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// AppleReq + /// + [DataContract(Name = "appleReq")] + public partial class AppleReq : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AppleReq() { } + /// + /// Initializes a new instance of the class. + /// + /// cultivar (required). + /// mealy. + public AppleReq(string cultivar = default(string), bool mealy = default(bool)) + { + this.Cultivar = cultivar; + this.Mealy = mealy; + } + + /// + /// Gets or Sets Cultivar + /// + [DataMember(Name = "cultivar", IsRequired = true, EmitDefaultValue = false)] + public string Cultivar { get; set; } + + /// + /// Gets or Sets Mealy + /// + [DataMember(Name = "mealy", EmitDefaultValue = true)] + public bool Mealy { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppleReq {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Mealy: ").Append(Mealy).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as AppleReq).AreEqual; + } + + /// + /// Returns true if AppleReq instances are equal + /// + /// Instance of AppleReq to be compared + /// Boolean + public bool Equals(AppleReq input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cultivar != null) + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 000000000000..30bf57ef0f52 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + [DataContract(Name = "ArrayOfArrayOfNumberOnly")] + public partial class ArrayOfArrayOfNumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber. + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + { + this.ArrayArrayNumber = arrayArrayNumber; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [DataMember(Name = "ArrayArrayNumber", EmitDefaultValue = false)] + public List> ArrayArrayNumber { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfArrayOfNumberOnly).AreEqual; + } + + /// + /// Returns true if ArrayOfArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfArrayOfNumberOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayArrayNumber != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs new file mode 100644 index 000000000000..8a215aad133b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayOfNumberOnly + /// + [DataContract(Name = "ArrayOfNumberOnly")] + public partial class ArrayOfNumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber. + public ArrayOfNumberOnly(List arrayNumber = default(List)) + { + this.ArrayNumber = arrayNumber; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ArrayNumber + /// + [DataMember(Name = "ArrayNumber", EmitDefaultValue = false)] + public List ArrayNumber { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfNumberOnly).AreEqual; + } + + /// + /// Returns true if ArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfNumberOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayNumber != null) + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs new file mode 100644 index 000000000000..1a879a1d9ca2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayTest + /// + [DataContract(Name = "ArrayTest")] + public partial class ArrayTest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayOfString. + /// arrayArrayOfInteger. + /// arrayArrayOfModel. + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + { + this.ArrayOfString = arrayOfString; + this.ArrayArrayOfInteger = arrayArrayOfInteger; + this.ArrayArrayOfModel = arrayArrayOfModel; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name = "array_of_string", EmitDefaultValue = false)] + public List ArrayOfString { get; set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name = "array_array_of_integer", EmitDefaultValue = false)] + public List> ArrayArrayOfInteger { get; set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name = "array_array_of_model", EmitDefaultValue = false)] + public List> ArrayArrayOfModel { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayTest).AreEqual; + } + + /// + /// Returns true if ArrayTest instances are equal + /// + /// Instance of ArrayTest to be compared + /// Boolean + public bool Equals(ArrayTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayOfString != null) + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } + if (this.ArrayArrayOfInteger != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } + if (this.ArrayArrayOfModel != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 000000000000..97939597ede8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Banana + /// + [DataContract(Name = "banana")] + public partial class Banana : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm. + public Banana(decimal lengthCm = default(decimal)) + { + this.LengthCm = lengthCm; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets LengthCm + /// + [DataMember(Name = "lengthCm", EmitDefaultValue = false)] + public decimal LengthCm { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Banana {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Banana).AreEqual; + } + + /// + /// Returns true if Banana instances are equal + /// + /// Instance of Banana to be compared + /// Boolean + public bool Equals(Banana input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs new file mode 100644 index 000000000000..fdd36929d13c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BananaReq + /// + [DataContract(Name = "bananaReq")] + public partial class BananaReq : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BananaReq() { } + /// + /// Initializes a new instance of the class. + /// + /// lengthCm (required). + /// sweet. + public BananaReq(decimal lengthCm = default(decimal), bool sweet = default(bool)) + { + this.LengthCm = lengthCm; + this.Sweet = sweet; + } + + /// + /// Gets or Sets LengthCm + /// + [DataMember(Name = "lengthCm", IsRequired = true, EmitDefaultValue = false)] + public decimal LengthCm { get; set; } + + /// + /// Gets or Sets Sweet + /// + [DataMember(Name = "sweet", EmitDefaultValue = true)] + public bool Sweet { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BananaReq {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" Sweet: ").Append(Sweet).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BananaReq).AreEqual; + } + + /// + /// Returns true if BananaReq instances are equal + /// + /// Instance of BananaReq to be compared + /// Boolean + public bool Equals(BananaReq input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs new file mode 100644 index 000000000000..82062513ba1e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BasquePig + /// + [DataContract(Name = "BasquePig")] + public partial class BasquePig : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BasquePig() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + public BasquePig(string className = default(string)) + { + this.ClassName = className; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BasquePig {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BasquePig).AreEqual; + } + + /// + /// Returns true if BasquePig instances are equal + /// + /// Instance of BasquePig to be compared + /// Boolean + public bool Equals(BasquePig input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs new file mode 100644 index 000000000000..be68a50a116a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs @@ -0,0 +1,198 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Capitalization + /// + [DataContract(Name = "Capitalization")] + public partial class Capitalization : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// smallCamel. + /// capitalCamel. + /// smallSnake. + /// capitalSnake. + /// sCAETHFlowPoints. + /// Name of the pet . + public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + { + this.SmallCamel = smallCamel; + this.CapitalCamel = capitalCamel; + this.SmallSnake = smallSnake; + this.CapitalSnake = capitalSnake; + this.SCAETHFlowPoints = sCAETHFlowPoints; + this.ATT_NAME = aTTNAME; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SmallCamel + /// + [DataMember(Name = "smallCamel", EmitDefaultValue = false)] + public string SmallCamel { get; set; } + + /// + /// Gets or Sets CapitalCamel + /// + [DataMember(Name = "CapitalCamel", EmitDefaultValue = false)] + public string CapitalCamel { get; set; } + + /// + /// Gets or Sets SmallSnake + /// + [DataMember(Name = "small_Snake", EmitDefaultValue = false)] + public string SmallSnake { get; set; } + + /// + /// Gets or Sets CapitalSnake + /// + [DataMember(Name = "Capital_Snake", EmitDefaultValue = false)] + public string CapitalSnake { get; set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [DataMember(Name = "SCA_ETH_Flow_Points", EmitDefaultValue = false)] + public string SCAETHFlowPoints { get; set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [DataMember(Name = "ATT_NAME", EmitDefaultValue = false)] + public string ATT_NAME { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Capitalization {\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Capitalization).AreEqual; + } + + /// + /// Returns true if Capitalization instances are equal + /// + /// Instance of Capitalization to be compared + /// Boolean + public bool Equals(Capitalization input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SmallCamel != null) + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } + if (this.CapitalCamel != null) + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } + if (this.SmallSnake != null) + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } + if (this.CapitalSnake != null) + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } + if (this.SCAETHFlowPoints != null) + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } + if (this.ATT_NAME != null) + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs new file mode 100644 index 000000000000..2bc55707da95 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Cat + /// + [DataContract(Name = "Cat")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + public partial class Cat : Animal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Cat() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// declawed. + /// className (required) (default to "Cat"). + /// color (default to "red"). + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + { + this.Declawed = declawed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name = "declawed", EmitDefaultValue = true)] + public bool Declawed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Cat).AreEqual; + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs new file mode 100644 index 000000000000..3a960e9925e3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// CatAllOf + /// + [DataContract(Name = "Cat_allOf")] + public partial class CatAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public CatAllOf(bool declawed = default(bool)) + { + this.Declawed = declawed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name = "declawed", EmitDefaultValue = true)] + public bool Declawed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as CatAllOf).AreEqual; + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs new file mode 100644 index 000000000000..391fc2b11467 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Category + /// + [DataContract(Name = "Category")] + public partial class Category : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Category() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name (required) (default to "default-name"). + public Category(long id = default(long), string name = "default-name") + { + this.Name = name; + this.Id = id; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Category).AreEqual; + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCat.cs new file mode 100644 index 000000000000..7a15a5297df2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCat.cs @@ -0,0 +1,181 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ChildCat + /// + [DataContract(Name = "ChildCat")] + [JsonConverter(typeof(JsonSubtypes), "PetType")] + public partial class ChildCat : ParentPet, IEquatable, IValidatableObject + { + /// + /// Defines PetType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + [EnumMember(Value = "ChildCat")] + ChildCat = 1 + + } + + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)] + public PetTypeEnum PetType { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ChildCat() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// name. + /// petType (required) (default to PetTypeEnum.ChildCat). + public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base() + { + this.PetType = petType; + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ChildCat).AreEqual; + } + + /// + /// Returns true if ChildCat instances are equal + /// + /// Instance of ChildCat to be compared + /// Boolean + public bool Equals(ChildCat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs new file mode 100644 index 000000000000..a353ad7ffd71 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ChildCatAllOf + /// + [DataContract(Name = "ChildCat_allOf")] + public partial class ChildCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines PetType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + [EnumMember(Value = "ChildCat")] + ChildCat = 1 + + } + + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", EmitDefaultValue = false)] + public PetTypeEnum? PetType { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// name. + /// petType (default to PetTypeEnum.ChildCat). + public ChildCatAllOf(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) + { + this.Name = name; + this.PetType = petType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCatAllOf {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ChildCatAllOf).AreEqual; + } + + /// + /// Returns true if ChildCatAllOf instances are equal + /// + /// Instance of ChildCatAllOf to be compared + /// Boolean + public bool Equals(ChildCatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs new file mode 100644 index 000000000000..7177e9bf0b6c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model with \"_class\" property + /// + [DataContract(Name = "ClassModel")] + public partial class ClassModel : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _class. + public ClassModel(string _class = default(string)) + { + this.Class = _class; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Class + /// + [DataMember(Name = "_class", EmitDefaultValue = false)] + public string Class { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ClassModel {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ClassModel).AreEqual; + } + + /// + /// Returns true if ClassModel instances are equal + /// + /// Instance of ClassModel to be compared + /// Boolean + public bool Equals(ClassModel input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Class != null) + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs new file mode 100644 index 000000000000..3d53cf265245 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -0,0 +1,153 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ComplexQuadrilateral + /// + [DataContract(Name = "ComplexQuadrilateral")] + public partial class ComplexQuadrilateral : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ComplexQuadrilateral() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// quadrilateralType (required). + public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + { + this.ShapeType = shapeType; + this.QuadrilateralType = quadrilateralType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ComplexQuadrilateral {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ComplexQuadrilateral).AreEqual; + } + + /// + /// Returns true if ComplexQuadrilateral instances are equal + /// + /// Instance of ComplexQuadrilateral to be compared + /// Boolean + public bool Equals(ComplexQuadrilateral input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs new file mode 100644 index 000000000000..bf13c6794819 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DanishPig + /// + [DataContract(Name = "DanishPig")] + public partial class DanishPig : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DanishPig() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + public DanishPig(string className = default(string)) + { + this.ClassName = className; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DanishPig {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DanishPig).AreEqual; + } + + /// + /// Returns true if DanishPig instances are equal + /// + /// Instance of DanishPig to be compared + /// Boolean + public bool Equals(DanishPig input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs new file mode 100644 index 000000000000..1928b236bf66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DeprecatedObject + /// + [DataContract(Name = "DeprecatedObject")] + public partial class DeprecatedObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public DeprecatedObject(string name = default(string)) + { + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DeprecatedObject {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DeprecatedObject).AreEqual; + } + + /// + /// Returns true if DeprecatedObject instances are equal + /// + /// Instance of DeprecatedObject to be compared + /// Boolean + public bool Equals(DeprecatedObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs new file mode 100644 index 000000000000..9cd520deaf82 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs @@ -0,0 +1,159 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Dog + /// + [DataContract(Name = "Dog")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + public partial class Dog : Animal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Dog() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// breed. + /// className (required) (default to "Dog"). + /// color (default to "red"). + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + { + this.Breed = breed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name = "breed", EmitDefaultValue = false)] + public string Breed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Dog).AreEqual; + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Breed != null) + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs new file mode 100644 index 000000000000..7b026acbf1e5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DogAllOf + /// + [DataContract(Name = "Dog_allOf")] + public partial class DogAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed. + public DogAllOf(string breed = default(string)) + { + this.Breed = breed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name = "breed", EmitDefaultValue = false)] + public string Breed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DogAllOf).AreEqual; + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Breed != null) + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs new file mode 100644 index 000000000000..d8cd2a70ef61 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Drawing + /// + [DataContract(Name = "Drawing")] + public partial class Drawing : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mainShape. + /// shapeOrNull. + /// nullableShape. + /// shapes. + public Drawing(Shape mainShape = default(Shape), ShapeOrNull shapeOrNull = default(ShapeOrNull), NullableShape nullableShape = default(NullableShape), List shapes = default(List)) : base() + { + this.MainShape = mainShape; + this.ShapeOrNull = shapeOrNull; + this.NullableShape = nullableShape; + this.Shapes = shapes; + } + + /// + /// Gets or Sets MainShape + /// + [DataMember(Name = "mainShape", EmitDefaultValue = false)] + public Shape MainShape { get; set; } + + /// + /// Gets or Sets ShapeOrNull + /// + [DataMember(Name = "shapeOrNull", EmitDefaultValue = false)] + public ShapeOrNull ShapeOrNull { get; set; } + + /// + /// Gets or Sets NullableShape + /// + [DataMember(Name = "nullableShape", EmitDefaultValue = true)] + public NullableShape NullableShape { get; set; } + + /// + /// Gets or Sets Shapes + /// + [DataMember(Name = "shapes", EmitDefaultValue = false)] + public List Shapes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Drawing {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" MainShape: ").Append(MainShape).Append("\n"); + sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n"); + sb.Append(" NullableShape: ").Append(NullableShape).Append("\n"); + sb.Append(" Shapes: ").Append(Shapes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Drawing).AreEqual; + } + + /// + /// Returns true if Drawing instances are equal + /// + /// Instance of Drawing to be compared + /// Boolean + public bool Equals(Drawing input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.MainShape != null) + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } + if (this.ShapeOrNull != null) + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } + if (this.NullableShape != null) + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } + if (this.Shapes != null) + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs new file mode 100644 index 000000000000..6d7830c0e8ba --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -0,0 +1,180 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// EnumArrays + /// + [DataContract(Name = "EnumArrays")] + public partial class EnumArrays : IEquatable, IValidatableObject + { + /// + /// Defines JustSymbol + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum JustSymbolEnum + { + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + [EnumMember(Value = ">=")] + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + [EnumMember(Value = "$")] + Dollar = 2 + + } + + + /// + /// Gets or Sets JustSymbol + /// + [DataMember(Name = "just_symbol", EmitDefaultValue = false)] + public JustSymbolEnum? JustSymbol { get; set; } + /// + /// Defines ArrayEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ArrayEnumEnum + { + /// + /// Enum Fish for value: fish + /// + [EnumMember(Value = "fish")] + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + [EnumMember(Value = "crab")] + Crab = 2 + + } + + + + /// + /// Gets or Sets ArrayEnum + /// + [DataMember(Name = "array_enum", EmitDefaultValue = false)] + public List ArrayEnum { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// justSymbol. + /// arrayEnum. + public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + { + this.JustSymbol = justSymbol; + this.ArrayEnum = arrayEnum; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnumArrays {\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumArrays).AreEqual; + } + + /// + /// Returns true if EnumArrays instances are equal + /// + /// Instance of EnumArrays to be compared + /// Boolean + public bool Equals(EnumArrays input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumClass.cs new file mode 100644 index 000000000000..48b3d7d0e7e0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumClass.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines EnumClass + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumClass + { + /// + /// Enum Abc for value: _abc + /// + [EnumMember(Value = "_abc")] + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + [EnumMember(Value = "-efg")] + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + [EnumMember(Value = "(xyz)")] + Xyz = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs new file mode 100644 index 000000000000..6f3d2272c5c3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs @@ -0,0 +1,323 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// EnumTest + /// + [DataContract(Name = "Enum_Test")] + public partial class EnumTest : IEquatable, IValidatableObject + { + /// + /// Defines EnumString + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + + } + + + /// + /// Gets or Sets EnumString + /// + [DataMember(Name = "enum_string", EmitDefaultValue = false)] + public EnumStringEnum? EnumString { get; set; } + /// + /// Defines EnumStringRequired + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringRequiredEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + + } + + + /// + /// Gets or Sets EnumStringRequired + /// + [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } + /// + /// Defines EnumInteger + /// + public enum EnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + + } + + + /// + /// Gets or Sets EnumInteger + /// + [DataMember(Name = "enum_integer", EmitDefaultValue = false)] + public EnumIntegerEnum? EnumInteger { get; set; } + /// + /// Defines EnumIntegerOnly + /// + public enum EnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + + } + + + /// + /// Gets or Sets EnumIntegerOnly + /// + [DataMember(Name = "enum_integer_only", EmitDefaultValue = false)] + public EnumIntegerOnlyEnum? EnumIntegerOnly { get; set; } + /// + /// Defines EnumNumber + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumNumberEnum + { + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + [EnumMember(Value = "1.1")] + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + [EnumMember(Value = "-1.2")] + NUMBER_MINUS_1_DOT_2 = 2 + + } + + + /// + /// Gets or Sets EnumNumber + /// + [DataMember(Name = "enum_number", EmitDefaultValue = false)] + public EnumNumberEnum? EnumNumber { get; set; } + + /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name = "outerEnum", EmitDefaultValue = true)] + public OuterEnum? OuterEnum { get; set; } + + /// + /// Gets or Sets OuterEnumInteger + /// + [DataMember(Name = "outerEnumInteger", EmitDefaultValue = false)] + public OuterEnumInteger? OuterEnumInteger { get; set; } + + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [DataMember(Name = "outerEnumDefaultValue", EmitDefaultValue = false)] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [DataMember(Name = "outerEnumIntegerDefaultValue", EmitDefaultValue = false)] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EnumTest() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// enumString. + /// enumStringRequired (required). + /// enumInteger. + /// enumIntegerOnly. + /// enumNumber. + /// outerEnum. + /// outerEnumInteger. + /// outerEnumDefaultValue. + /// outerEnumIntegerDefaultValue. + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumIntegerOnlyEnum? enumIntegerOnly = default(EnumIntegerOnlyEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?), OuterEnumInteger? outerEnumInteger = default(OuterEnumInteger?), OuterEnumDefaultValue? outerEnumDefaultValue = default(OuterEnumDefaultValue?), OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue?)) + { + this.EnumStringRequired = enumStringRequired; + this.EnumString = enumString; + this.EnumInteger = enumInteger; + this.EnumIntegerOnly = enumIntegerOnly; + this.EnumNumber = enumNumber; + this.OuterEnum = outerEnum; + this.OuterEnumInteger = outerEnumInteger; + this.OuterEnumDefaultValue = outerEnumDefaultValue; + this.OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnumTest {\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumTest).AreEqual; + } + + /// + /// Returns true if EnumTest instances are equal + /// + /// Instance of EnumTest to be compared + /// Boolean + public bool Equals(EnumTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs new file mode 100644 index 000000000000..b216e2f6a9ab --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -0,0 +1,153 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// EquilateralTriangle + /// + [DataContract(Name = "EquilateralTriangle")] + public partial class EquilateralTriangle : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EquilateralTriangle() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) + { + this.ShapeType = shapeType; + this.TriangleType = triangleType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EquilateralTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as EquilateralTriangle).AreEqual; + } + + /// + /// Returns true if EquilateralTriangle instances are equal + /// + /// Instance of EquilateralTriangle to be compared + /// Boolean + public bool Equals(EquilateralTriangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 000000000000..e77d15e06bce --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Must be named `File` for test. + /// + [DataContract(Name = "File")] + public partial class File : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization. + public File(string sourceURI = default(string)) + { + this.SourceURI = sourceURI; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Test capitalization + /// + /// Test capitalization + [DataMember(Name = "sourceURI", EmitDefaultValue = false)] + public string SourceURI { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as File).AreEqual; + } + + /// + /// Returns true if File instances are equal + /// + /// Instance of File to be compared + /// Boolean + public bool Equals(File input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SourceURI != null) + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 000000000000..6808978c49f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// FileSchemaTestClass + /// + [DataContract(Name = "FileSchemaTestClass")] + public partial class FileSchemaTestClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// file. + /// files. + public FileSchemaTestClass(File file = default(File), List files = default(List)) + { + this.File = file; + this.Files = files; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets File + /// + [DataMember(Name = "file", EmitDefaultValue = false)] + public File File { get; set; } + + /// + /// Gets or Sets Files + /// + [DataMember(Name = "files", EmitDefaultValue = false)] + public List Files { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as FileSchemaTestClass).AreEqual; + } + + /// + /// Returns true if FileSchemaTestClass instances are equal + /// + /// Instance of FileSchemaTestClass to be compared + /// Boolean + public bool Equals(FileSchemaTestClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.File != null) + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 000000000000..2bb0754f044e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Foo + /// + [DataContract(Name = "Foo")] + public partial class Foo : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar"). + public Foo(string bar = "bar") + { + this.Bar = bar; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Foo {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Foo).AreEqual; + } + + /// + /// Returns true if Foo instances are equal + /// + /// Instance of Foo to be compared + /// Boolean + public bool Equals(Foo input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs new file mode 100644 index 000000000000..479292b07ac8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs @@ -0,0 +1,414 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// FormatTest + /// + [DataContract(Name = "format_test")] + public partial class FormatTest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FormatTest() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// integer. + /// int32. + /// int64. + /// number (required). + /// _float. + /// _double. + /// _decimal. + /// _string. + /// _byte (required). + /// binary. + /// date (required). + /// dateTime. + /// uuid. + /// password (required). + /// A string that is a 10 digit number. Can have leading zeros.. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. + public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + { + this.Number = number; + // to ensure "_byte" is required (not null) + if (_byte == null) { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this.Byte = _byte; + this.Date = date; + this.Password = password; + this.Integer = integer; + this.Int32 = int32; + this.Int64 = int64; + this.Float = _float; + this.Double = _double; + this.Decimal = _decimal; + this.String = _string; + this.Binary = binary; + this.DateTime = dateTime; + this.Uuid = uuid; + this.PatternWithDigits = patternWithDigits; + this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Integer + /// + [DataMember(Name = "integer", EmitDefaultValue = false)] + public int Integer { get; set; } + + /// + /// Gets or Sets Int32 + /// + [DataMember(Name = "int32", EmitDefaultValue = false)] + public int Int32 { get; set; } + + /// + /// Gets or Sets Int64 + /// + [DataMember(Name = "int64", EmitDefaultValue = false)] + public long Int64 { get; set; } + + /// + /// Gets or Sets Number + /// + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)] + public decimal Number { get; set; } + + /// + /// Gets or Sets Float + /// + [DataMember(Name = "float", EmitDefaultValue = false)] + public float Float { get; set; } + + /// + /// Gets or Sets Double + /// + [DataMember(Name = "double", EmitDefaultValue = false)] + public double Double { get; set; } + + /// + /// Gets or Sets Decimal + /// + [DataMember(Name = "decimal", EmitDefaultValue = false)] + public decimal Decimal { get; set; } + + /// + /// Gets or Sets String + /// + [DataMember(Name = "string", EmitDefaultValue = false)] + public string String { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Binary + /// + [DataMember(Name = "binary", EmitDefaultValue = false)] + public System.IO.Stream Binary { get; set; } + + /// + /// Gets or Sets Date + /// + [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime Date { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name = "dateTime", EmitDefaultValue = false)] + public DateTime DateTime { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [DataMember(Name = "pattern_with_digits", EmitDefaultValue = false)] + public string PatternWithDigits { get; set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)] + public string PatternWithDigitsAndDelimiter { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FormatTest {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" Decimal: ").Append(Decimal).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as FormatTest).AreEqual; + } + + /// + /// Returns true if FormatTest instances are equal + /// + /// Instance of FormatTest to be compared + /// Boolean + public bool Equals(FormatTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); + if (this.String != null) + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } + if (this.Byte != null) + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } + if (this.Binary != null) + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } + if (this.Date != null) + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } + if (this.DateTime != null) + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } + if (this.PatternWithDigits != null) + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } + if (this.PatternWithDigitsAndDelimiter != null) + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // Integer (int) maximum + if (this.Integer > (int)100) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + } + + // Integer (int) minimum + if (this.Integer < (int)10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + } + + // Int32 (int) maximum + if (this.Int32 > (int)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + } + + // Int32 (int) minimum + if (this.Int32 < (int)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + } + + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Float (float) maximum + if (this.Float > (float)987.6) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + } + + // Float (float) minimum + if (this.Float < (float)54.3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + } + + // Double (double) maximum + if (this.Double > (double)123.4) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + } + + // Double (double) minimum + if (this.Double < (double)67.8) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + } + + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + + // PatternWithDigits (string) pattern + Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); + } + + // PatternWithDigitsAndDelimiter (string) pattern + Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); + } + + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 000000000000..726b1e8f72e7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,291 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Fruit + /// + [JsonConverter(typeof(FruitJsonConverter))] + [DataContract(Name = "fruit")] + public partial class Fruit : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Apple. + public Fruit(Apple actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Banana. + public Fruit(Banana actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Apple)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Banana)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana"); + } + } + } + + /// + /// Get the actual instance of `Apple`. If the actual instance is not `Apple`, + /// the InvalidClassException will be thrown + /// + /// An instance of Apple + public Apple GetApple() + { + return (Apple)this.ActualInstance; + } + + /// + /// Get the actual instance of `Banana`. If the actual instance is not `Banana`, + /// the InvalidClassException will be thrown + /// + /// An instance of Banana + public Banana GetBanana() + { + return (Banana)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Fruit {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Fruit.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Fruit + /// + /// JSON string + /// An instance of Fruit + public static Fruit FromJson(string jsonString) + { + Fruit newFruit = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newFruit; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Apple).GetProperty("AdditionalProperties") == null) + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.SerializerSettings)); + } + else + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Apple"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Banana).GetProperty("AdditionalProperties") == null) + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.SerializerSettings)); + } + else + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Banana"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newFruit; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Fruit).AreEqual; + } + + /// + /// Returns true if Fruit instances are equal + /// + /// Instance of Fruit to be compared + /// Boolean + public bool Equals(Fruit input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Fruit + /// + public class FruitJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Fruit).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Fruit.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs new file mode 100644 index 000000000000..548da490def0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs @@ -0,0 +1,300 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// FruitReq + /// + [JsonConverter(typeof(FruitReqJsonConverter))] + [DataContract(Name = "fruitReq")] + public partial class FruitReq : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + public FruitReq() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of AppleReq. + public FruitReq(AppleReq actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of BananaReq. + public FruitReq(BananaReq actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(AppleReq)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(BananaReq)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: AppleReq, BananaReq"); + } + } + } + + /// + /// Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`, + /// the InvalidClassException will be thrown + /// + /// An instance of AppleReq + public AppleReq GetAppleReq() + { + return (AppleReq)this.ActualInstance; + } + + /// + /// Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`, + /// the InvalidClassException will be thrown + /// + /// An instance of BananaReq + public BananaReq GetBananaReq() + { + return (BananaReq)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FruitReq {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, FruitReq.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of FruitReq + /// + /// JSON string + /// An instance of FruitReq + public static FruitReq FromJson(string jsonString) + { + FruitReq newFruitReq = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newFruitReq; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(AppleReq).GetProperty("AdditionalProperties") == null) + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.SerializerSettings)); + } + else + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("AppleReq"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into AppleReq: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(BananaReq).GetProperty("AdditionalProperties") == null) + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.SerializerSettings)); + } + else + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("BananaReq"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BananaReq: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newFruitReq; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as FruitReq).AreEqual; + } + + /// + /// Returns true if FruitReq instances are equal + /// + /// Instance of FruitReq to be compared + /// Boolean + public bool Equals(FruitReq input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for FruitReq + /// + public class FruitReqJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(FruitReq).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return FruitReq.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs new file mode 100644 index 000000000000..bd8f4435c92f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs @@ -0,0 +1,263 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// GmFruit + /// + [JsonConverter(typeof(GmFruitJsonConverter))] + [DataContract(Name = "gmFruit")] + public partial class GmFruit : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Apple. + public GmFruit(Apple actualInstance) + { + this.IsNullable = false; + this.SchemaType= "anyOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Banana. + public GmFruit(Banana actualInstance) + { + this.IsNullable = false; + this.SchemaType= "anyOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Apple)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Banana)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana"); + } + } + } + + /// + /// Get the actual instance of `Apple`. If the actual instance is not `Apple`, + /// the InvalidClassException will be thrown + /// + /// An instance of Apple + public Apple GetApple() + { + return (Apple)this.ActualInstance; + } + + /// + /// Get the actual instance of `Banana`. If the actual instance is not `Banana`, + /// the InvalidClassException will be thrown + /// + /// An instance of Banana + public Banana GetBanana() + { + return (Banana)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class GmFruit {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of GmFruit + /// + /// JSON string + /// An instance of GmFruit + public static GmFruit FromJson(string jsonString) + { + GmFruit newGmFruit = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newGmFruit; + } + + try + { + newGmFruit = new GmFruit(JsonConvert.DeserializeObject(jsonString, GmFruit.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newGmFruit; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString())); + } + + try + { + newGmFruit = new GmFruit(JsonConvert.DeserializeObject(jsonString, GmFruit.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newGmFruit; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as GmFruit).AreEqual; + } + + /// + /// Returns true if GmFruit instances are equal + /// + /// Instance of GmFruit to be compared + /// Boolean + public bool Equals(GmFruit input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for GmFruit + /// + public class GmFruitJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(GmFruit).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return GmFruit.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs new file mode 100644 index 000000000000..68b77ec78494 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// GrandparentAnimal + /// + [DataContract(Name = "GrandparentAnimal")] + [JsonConverter(typeof(JsonSubtypes), "PetType")] + [JsonSubtypes.KnownSubType(typeof(ChildCat), "ChildCat")] + [JsonSubtypes.KnownSubType(typeof(ParentPet), "ParentPet")] + public partial class GrandparentAnimal : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected GrandparentAnimal() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// petType (required). + public GrandparentAnimal(string petType = default(string)) + { + this.PetType = petType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)] + public string PetType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GrandparentAnimal {\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as GrandparentAnimal).AreEqual; + } + + /// + /// Returns true if GrandparentAnimal instances are equal + /// + /// Instance of GrandparentAnimal to be compared + /// Boolean + public bool Equals(GrandparentAnimal input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PetType != null) + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs new file mode 100644 index 000000000000..52099a7095e1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// HasOnlyReadOnly + /// + [DataContract(Name = "hasOnlyReadOnly")] + public partial class HasOnlyReadOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public HasOnlyReadOnly() + { + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; private set; } + + /// + /// Returns false as Bar should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBar() + { + return false; + } + /// + /// Gets or Sets Foo + /// + [DataMember(Name = "foo", EmitDefaultValue = false)] + public string Foo { get; private set; } + + /// + /// Returns false as Foo should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeFoo() + { + return false; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HasOnlyReadOnly).AreEqual; + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.Foo != null) + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 000000000000..f31580de3c2f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + [DataContract(Name = "HealthCheckResult")] + public partial class HealthCheckResult : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage. + public HealthCheckResult(string? nullableMessage = default(string?)) + { + this.NullableMessage = nullableMessage; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets NullableMessage + /// + [DataMember(Name = "NullableMessage", EmitDefaultValue = true)] + public string? NullableMessage { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HealthCheckResult).AreEqual; + } + + /// + /// Returns true if HealthCheckResult instances are equal + /// + /// Instance of HealthCheckResult to be compared + /// Boolean + public bool Equals(HealthCheckResult input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.NullableMessage != null) + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/InlineResponseDefault.cs new file mode 100644 index 000000000000..ae46f1f0098f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineResponseDefault + /// + [DataContract(Name = "inline_response_default")] + public partial class InlineResponseDefault : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _string. + public InlineResponseDefault(Foo _string = default(Foo)) + { + this.String = _string; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets String + /// + [DataMember(Name = "string", EmitDefaultValue = false)] + public Foo String { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class InlineResponseDefault {\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as InlineResponseDefault).AreEqual; + } + + /// + /// Returns true if InlineResponseDefault instances are equal + /// + /// Instance of InlineResponseDefault to be compared + /// Boolean + public bool Equals(InlineResponseDefault input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.String != null) + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs new file mode 100644 index 000000000000..3ad7989abef6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -0,0 +1,138 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// IsoscelesTriangle + /// + [DataContract(Name = "IsoscelesTriangle")] + public partial class IsoscelesTriangle : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected IsoscelesTriangle() { } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) + { + this.ShapeType = shapeType; + this.TriangleType = triangleType; + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IsoscelesTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as IsoscelesTriangle).AreEqual; + } + + /// + /// Returns true if IsoscelesTriangle instances are equal + /// + /// Instance of IsoscelesTriangle to be compared + /// Boolean + public bool Equals(IsoscelesTriangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs new file mode 100644 index 000000000000..00814d110694 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// List + /// + [DataContract(Name = "List")] + public partial class List : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _123list. + public List(string _123list = default(string)) + { + this._123List = _123list; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _123List + /// + [DataMember(Name = "123-list", EmitDefaultValue = false)] + public string _123List { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class List {\n"); + sb.Append(" _123List: ").Append(_123List).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as List).AreEqual; + } + + /// + /// Returns true if List instances are equal + /// + /// Instance of List to be compared + /// Boolean + public bool Equals(List input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._123List != null) + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs new file mode 100644 index 000000000000..68ac31619921 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs @@ -0,0 +1,338 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Mammal + /// + [JsonConverter(typeof(MammalJsonConverter))] + [DataContract(Name = "mammal")] + public partial class Mammal : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Pig. + public Mammal(Pig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Whale. + public Mammal(Whale actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Zebra. + public Mammal(Zebra actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Pig)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Whale)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Zebra)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Pig, Whale, Zebra"); + } + } + } + + /// + /// Get the actual instance of `Pig`. If the actual instance is not `Pig`, + /// the InvalidClassException will be thrown + /// + /// An instance of Pig + public Pig GetPig() + { + return (Pig)this.ActualInstance; + } + + /// + /// Get the actual instance of `Whale`. If the actual instance is not `Whale`, + /// the InvalidClassException will be thrown + /// + /// An instance of Whale + public Whale GetWhale() + { + return (Whale)this.ActualInstance; + } + + /// + /// Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + /// the InvalidClassException will be thrown + /// + /// An instance of Zebra + public Zebra GetZebra() + { + return (Zebra)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Mammal {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Mammal.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Mammal + /// + /// JSON string + /// An instance of Mammal + public static Mammal FromJson(string jsonString) + { + Mammal newMammal = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newMammal; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Pig).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Pig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Pig: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Whale).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Whale"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Whale: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Zebra).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Zebra"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Zebra: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newMammal; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Mammal).AreEqual; + } + + /// + /// Returns true if Mammal instances are equal + /// + /// Instance of Mammal to be compared + /// Boolean + public bool Equals(Mammal input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Mammal + /// + public class MammalJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Mammal).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Mammal.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs new file mode 100644 index 000000000000..8b5a73e77365 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs @@ -0,0 +1,189 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MapTest + /// + [DataContract(Name = "MapTest")] + public partial class MapTest : IEquatable, IValidatableObject + { + /// + /// Defines Inner + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum InnerEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2 + + } + + + + /// + /// Gets or Sets MapOfEnumString + /// + [DataMember(Name = "map_of_enum_string", EmitDefaultValue = false)] + public Dictionary MapOfEnumString { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// mapMapOfString. + /// mapOfEnumString. + /// directMap. + /// indirectMap. + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + { + this.MapMapOfString = mapMapOfString; + this.MapOfEnumString = mapOfEnumString; + this.DirectMap = directMap; + this.IndirectMap = indirectMap; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets MapMapOfString + /// + [DataMember(Name = "map_map_of_string", EmitDefaultValue = false)] + public Dictionary> MapMapOfString { get; set; } + + /// + /// Gets or Sets DirectMap + /// + [DataMember(Name = "direct_map", EmitDefaultValue = false)] + public Dictionary DirectMap { get; set; } + + /// + /// Gets or Sets IndirectMap + /// + [DataMember(Name = "indirect_map", EmitDefaultValue = false)] + public Dictionary IndirectMap { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MapTest {\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MapTest).AreEqual; + } + + /// + /// Returns true if MapTest instances are equal + /// + /// Instance of MapTest to be compared + /// Boolean + public bool Equals(MapTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapMapOfString != null) + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); + if (this.DirectMap != null) + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } + if (this.IndirectMap != null) + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 000000000000..3225727af37b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + [DataContract(Name = "MixedPropertiesAndAdditionalPropertiesClass")] + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// dateTime. + /// map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + { + this.Uuid = uuid; + this.DateTime = dateTime; + this.Map = map; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name = "dateTime", EmitDefaultValue = false)] + public DateTime DateTime { get; set; } + + /// + /// Gets or Sets Map + /// + [DataMember(Name = "map", EmitDefaultValue = false)] + public Dictionary Map { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MixedPropertiesAndAdditionalPropertiesClass).AreEqual; + } + + /// + /// Returns true if MixedPropertiesAndAdditionalPropertiesClass instances are equal + /// + /// Instance of MixedPropertiesAndAdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + if (this.DateTime != null) + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } + if (this.Map != null) + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs new file mode 100644 index 000000000000..79a49ef91d28 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model name starting with number + /// + [DataContract(Name = "200_response")] + public partial class Model200Response : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// _class. + public Model200Response(int name = default(int), string _class = default(string)) + { + this.Name = name; + this.Class = _class; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public int Name { get; set; } + + /// + /// Gets or Sets Class + /// + [DataMember(Name = "class", EmitDefaultValue = false)] + public string Class { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Model200Response {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Model200Response).AreEqual; + } + + /// + /// Returns true if Model200Response instances are equal + /// + /// Instance of Model200Response to be compared + /// Boolean + public bool Equals(Model200Response input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + if (this.Class != null) + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs new file mode 100644 index 000000000000..1995ec4b1692 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ModelClient + /// + [DataContract(Name = "_Client")] + public partial class ModelClient : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _client. + public ModelClient(string _client = default(string)) + { + this._Client = _client; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _Client + /// + [DataMember(Name = "client", EmitDefaultValue = false)] + public string _Client { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ModelClient {\n"); + sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ModelClient).AreEqual; + } + + /// + /// Returns true if ModelClient instances are equal + /// + /// Instance of ModelClient to be compared + /// Boolean + public bool Equals(ModelClient input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Client != null) + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs new file mode 100644 index 000000000000..0dc21bb656f0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs @@ -0,0 +1,182 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model name same as property name + /// + [DataContract(Name = "Name")] + public partial class Name : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Name() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// property. + public Name(int name = default(int), string property = default(string)) + { + this._Name = name; + this.Property = property; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public int _Name { get; set; } + + /// + /// Gets or Sets SnakeCase + /// + [DataMember(Name = "snake_case", EmitDefaultValue = false)] + public int SnakeCase { get; private set; } + + /// + /// Returns false as SnakeCase should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeSnakeCase() + { + return false; + } + /// + /// Gets or Sets Property + /// + [DataMember(Name = "property", EmitDefaultValue = false)] + public string Property { get; set; } + + /// + /// Gets or Sets _123Number + /// + [DataMember(Name = "123Number", EmitDefaultValue = false)] + public int _123Number { get; private set; } + + /// + /// Returns false as _123Number should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize_123Number() + { + return false; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Name {\n"); + sb.Append(" _Name: ").Append(_Name).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" _123Number: ").Append(_123Number).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Name).AreEqual; + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); + if (this.Property != null) + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 000000000000..0c1f1d4b15ca --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,265 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// NullableClass + /// + [DataContract(Name = "NullableClass")] + public partial class NullableClass : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// integerProp. + /// numberProp. + /// booleanProp. + /// stringProp. + /// dateProp. + /// datetimeProp. + /// arrayNullableProp. + /// arrayAndItemsNullableProp. + /// arrayItemsNullable. + /// objectNullableProp. + /// objectAndItemsNullableProp. + /// objectItemsNullable. + public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string? stringProp = default(string?), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ArrayItemsNullable = arrayItemsNullable; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.ObjectItemsNullable = objectItemsNullable; + } + + /// + /// Gets or Sets IntegerProp + /// + [DataMember(Name = "integer_prop", EmitDefaultValue = true)] + public int? IntegerProp { get; set; } + + /// + /// Gets or Sets NumberProp + /// + [DataMember(Name = "number_prop", EmitDefaultValue = true)] + public decimal? NumberProp { get; set; } + + /// + /// Gets or Sets BooleanProp + /// + [DataMember(Name = "boolean_prop", EmitDefaultValue = true)] + public bool? BooleanProp { get; set; } + + /// + /// Gets or Sets StringProp + /// + [DataMember(Name = "string_prop", EmitDefaultValue = true)] + public string? StringProp { get; set; } + + /// + /// Gets or Sets DateProp + /// + [DataMember(Name = "date_prop", EmitDefaultValue = true)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime? DateProp { get; set; } + + /// + /// Gets or Sets DatetimeProp + /// + [DataMember(Name = "datetime_prop", EmitDefaultValue = true)] + public DateTime? DatetimeProp { get; set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [DataMember(Name = "array_nullable_prop", EmitDefaultValue = true)] + public List ArrayNullableProp { get; set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [DataMember(Name = "array_and_items_nullable_prop", EmitDefaultValue = true)] + public List ArrayAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [DataMember(Name = "array_items_nullable", EmitDefaultValue = false)] + public List ArrayItemsNullable { get; set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [DataMember(Name = "object_nullable_prop", EmitDefaultValue = true)] + public Dictionary ObjectNullableProp { get; set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [DataMember(Name = "object_and_items_nullable_prop", EmitDefaultValue = true)] + public Dictionary ObjectAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [DataMember(Name = "object_items_nullable", EmitDefaultValue = false)] + public Dictionary ObjectItemsNullable { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NullableClass {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as NullableClass).AreEqual; + } + + /// + /// Returns true if NullableClass instances are equal + /// + /// Instance of NullableClass to be compared + /// Boolean + public bool Equals(NullableClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.IntegerProp != null) + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } + if (this.NumberProp != null) + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } + if (this.BooleanProp != null) + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } + if (this.StringProp != null) + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } + if (this.DateProp != null) + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } + if (this.DatetimeProp != null) + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } + if (this.ArrayNullableProp != null) + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } + if (this.ArrayAndItemsNullableProp != null) + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } + if (this.ArrayItemsNullable != null) + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } + if (this.ObjectNullableProp != null) + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } + if (this.ObjectAndItemsNullableProp != null) + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } + if (this.ObjectItemsNullable != null) + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs new file mode 100644 index 000000000000..5dd73a56ef76 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs @@ -0,0 +1,301 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + /// + [JsonConverter(typeof(NullableShapeJsonConverter))] + [DataContract(Name = "NullableShape")] + public partial class NullableShape : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + public NullableShape() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public NullableShape(Quadrilateral actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public NullableShape(Triangle actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NullableShape {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, NullableShape.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of NullableShape + /// + /// JSON string + /// An instance of NullableShape + public static NullableShape FromJson(string jsonString) + { + NullableShape newNullableShape = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newNullableShape; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.SerializerSettings)); + } + else + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.SerializerSettings)); + } + else + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newNullableShape; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as NullableShape).AreEqual; + } + + /// + /// Returns true if NullableShape instances are equal + /// + /// Instance of NullableShape to be compared + /// Boolean + public bool Equals(NullableShape input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for NullableShape + /// + public class NullableShapeJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(NullableShape).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return NullableShape.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs new file mode 100644 index 000000000000..97f869b0ebc1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// NumberOnly + /// + [DataContract(Name = "NumberOnly")] + public partial class NumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber. + public NumberOnly(decimal justNumber = default(decimal)) + { + this.JustNumber = justNumber; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets JustNumber + /// + [DataMember(Name = "JustNumber", EmitDefaultValue = false)] + public decimal JustNumber { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as NumberOnly).AreEqual; + } + + /// + /// Returns true if NumberOnly instances are equal + /// + /// Instance of NumberOnly to be compared + /// Boolean + public bool Equals(NumberOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs new file mode 100644 index 000000000000..86ea32998f8c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -0,0 +1,171 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ObjectWithDeprecatedFields + /// + [DataContract(Name = "ObjectWithDeprecatedFields")] + public partial class ObjectWithDeprecatedFields : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// id. + /// deprecatedRef. + /// bars. + public ObjectWithDeprecatedFields(string uuid = default(string), decimal id = default(decimal), DeprecatedObject deprecatedRef = default(DeprecatedObject), List bars = default(List)) + { + this.Uuid = uuid; + this.Id = id; + this.DeprecatedRef = deprecatedRef; + this.Bars = bars; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public string Uuid { get; set; } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + [Obsolete] + public decimal Id { get; set; } + + /// + /// Gets or Sets DeprecatedRef + /// + [DataMember(Name = "deprecatedRef", EmitDefaultValue = false)] + [Obsolete] + public DeprecatedObject DeprecatedRef { get; set; } + + /// + /// Gets or Sets Bars + /// + [DataMember(Name = "bars", EmitDefaultValue = false)] + [Obsolete] + public List Bars { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ObjectWithDeprecatedFields {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" DeprecatedRef: ").Append(DeprecatedRef).Append("\n"); + sb.Append(" Bars: ").Append(Bars).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ObjectWithDeprecatedFields).AreEqual; + } + + /// + /// Returns true if ObjectWithDeprecatedFields instances are equal + /// + /// Instance of ObjectWithDeprecatedFields to be compared + /// Boolean + public bool Equals(ObjectWithDeprecatedFields input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.DeprecatedRef != null) + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } + if (this.Bars != null) + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs new file mode 100644 index 000000000000..5c52482e79b9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs @@ -0,0 +1,210 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Order + /// + [DataContract(Name = "Order")] + public partial class Order : IEquatable, IValidatableObject + { + /// + /// Order Status + /// + /// Order Status + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// petId. + /// quantity. + /// shipDate. + /// Order Status. + /// complete (default to false). + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) + { + this.Id = id; + this.PetId = petId; + this.Quantity = quantity; + this.ShipDate = shipDate; + this.Status = status; + this.Complete = complete; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name = "petId", EmitDefaultValue = false)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name = "quantity", EmitDefaultValue = false)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name = "shipDate", EmitDefaultValue = false)] + public DateTime ShipDate { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name = "complete", EmitDefaultValue = true)] + public bool Complete { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Order).AreEqual; + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); + if (this.ShipDate != null) + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs new file mode 100644 index 000000000000..3209f6d6244e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -0,0 +1,152 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// OuterComposite + /// + [DataContract(Name = "OuterComposite")] + public partial class OuterComposite : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// myNumber. + /// myString. + /// myBoolean. + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) + { + this.MyNumber = myNumber; + this.MyString = myString; + this.MyBoolean = myBoolean; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name = "my_number", EmitDefaultValue = false)] + public decimal MyNumber { get; set; } + + /// + /// Gets or Sets MyString + /// + [DataMember(Name = "my_string", EmitDefaultValue = false)] + public string MyString { get; set; } + + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name = "my_boolean", EmitDefaultValue = true)] + public bool MyBoolean { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as OuterComposite).AreEqual; + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); + if (this.MyString != null) + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnum.cs new file mode 100644 index 000000000000..2aa496a2e074 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OuterEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 000000000000..dd79c7010d6b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumDefaultValue + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 000000000000..44dc91c700ad --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumInteger + /// + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 000000000000..b927507cf97a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ParentPet.cs new file mode 100644 index 000000000000..ac986b555efd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ParentPet.cs @@ -0,0 +1,146 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ParentPet + /// + [DataContract(Name = "ParentPet")] + [JsonConverter(typeof(JsonSubtypes), "PetType")] + [JsonSubtypes.KnownSubType(typeof(ChildCat), "ChildCat")] + public partial class ParentPet : GrandparentAnimal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ParentPet() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// petType (required) (default to "ParentPet"). + public ParentPet(string petType = "ParentPet") : base(petType) + { + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ParentPet {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ParentPet).AreEqual; + } + + /// + /// Returns true if ParentPet instances are equal + /// + /// Instance of ParentPet to be compared + /// Boolean + public bool Equals(ParentPet input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs new file mode 100644 index 000000000000..24e8a3698916 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs @@ -0,0 +1,231 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Pet + /// + [DataContract(Name = "Pet")] + public partial class Pet : IEquatable, IValidatableObject + { + /// + /// pet status in the store + /// + /// pet status in the store + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Available for value: available + /// + [EnumMember(Value = "available")] + Available = 1, + + /// + /// Enum Pending for value: pending + /// + [EnumMember(Value = "pending")] + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + [EnumMember(Value = "sold")] + Sold = 3 + + } + + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Pet() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// category. + /// name (required). + /// photoUrls (required). + /// tags. + /// pet status in the store. + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + { + this.Name = name; + // to ensure "photoUrls" is required (not null) + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; + this.Id = id; + this.Category = category; + this.Tags = tags; + this.Status = status; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = false)] + public List Tags { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Pet).AreEqual; + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Category != null) + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.PhotoUrls != null) + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } + if (this.Tags != null) + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs new file mode 100644 index 000000000000..b82c0899c27d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs @@ -0,0 +1,292 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Pig + /// + [JsonConverter(typeof(PigJsonConverter))] + [DataContract(Name = "Pig")] + public partial class Pig : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of BasquePig. + public Pig(BasquePig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of DanishPig. + public Pig(DanishPig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(BasquePig)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(DanishPig)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: BasquePig, DanishPig"); + } + } + } + + /// + /// Get the actual instance of `BasquePig`. If the actual instance is not `BasquePig`, + /// the InvalidClassException will be thrown + /// + /// An instance of BasquePig + public BasquePig GetBasquePig() + { + return (BasquePig)this.ActualInstance; + } + + /// + /// Get the actual instance of `DanishPig`. If the actual instance is not `DanishPig`, + /// the InvalidClassException will be thrown + /// + /// An instance of DanishPig + public DanishPig GetDanishPig() + { + return (DanishPig)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pig {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Pig.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Pig + /// + /// JSON string + /// An instance of Pig + public static Pig FromJson(string jsonString) + { + Pig newPig = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newPig; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(BasquePig).GetProperty("AdditionalProperties") == null) + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.SerializerSettings)); + } + else + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("BasquePig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BasquePig: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(DanishPig).GetProperty("AdditionalProperties") == null) + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.SerializerSettings)); + } + else + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("DanishPig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into DanishPig: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newPig; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Pig).AreEqual; + } + + /// + /// Returns true if Pig instances are equal + /// + /// Instance of Pig to be compared + /// Boolean + public bool Equals(Pig input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Pig + /// + public class PigJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Pig).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Pig.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs new file mode 100644 index 000000000000..a1a850f169e4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -0,0 +1,292 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Quadrilateral + /// + [JsonConverter(typeof(QuadrilateralJsonConverter))] + [DataContract(Name = "Quadrilateral")] + public partial class Quadrilateral : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ComplexQuadrilateral. + public Quadrilateral(ComplexQuadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of SimpleQuadrilateral. + public Quadrilateral(SimpleQuadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(ComplexQuadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(SimpleQuadrilateral)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: ComplexQuadrilateral, SimpleQuadrilateral"); + } + } + } + + /// + /// Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of ComplexQuadrilateral + public ComplexQuadrilateral GetComplexQuadrilateral() + { + return (ComplexQuadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of SimpleQuadrilateral + public SimpleQuadrilateral GetSimpleQuadrilateral() + { + return (SimpleQuadrilateral)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Quadrilateral {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Quadrilateral.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Quadrilateral + /// + /// JSON string + /// An instance of Quadrilateral + public static Quadrilateral FromJson(string jsonString) + { + Quadrilateral newQuadrilateral = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newQuadrilateral; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ComplexQuadrilateral).GetProperty("AdditionalProperties") == null) + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.SerializerSettings)); + } + else + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("ComplexQuadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into ComplexQuadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(SimpleQuadrilateral).GetProperty("AdditionalProperties") == null) + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.SerializerSettings)); + } + else + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("SimpleQuadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into SimpleQuadrilateral: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newQuadrilateral; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Quadrilateral).AreEqual; + } + + /// + /// Returns true if Quadrilateral instances are equal + /// + /// Instance of Quadrilateral to be compared + /// Boolean + public bool Equals(Quadrilateral input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Quadrilateral + /// + public class QuadrilateralJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Quadrilateral).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Quadrilateral.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs new file mode 100644 index 000000000000..613aec4d121b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// QuadrilateralInterface + /// + [DataContract(Name = "QuadrilateralInterface")] + public partial class QuadrilateralInterface : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected QuadrilateralInterface() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType (required). + public QuadrilateralInterface(string quadrilateralType = default(string)) + { + this.QuadrilateralType = quadrilateralType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class QuadrilateralInterface {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as QuadrilateralInterface).AreEqual; + } + + /// + /// Returns true if QuadrilateralInterface instances are equal + /// + /// Instance of QuadrilateralInterface to be compared + /// Boolean + public bool Equals(QuadrilateralInterface input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs new file mode 100644 index 000000000000..ad59ca832864 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -0,0 +1,151 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ReadOnlyFirst + /// + [DataContract(Name = "ReadOnlyFirst")] + public partial class ReadOnlyFirst : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// baz. + public ReadOnlyFirst(string baz = default(string)) + { + this.Baz = baz; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; private set; } + + /// + /// Returns false as Bar should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBar() + { + return false; + } + /// + /// Gets or Sets Baz + /// + [DataMember(Name = "baz", EmitDefaultValue = false)] + public string Baz { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ReadOnlyFirst).AreEqual; + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.Baz != null) + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs new file mode 100644 index 000000000000..e702e0157030 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract(Name = "Return")] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _return. + public Return(int _return = default(int)) + { + this._Return = _return; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name = "return", EmitDefaultValue = false)] + public int _Return { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Return).AreEqual; + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this._Return.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs new file mode 100644 index 000000000000..4b58e23f4fc0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -0,0 +1,153 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ScaleneTriangle + /// + [DataContract(Name = "ScaleneTriangle")] + public partial class ScaleneTriangle : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ScaleneTriangle() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) + { + this.ShapeType = shapeType; + this.TriangleType = triangleType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ScaleneTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ScaleneTriangle).AreEqual; + } + + /// + /// Returns true if ScaleneTriangle instances are equal + /// + /// Instance of ScaleneTriangle to be compared + /// Boolean + public bool Equals(ScaleneTriangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs new file mode 100644 index 000000000000..dd74fa4b7184 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs @@ -0,0 +1,292 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Shape + /// + [JsonConverter(typeof(ShapeJsonConverter))] + [DataContract(Name = "Shape")] + public partial class Shape : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public Shape(Quadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public Shape(Triangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Shape {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Shape.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Shape + /// + /// JSON string + /// An instance of Shape + public static Shape FromJson(string jsonString) + { + Shape newShape = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newShape; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.SerializerSettings)); + } + else + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.SerializerSettings)); + } + else + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newShape; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Shape).AreEqual; + } + + /// + /// Returns true if Shape instances are equal + /// + /// Instance of Shape to be compared + /// Boolean + public bool Equals(Shape input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Shape + /// + public class ShapeJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Shape).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Shape.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs new file mode 100644 index 000000000000..b2d5e37cfa51 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ShapeInterface + /// + [DataContract(Name = "ShapeInterface")] + public partial class ShapeInterface : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ShapeInterface() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + public ShapeInterface(string shapeType = default(string)) + { + this.ShapeType = shapeType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ShapeInterface {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ShapeInterface).AreEqual; + } + + /// + /// Returns true if ShapeInterface instances are equal + /// + /// Instance of ShapeInterface to be compared + /// Boolean + public bool Equals(ShapeInterface input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs new file mode 100644 index 000000000000..c6b87c89751a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -0,0 +1,301 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + /// + [JsonConverter(typeof(ShapeOrNullJsonConverter))] + [DataContract(Name = "ShapeOrNull")] + public partial class ShapeOrNull : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + public ShapeOrNull() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public ShapeOrNull(Quadrilateral actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public ShapeOrNull(Triangle actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ShapeOrNull {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, ShapeOrNull.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of ShapeOrNull + /// + /// JSON string + /// An instance of ShapeOrNull + public static ShapeOrNull FromJson(string jsonString) + { + ShapeOrNull newShapeOrNull = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newShapeOrNull; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.SerializerSettings)); + } + else + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.SerializerSettings)); + } + else + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newShapeOrNull; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ShapeOrNull).AreEqual; + } + + /// + /// Returns true if ShapeOrNull instances are equal + /// + /// Instance of ShapeOrNull to be compared + /// Boolean + public bool Equals(ShapeOrNull input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for ShapeOrNull + /// + public class ShapeOrNullJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(ShapeOrNull).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return ShapeOrNull.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs new file mode 100644 index 000000000000..17676b976178 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -0,0 +1,153 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// SimpleQuadrilateral + /// + [DataContract(Name = "SimpleQuadrilateral")] + public partial class SimpleQuadrilateral : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SimpleQuadrilateral() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// quadrilateralType (required). + public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + { + this.ShapeType = shapeType; + this.QuadrilateralType = quadrilateralType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SimpleQuadrilateral {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as SimpleQuadrilateral).AreEqual; + } + + /// + /// Returns true if SimpleQuadrilateral instances are equal + /// + /// Instance of SimpleQuadrilateral to be compared + /// Boolean + public bool Equals(SimpleQuadrilateral input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs new file mode 100644 index 000000000000..7800467822ea --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// SpecialModelName + /// + [DataContract(Name = "_special_model.name_")] + public partial class SpecialModelName : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// specialPropertyName. + /// specialModelName. + public SpecialModelName(long specialPropertyName = default(long), string specialModelName = default(string)) + { + this.SpecialPropertyName = specialPropertyName; + this._SpecialModelName = specialModelName; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SpecialPropertyName + /// + [DataMember(Name = "$special[property.name]", EmitDefaultValue = false)] + public long SpecialPropertyName { get; set; } + + /// + /// Gets or Sets _SpecialModelName + /// + [DataMember(Name = "_special_model.name_", EmitDefaultValue = false)] + public string _SpecialModelName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SpecialModelName {\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); + sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as SpecialModelName).AreEqual; + } + + /// + /// Returns true if SpecialModelName instances are equal + /// + /// Instance of SpecialModelName to be compared + /// Boolean + public bool Equals(SpecialModelName input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); + if (this._SpecialModelName != null) + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs new file mode 100644 index 000000000000..3df2c02e2cef --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Tag + /// + [DataContract(Name = "Tag")] + public partial class Tag : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Tag(long id = default(long), string name = default(string)) + { + this.Id = id; + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Tag).AreEqual; + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs new file mode 100644 index 000000000000..c8cf49ef7f66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs @@ -0,0 +1,338 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Triangle + /// + [JsonConverter(typeof(TriangleJsonConverter))] + [DataContract(Name = "Triangle")] + public partial class Triangle : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of EquilateralTriangle. + public Triangle(EquilateralTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of IsoscelesTriangle. + public Triangle(IsoscelesTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ScaleneTriangle. + public Triangle(ScaleneTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(EquilateralTriangle)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(IsoscelesTriangle)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(ScaleneTriangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + } + } + } + + /// + /// Get the actual instance of `EquilateralTriangle`. If the actual instance is not `EquilateralTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of EquilateralTriangle + public EquilateralTriangle GetEquilateralTriangle() + { + return (EquilateralTriangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `IsoscelesTriangle`. If the actual instance is not `IsoscelesTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of IsoscelesTriangle + public IsoscelesTriangle GetIsoscelesTriangle() + { + return (IsoscelesTriangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `ScaleneTriangle`. If the actual instance is not `ScaleneTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of ScaleneTriangle + public ScaleneTriangle GetScaleneTriangle() + { + return (ScaleneTriangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Triangle {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Triangle.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Triangle + /// + /// JSON string + /// An instance of Triangle + public static Triangle FromJson(string jsonString) + { + Triangle newTriangle = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newTriangle; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(EquilateralTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("EquilateralTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into EquilateralTriangle: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(IsoscelesTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("IsoscelesTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into IsoscelesTriangle: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ScaleneTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("ScaleneTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into ScaleneTriangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newTriangle; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Triangle).AreEqual; + } + + /// + /// Returns true if Triangle instances are equal + /// + /// Instance of Triangle to be compared + /// Boolean + public bool Equals(Triangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Triangle + /// + public class TriangleJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Triangle).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Triangle.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs new file mode 100644 index 000000000000..bb58c9940506 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TriangleInterface + /// + [DataContract(Name = "TriangleInterface")] + public partial class TriangleInterface : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TriangleInterface() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// triangleType (required). + public TriangleInterface(string triangleType = default(string)) + { + this.TriangleType = triangleType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TriangleInterface {\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TriangleInterface).AreEqual; + } + + /// + /// Returns true if TriangleInterface instances are equal + /// + /// Instance of TriangleInterface to be compared + /// Boolean + public bool Equals(TriangleInterface input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs new file mode 100644 index 000000000000..5f2a3020c3dd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs @@ -0,0 +1,274 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// User + /// + [DataContract(Name = "User")] + public partial class User : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// username. + /// firstName. + /// lastName. + /// email. + /// password. + /// phone. + /// User Status. + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int), Object objectWithNoDeclaredProps = default(Object), Object objectWithNoDeclaredPropsNullable = default(Object), Object anyTypeProp = default(Object), Object anyTypePropNullable = default(Object)) + { + this.Id = id; + this.Username = username; + this.FirstName = firstName; + this.LastName = lastName; + this.Email = email; + this.Password = password; + this.Phone = phone; + this.UserStatus = userStatus; + this.ObjectWithNoDeclaredProps = objectWithNoDeclaredProps; + this.ObjectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + this.AnyTypeProp = anyTypeProp; + this.AnyTypePropNullable = anyTypePropNullable; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", EmitDefaultValue = false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name = "firstName", EmitDefaultValue = false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name = "lastName", EmitDefaultValue = false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name = "email", EmitDefaultValue = false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name = "phone", EmitDefaultValue = false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name = "userStatus", EmitDefaultValue = false)] + public int UserStatus { get; set; } + + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + [DataMember(Name = "objectWithNoDeclaredProps", EmitDefaultValue = false)] + public Object ObjectWithNoDeclaredProps { get; set; } + + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + [DataMember(Name = "objectWithNoDeclaredPropsNullable", EmitDefaultValue = true)] + public Object ObjectWithNoDeclaredPropsNullable { get; set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + [DataMember(Name = "anyTypeProp", EmitDefaultValue = true)] + public Object AnyTypeProp { get; set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + [DataMember(Name = "anyTypePropNullable", EmitDefaultValue = true)] + public Object AnyTypePropNullable { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); + sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); + sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); + sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as User).AreEqual; + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Username != null) + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.Email != null) + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } + if (this.Phone != null) + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); + if (this.ObjectWithNoDeclaredProps != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } + if (this.ObjectWithNoDeclaredPropsNullable != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } + if (this.AnyTypeProp != null) + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } + if (this.AnyTypePropNullable != null) + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs new file mode 100644 index 000000000000..dbe00ae03e58 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Whale + /// + [DataContract(Name = "whale")] + public partial class Whale : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Whale() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// hasBaleen. + /// hasTeeth. + /// className (required). + public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) + { + this.ClassName = className; + this.HasBaleen = hasBaleen; + this.HasTeeth = hasTeeth; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets HasBaleen + /// + [DataMember(Name = "hasBaleen", EmitDefaultValue = true)] + public bool HasBaleen { get; set; } + + /// + /// Gets or Sets HasTeeth + /// + [DataMember(Name = "hasTeeth", EmitDefaultValue = true)] + public bool HasTeeth { get; set; } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Whale {\n"); + sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); + sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Whale).AreEqual; + } + + /// + /// Returns true if Whale instances are equal + /// + /// Instance of Whale to be compared + /// Boolean + public bool Equals(Whale input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs new file mode 100644 index 000000000000..0811c5faac00 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs @@ -0,0 +1,177 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Zebra + /// + [DataContract(Name = "zebra")] + public partial class Zebra : Dictionary, IEquatable, IValidatableObject + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum Plains for value: plains + /// + [EnumMember(Value = "plains")] + Plains = 1, + + /// + /// Enum Mountain for value: mountain + /// + [EnumMember(Value = "mountain")] + Mountain = 2, + + /// + /// Enum Grevys for value: grevys + /// + [EnumMember(Value = "grevys")] + Grevys = 3 + + } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Zebra() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// type. + /// className (required). + public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() + { + this.ClassName = className; + this.Type = type; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Zebra {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Zebra).AreEqual; + } + + /// + /// Returns true if Zebra instances are equal + /// + /// Instance of Zebra to be compared + /// Boolean + public bool Equals(Zebra input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 000000000000..4f5b8ae971aa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,34 @@ + + + + true + net6.0 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + annotations + + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.gitignore b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.gitignore new file mode 100644 index 000000000000..1ee53850b84c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator-ignore b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES new file mode 100644 index 000000000000..2f141a0eb477 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES @@ -0,0 +1,193 @@ +.gitignore +Org.OpenAPITools.sln +README.md +appveyor.yml +docs/apis/AnotherFakeApi.md +docs/apis/DefaultApi.md +docs/apis/FakeApi.md +docs/apis/FakeClassnameTags123Api.md +docs/apis/PetApi.md +docs/apis/StoreApi.md +docs/apis/UserApi.md +docs/models/AdditionalPropertiesClass.md +docs/models/Animal.md +docs/models/ApiResponse.md +docs/models/Apple.md +docs/models/AppleReq.md +docs/models/ArrayOfArrayOfNumberOnly.md +docs/models/ArrayOfNumberOnly.md +docs/models/ArrayTest.md +docs/models/Banana.md +docs/models/BananaReq.md +docs/models/BasquePig.md +docs/models/Capitalization.md +docs/models/Cat.md +docs/models/CatAllOf.md +docs/models/Category.md +docs/models/ChildCat.md +docs/models/ChildCatAllOf.md +docs/models/ClassModel.md +docs/models/ComplexQuadrilateral.md +docs/models/DanishPig.md +docs/models/DeprecatedObject.md +docs/models/Dog.md +docs/models/DogAllOf.md +docs/models/Drawing.md +docs/models/EnumArrays.md +docs/models/EnumClass.md +docs/models/EnumTest.md +docs/models/EquilateralTriangle.md +docs/models/File.md +docs/models/FileSchemaTestClass.md +docs/models/Foo.md +docs/models/FormatTest.md +docs/models/Fruit.md +docs/models/FruitReq.md +docs/models/GmFruit.md +docs/models/GrandparentAnimal.md +docs/models/HasOnlyReadOnly.md +docs/models/HealthCheckResult.md +docs/models/InlineResponseDefault.md +docs/models/IsoscelesTriangle.md +docs/models/List.md +docs/models/Mammal.md +docs/models/MapTest.md +docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/Model200Response.md +docs/models/ModelClient.md +docs/models/Name.md +docs/models/NullableClass.md +docs/models/NullableShape.md +docs/models/NumberOnly.md +docs/models/ObjectWithDeprecatedFields.md +docs/models/Order.md +docs/models/OuterComposite.md +docs/models/OuterEnum.md +docs/models/OuterEnumDefaultValue.md +docs/models/OuterEnumInteger.md +docs/models/OuterEnumIntegerDefaultValue.md +docs/models/ParentPet.md +docs/models/Pet.md +docs/models/Pig.md +docs/models/Quadrilateral.md +docs/models/QuadrilateralInterface.md +docs/models/ReadOnlyFirst.md +docs/models/Return.md +docs/models/ScaleneTriangle.md +docs/models/Shape.md +docs/models/ShapeInterface.md +docs/models/ShapeOrNull.md +docs/models/SimpleQuadrilateral.md +docs/models/SpecialModelName.md +docs/models/Tag.md +docs/models/Triangle.md +docs/models/TriangleInterface.md +docs/models/User.md +docs/models/Whale.md +docs/models/Zebra.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiKeyToken.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/BasicToken.cs +src/Org.OpenAPITools/Client/BearerToken.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningToken.cs +src/Org.OpenAPITools/Client/IApi.cs +src/Org.OpenAPITools/Client/OAuthToken.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/AppleReq.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/BananaReq.cs +src/Org.OpenAPITools/Model/BasquePig.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ChildCat.cs +src/Org.OpenAPITools/Model/ChildCatAllOf.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +src/Org.OpenAPITools/Model/DanishPig.cs +src/Org.OpenAPITools/Model/DeprecatedObject.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/Drawing.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/EquilateralTriangle.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/Foo.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Model/FruitReq.cs +src/Org.OpenAPITools/Model/GmFruit.cs +src/Org.OpenAPITools/Model/GrandparentAnimal.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/HealthCheckResult.cs +src/Org.OpenAPITools/Model/InlineResponseDefault.cs +src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/Mammal.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NullableClass.cs +src/Org.OpenAPITools/Model/NullableShape.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumInteger.cs +src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +src/Org.OpenAPITools/Model/ParentPet.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/Pig.cs +src/Org.OpenAPITools/Model/Quadrilateral.cs +src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/ScaleneTriangle.cs +src/Org.OpenAPITools/Model/Shape.cs +src/Org.OpenAPITools/Model/ShapeInterface.cs +src/Org.OpenAPITools/Model/ShapeOrNull.cs +src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/Triangle.cs +src/Org.OpenAPITools/Model/TriangleInterface.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/Whale.cs +src/Org.OpenAPITools/Model/Zebra.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/VERSION new file mode 100644 index 000000000000..0984c4c1ad21 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/Org.OpenAPITools.sln b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/Org.OpenAPITools.sln new file mode 100644 index 000000000000..5b15451c9dcf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/README.md new file mode 100644 index 000000000000..f57f9c75f7ce --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/README.md @@ -0,0 +1,259 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net6.0', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + ApiResponse foo = await api.Call123TestSpecialTagsWithHttpInfoAsync("todo"); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [Polly](https://www.nuget.org/packages/Polly/) - 7.2.2 or later +- [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Authentication schemes defined for the API: + + +### 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 + + +### bearer_test + + +- **Type**: Bearer Authentication + + +### http_basic_test + + +- **Type**: HTTP basic authentication + + +### http_signature_test + + + + +### 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 + +## Build +- SDK version: 1.0.0 +- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen + +## Api Information +- appName: OpenAPI Petstore +- appVersion: 1.0.0 +- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true +- withXml: + +## [OpenApi Generator Parameteres](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net6.0 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/appveyor.yml b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/appveyor.yml new file mode 100644 index 000000000000..f76f63cee506 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/AnotherFakeApi.md new file mode 100644 index 000000000000..93f82cb5bdb1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/AnotherFakeApi.md @@ -0,0 +1,80 @@ +# Org.OpenAPITools.Api.AnotherFakeApi + +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 modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Call123TestSpecialTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md new file mode 100644 index 000000000000..345af7fa914f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md @@ -0,0 +1,73 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FooGet**](DefaultApi.md#fooget) | **GET** /foo | + + + +# **FooGet** +> InlineResponseDefault FooGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FooGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + InlineResponseDefault result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md new file mode 100644 index 000000000000..54d29ffb72a4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md @@ -0,0 +1,1126 @@ +# Org.OpenAPITools.Api.FakeApi + +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 +[**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 | +[**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums +[**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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeHealthGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) [[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 (bool? body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = true; // bool? | Input boolean as post body (optional) + + try + { + bool result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) [[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 outerComposite = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + +[[Back to top]](#) [[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** +> decimal FakeOuterNumberSerialize (decimal? body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = 8.14D; // decimal? | Input number as post body (optional) + + try + { + decimal result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **decimal?**| Input number as post body | [optional] + +### Return type + +**decimal** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) [[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 (string body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = "body_example"; // string | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetArrayOfEnums** +> List<OuterEnum> GetArrayOfEnums () + +Array of Enums + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetArrayOfEnumsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Array of Enums + List result = apiInstance.GetArrayOfEnums(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + +[[Back to top]](#) [[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** +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithFileSchemaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + + try + { + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[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** +> void TestBodyWithQueryParams (string query, User user) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var query = "query_example"; // string | + var user = new User(); // User | + + try + { + apiInstance.TestBodyWithQueryParams(query, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[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 modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClientModelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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** +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: http_basic_test + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(config); + var number = 8.14D; // decimal | None + var _double = 1.2D; // double | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None + var integer = 56; // int? | None (optional) + var int32 = 56; // int? | None (optional) + var int64 = 789L; // long? | None (optional) + var _float = 3.4F; // float? | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **decimal**| None | + **_double** | **double**| None | + **patternWithoutDelimiter** | **string**| None | + **_byte** | **byte[]**| None | + **integer** | **int?**| None | [optional] + **int32** | **int?**| None | [optional] + **int64** | **long?**| None | [optional] + **_float** | **float?**| None | [optional] + **_string** | **string**| None | [optional] + **binary** | **System.IO.Stream****System.IO.Stream**| None | [optional] + **date** | **DateTime?**| None | [optional] + **dateTime** | **DateTime?**| None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] + **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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[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** +> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) + var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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] + **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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +[[Back to top]](#) [[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** +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestGroupParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure Bearer token for authorization: bearer_test + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new FakeApi(config); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters + var stringGroup = 56; // int? | String in group parameters (optional) + var booleanGroup = true; // bool? | Boolean in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) + + try + { + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | + **stringGroup** | **int?**| String in group parameters | [optional] + **booleanGroup** | **bool?**| Boolean in group parameters | [optional] + **int64Group** | **long?**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + +[[Back to top]](#) [[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** +> void TestInlineAdditionalProperties (Dictionary requestBody) + +test inline additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Dictionary<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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeClassnameTags123Api.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..0708e362fb24 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeClassnameTags123Api.md @@ -0,0 +1,85 @@ +# Org.OpenAPITools.Api.FakeClassnameTags123Api + +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 modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClassnameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/PetApi.md new file mode 100644 index 000000000000..b61d64188309 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/PetApi.md @@ -0,0 +1,689 @@ +# Org.OpenAPITools.Api.PetApi + +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** +> void AddPet (Pet pet) + +Add a new pet to the store + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[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** +> void DeletePet (long petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[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<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[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** +> List<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<string>**](string.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[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 (long petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[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** +> void UpdatePet (Pet pet) + +Update an existing pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[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** +> void UpdatePetWithForm (long petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[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 (long petId, string additionalMetadata = null, System.IO.Stream file = null) + +uploads an image + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet to update | + **additionalMetadata** | **string**| Additional data to pass to server | [optional] + **file** | **System.IO.Stream****System.IO.Stream**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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 (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) + +uploads an image (required) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet to update | + **requiredFile** | **System.IO.Stream****System.IO.Stream**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/StoreApi.md new file mode 100644 index 000000000000..a1e45f5d7926 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/StoreApi.md @@ -0,0 +1,298 @@ +# Org.OpenAPITools.Api.StoreApi + +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** +> void DeleteOrder (string 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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[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** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Dictionary** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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 (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789L; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[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 order) + +Place an order for a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/UserApi.md new file mode 100644 index 000000000000..70ff20fa8965 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/UserApi.md @@ -0,0 +1,573 @@ +# Org.OpenAPITools.Api.UserApi + +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** +> void CreateUser (User user) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[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 (string username) + +Get user by user name + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[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 (string username, string password) + +Logs user into the system + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[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** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void UpdateUser (string username, User user) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | name that need to be deleted + var user = new User(); // User | Updated user object + + try + { + // Updated user + apiInstance.UpdateUser(username, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/AdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..1f9194500099 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/AdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**Anytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype3** | **Dictionary<string, Object>** | | [optional] +**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**MapWithUndeclaredPropertiesString** | **Dictionary<string, string>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Animal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Animal.md new file mode 100644 index 000000000000..1a1760bd8697 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Animal.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ApiResponse.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ApiResponse.md new file mode 100644 index 000000000000..bc808ceeae39 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ApiResponse.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ApiResponse + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Apple.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Apple.md new file mode 100644 index 000000000000..d40b527b3e04 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Apple.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/AppleReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/AppleReq.md new file mode 100644 index 000000000000..325521123f12 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/AppleReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.AppleReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..a23ba59e609c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayOfNumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..10b8413439b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayTest.md new file mode 100644 index 000000000000..32365e6d4d04 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ArrayTest.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **List<string>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Banana.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Banana.md new file mode 100644 index 000000000000..d32e90cf2985 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/BananaReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/BananaReq.md new file mode 100644 index 000000000000..c8372b73c5f7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/BananaReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.BananaReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/BasquePig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/BasquePig.md new file mode 100644 index 000000000000..db4f7a362268 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/BasquePig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BasquePig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Capitalization.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Capitalization.md new file mode 100644 index 000000000000..fde98a967ef8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Capitalization.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | **string** | | [optional] +**CapitalCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**ATT_NAME** | **string** | Name of the pet | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Cat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Cat.md new file mode 100644 index 000000000000..310a5e6575ec --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Cat.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/CatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/CatAllOf.md new file mode 100644 index 000000000000..3b4d9832501e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/CatAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Category.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Category.md new file mode 100644 index 000000000000..6eb0a2e13eaa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Category.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [default to "default-name"] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCat.md new file mode 100644 index 000000000000..88fe8f7a7fdd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCat.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [default to PetTypeEnum.ChildCat] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCatAllOf.md new file mode 100644 index 000000000000..9e853764bc66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCatAllOf.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ClassModel.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ClassModel.md new file mode 100644 index 000000000000..bb35816c9148 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ClassModel.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ClassModel +Model for testing model with \"_class\" property + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ComplexQuadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ComplexQuadrilateral.md new file mode 100644 index 000000000000..14da4bba22ed --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ComplexQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ComplexQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DanishPig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DanishPig.md new file mode 100644 index 000000000000..4d6ec1400a7e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DanishPig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DanishPig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DeprecatedObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DeprecatedObject.md new file mode 100644 index 000000000000..e90c59555a0d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DeprecatedObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DeprecatedObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Dog.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Dog.md new file mode 100644 index 000000000000..70cdc80e83e0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Dog.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DogAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DogAllOf.md new file mode 100644 index 000000000000..31618dfb2197 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/DogAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DogAllOf + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Drawing.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Drawing.md new file mode 100644 index 000000000000..18117e6c938c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Drawing.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Drawing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MainShape** | [**Shape**](Shape.md) | | [optional] +**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**Shapes** | [**List<Shape>**](Shape.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumArrays.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumArrays.md new file mode 100644 index 000000000000..c40bb19edd5e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumArrays.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EnumArrays + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumClass.md new file mode 100644 index 000000000000..d259f0f46968 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumClass.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumTest.md new file mode 100644 index 000000000000..d2b72b5368fb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumTest.md @@ -0,0 +1,18 @@ +# Org.OpenAPITools.Model.EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | **string** | | [optional] +**EnumStringRequired** | **string** | | +**EnumInteger** | **int** | | [optional] +**EnumIntegerOnly** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EquilateralTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EquilateralTriangle.md new file mode 100644 index 000000000000..8360b5c16a5b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EquilateralTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EquilateralTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/File.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/File.md new file mode 100644 index 000000000000..58b9c2fc3698 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/File.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.File +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FileSchemaTestClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FileSchemaTestClass.md new file mode 100644 index 000000000000..a47efad77d8a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Foo.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Foo.md new file mode 100644 index 000000000000..b9e7d261736f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Foo.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Foo + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md new file mode 100644 index 000000000000..b0d2f47b2eb6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md @@ -0,0 +1,25 @@ +# Org.OpenAPITools.Model.FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] +**Decimal** | **decimal** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | +**Binary** | **System.IO.Stream** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] +**Password** | **string** | | +**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Fruit.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Fruit.md new file mode 100644 index 000000000000..cb095b74f324 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Fruit.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] +**LengthCm** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FruitReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FruitReq.md new file mode 100644 index 000000000000..5afd947f4a63 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FruitReq.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.FruitReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [optional] +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/GmFruit.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/GmFruit.md new file mode 100644 index 000000000000..049f6f5c1574 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/GmFruit.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.GmFruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] +**LengthCm** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/GrandparentAnimal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/GrandparentAnimal.md new file mode 100644 index 000000000000..eca96162b6f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/GrandparentAnimal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GrandparentAnimal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/HasOnlyReadOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/HasOnlyReadOnly.md new file mode 100644 index 000000000000..060a614a6981 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Foo** | **string** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/HealthCheckResult.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/HealthCheckResult.md new file mode 100644 index 000000000000..682cfc50e3a4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/HealthCheckResult.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HealthCheckResult +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/InlineResponseDefault.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/InlineResponseDefault.md new file mode 100644 index 000000000000..0c1b0d5bb022 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/InlineResponseDefault.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.InlineResponseDefault + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/IsoscelesTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/IsoscelesTriangle.md new file mode 100644 index 000000000000..07c62ac93382 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/IsoscelesTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.IsoscelesTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/List.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/List.md new file mode 100644 index 000000000000..417d332b3afd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/List.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Mammal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Mammal.md new file mode 100644 index 000000000000..79d95fce63a3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Mammal.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Mammal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [optional] +**ClassName** | **string** | | +**Type** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MapTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MapTest.md new file mode 100644 index 000000000000..03bcebd3d9b2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MapTest.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | **Dictionary<string, string>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..031d2b960653 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Model200Response.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Model200Response.md new file mode 100644 index 000000000000..8bc8049f46f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Model200Response.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Model200Response +Model for testing model name starting with number + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ModelClient.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ModelClient.md new file mode 100644 index 000000000000..9e0e83645f30 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ModelClient.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ModelClient + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Name.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Name.md new file mode 100644 index 000000000000..1fbf5dd5e8b6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Name.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Name +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] [readonly] +**Property** | **string** | | [optional] +**_123Number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NullableClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NullableClass.md new file mode 100644 index 000000000000..d4a19d1856bc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NullableClass.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | **int?** | | [optional] +**NumberProp** | **decimal?** | | [optional] +**BooleanProp** | **bool?** | | [optional] +**StringProp** | **string** | | [optional] +**DateProp** | **DateTime?** | | [optional] +**DatetimeProp** | **DateTime?** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NullableShape.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NullableShape.md new file mode 100644 index 000000000000..570ef48f98fc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NullableShape.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.NullableShape +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NumberOnly.md new file mode 100644 index 000000000000..1b83cce764d3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/NumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ObjectWithDeprecatedFields.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..b737f7d757af --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ObjectWithDeprecatedFields.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.ObjectWithDeprecatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **string** | | [optional] +**Id** | **decimal** | | [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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Order.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Order.md new file mode 100644 index 000000000000..ca5d8992a513 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Order.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] +**Status** | **string** | Order Status | [optional] +**Complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterComposite.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterComposite.md new file mode 100644 index 000000000000..abf676810fb6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterComposite.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | **decimal** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnum.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnum.md new file mode 100644 index 000000000000..36844bc4b175 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumDefaultValue.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..351383f0aeae --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumInteger.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumInteger.md new file mode 100644 index 000000000000..1013b5b19565 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..55e314e3102d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ParentPet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ParentPet.md new file mode 100644 index 000000000000..bdf570056372 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ParentPet.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ParentPet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pet.md new file mode 100644 index 000000000000..6a9d41feb0d6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pet.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **string** | | +**PhotoUrls** | **List<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/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pig.md new file mode 100644 index 000000000000..fd7bb9359ac4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Pig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Quadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Quadrilateral.md new file mode 100644 index 000000000000..bb7507997a2f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Quadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Quadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/QuadrilateralInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/QuadrilateralInterface.md new file mode 100644 index 000000000000..756ba09c6ddf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/QuadrilateralInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.QuadrilateralInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ReadOnlyFirst.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ReadOnlyFirst.md new file mode 100644 index 000000000000..afaf2ee4fb6c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Baz** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Return.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Return.md new file mode 100644 index 000000000000..a1dadccc421d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Return.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Return +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ScaleneTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ScaleneTriangle.md new file mode 100644 index 000000000000..d3f15354bccc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ScaleneTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ScaleneTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Shape.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Shape.md new file mode 100644 index 000000000000..5627c30bbfc7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Shape.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Shape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ShapeInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ShapeInterface.md new file mode 100644 index 000000000000..882d31868305 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ShapeInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ShapeInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ShapeOrNull.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ShapeOrNull.md new file mode 100644 index 000000000000..a348f4f8bff5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ShapeOrNull.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ShapeOrNull +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/SimpleQuadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/SimpleQuadrilateral.md new file mode 100644 index 000000000000..a36c9957a609 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/SimpleQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SimpleQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/SpecialModelName.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/SpecialModelName.md new file mode 100644 index 000000000000..fa146367bdea --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/SpecialModelName.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | **long** | | [optional] +**_SpecialModelName** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Tag.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Tag.md new file mode 100644 index 000000000000..2b2d9674d619 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Tag.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Triangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Triangle.md new file mode 100644 index 000000000000..74232c3ced98 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Triangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Triangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TriangleInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TriangleInterface.md new file mode 100644 index 000000000000..4127c08b14f3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TriangleInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TriangleInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/User.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/User.md new file mode 100644 index 000000000000..a0f0d2238998 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/User.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Username** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Email** | **string** | | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] +**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**AnyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**AnyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Whale.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Whale.md new file mode 100644 index 000000000000..afbc08409d22 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Whale.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Whale + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [optional] +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Zebra.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Zebra.md new file mode 100644 index 000000000000..4c5a820bac04 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Zebra.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Zebra + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | | [optional] +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/scripts/git_push.ps1 new file mode 100644 index 000000000000..0a2d4e52280a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your prefered git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/scripts/git_push.sh b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/scripts/git_push.sh new file mode 100644 index 000000000000..882104922184 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 000000000000..fea7e39428f6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing AnotherFakeApi + /// + public sealed class AnotherFakeApiTests : ApiTestsBase + { + private readonly IAnotherFakeApi _instance; + + public AnotherFakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test Call123TestSpecialTags + /// + [Fact (Skip = "not implemented")] + public async Task Call123TestSpecialTagsAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.Call123TestSpecialTagsAsync(modelClient); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 000000000000..88d6fc1f4880 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + ApiKeyToken apiKeyToken = new ApiKeyToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken(context.Configuration[""], context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + }); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 000000000000..062cf4363669 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test FooGet + /// + [Fact (Skip = "not implemented")] + public async Task FooGetAsyncTest() + { + var response = await _instance.FooGetAsync(); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 000000000000..4eee3d2b6eb4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,230 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, options) => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, options) => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var anotherFakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs new file mode 100644 index 000000000000..a730ebd21acf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeApi + /// + public sealed class FakeApiTests : ApiTestsBase + { + private readonly IFakeApi _instance; + + public FakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test FakeHealthGet + /// + [Fact (Skip = "not implemented")] + public async Task FakeHealthGetAsyncTest() + { + var response = await _instance.FakeHealthGetAsync(); + Assert.IsType(response); + } + + /// + /// Test FakeOuterBooleanSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterBooleanSerializeAsyncTest() + { + bool? body = default; + var response = await _instance.FakeOuterBooleanSerializeAsync(body); + Assert.IsType(response); + } + + /// + /// Test FakeOuterCompositeSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterCompositeSerializeAsyncTest() + { + OuterComposite outerComposite = default; + var response = await _instance.FakeOuterCompositeSerializeAsync(outerComposite); + Assert.IsType(response); + } + + /// + /// Test FakeOuterNumberSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterNumberSerializeAsyncTest() + { + decimal? body = default; + var response = await _instance.FakeOuterNumberSerializeAsync(body); + Assert.IsType(response); + } + + /// + /// Test FakeOuterStringSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterStringSerializeAsyncTest() + { + string body = default; + var response = await _instance.FakeOuterStringSerializeAsync(body); + Assert.IsType(response); + } + + /// + /// Test GetArrayOfEnums + /// + [Fact (Skip = "not implemented")] + public async Task GetArrayOfEnumsAsyncTest() + { + var response = await _instance.GetArrayOfEnumsAsync(); + Assert.IsType>(response); + } + + /// + /// Test TestBodyWithFileSchema + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithFileSchemaAsyncTest() + { + FileSchemaTestClass fileSchemaTestClass = default; + await _instance.TestBodyWithFileSchemaAsync(fileSchemaTestClass); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithQueryParamsAsyncTest() + { + string query = default; + User user = default; + await _instance.TestBodyWithQueryParamsAsync(query, user); + } + + /// + /// Test TestClientModel + /// + [Fact (Skip = "not implemented")] + public async Task TestClientModelAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClientModelAsync(modelClient); + Assert.IsType(response); + } + + /// + /// Test TestEndpointParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEndpointParametersAsyncTest() + { + decimal number = default; + double _double = default; + string patternWithoutDelimiter = default; + byte[] _byte = default; + int? integer = default; + int? int32 = default; + long? int64 = default; + float? _float = default; + string _string = default; + System.IO.Stream binary = default; + DateTime? date = default; + DateTime? dateTime = default; + string password = default; + string callback = default; + await _instance.TestEndpointParametersAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + + /// + /// Test TestEnumParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEnumParametersAsyncTest() + { + List enumHeaderStringArray = default; + string enumHeaderString = default; + List enumQueryStringArray = default; + string enumQueryString = default; + int? enumQueryInteger = default; + double? enumQueryDouble = default; + List enumFormStringArray = default; + string enumFormString = default; + await _instance.TestEnumParametersAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /// + /// Test TestGroupParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestGroupParametersAsyncTest() + { + int requiredStringGroup = default; + bool requiredBooleanGroup = default; + long requiredInt64Group = default; + int? stringGroup = default; + bool? booleanGroup = default; + long? int64Group = default; + await _instance.TestGroupParametersAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /// + /// Test TestInlineAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineAdditionalPropertiesAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestInlineAdditionalPropertiesAsync(requestBody); + } + + /// + /// Test TestJsonFormData + /// + [Fact (Skip = "not implemented")] + public async Task TestJsonFormDataAsyncTest() + { + string param = default; + string param2 = default; + await _instance.TestJsonFormDataAsync(param, param2); + } + + /// + /// Test TestQueryParameterCollectionFormat + /// + [Fact (Skip = "not implemented")] + public async Task TestQueryParameterCollectionFormatAsyncTest() + { + List pipe = default; + List ioutil = default; + List http = default; + List url = default; + List context = default; + await _instance.TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 000000000000..0e8d44fe985a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + public sealed class FakeClassnameTags123ApiTests : ApiTestsBase + { + private readonly IFakeClassnameTags123Api _instance; + + public FakeClassnameTags123ApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test TestClassname + /// + [Fact (Skip = "not implemented")] + public async Task TestClassnameAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClassnameAsync(modelClient); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/PetApiTests.cs new file mode 100644 index 000000000000..92922eda1b7f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + public sealed class PetApiTests : ApiTestsBase + { + private readonly IPetApi _instance; + + public PetApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test AddPet + /// + [Fact (Skip = "not implemented")] + public async Task AddPetAsyncTest() + { + Pet pet = default; + await _instance.AddPetAsync(pet); + } + + /// + /// Test DeletePet + /// + [Fact (Skip = "not implemented")] + public async Task DeletePetAsyncTest() + { + long petId = default; + string apiKey = default; + await _instance.DeletePetAsync(petId, apiKey); + } + + /// + /// Test FindPetsByStatus + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByStatusAsyncTest() + { + List status = default; + var response = await _instance.FindPetsByStatusAsync(status); + Assert.IsType>(response); + } + + /// + /// Test FindPetsByTags + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByTagsAsyncTest() + { + List tags = default; + var response = await _instance.FindPetsByTagsAsync(tags); + Assert.IsType>(response); + } + + /// + /// Test GetPetById + /// + [Fact (Skip = "not implemented")] + public async Task GetPetByIdAsyncTest() + { + long petId = default; + var response = await _instance.GetPetByIdAsync(petId); + Assert.IsType(response); + } + + /// + /// Test UpdatePet + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetAsyncTest() + { + Pet pet = default; + await _instance.UpdatePetAsync(pet); + } + + /// + /// Test UpdatePetWithForm + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetWithFormAsyncTest() + { + long petId = default; + string name = default; + string status = default; + await _instance.UpdatePetWithFormAsync(petId, name, status); + } + + /// + /// Test UploadFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileAsyncTest() + { + long petId = default; + string additionalMetadata = default; + System.IO.Stream file = default; + var response = await _instance.UploadFileAsync(petId, additionalMetadata, file); + Assert.IsType(response); + } + + /// + /// Test UploadFileWithRequiredFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileWithRequiredFileAsyncTest() + { + long petId = default; + System.IO.Stream requiredFile = default; + string additionalMetadata = default; + var response = await _instance.UploadFileWithRequiredFileAsync(petId, requiredFile, additionalMetadata); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs new file mode 100644 index 000000000000..98748893e324 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + public sealed class StoreApiTests : ApiTestsBase + { + private readonly IStoreApi _instance; + + public StoreApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test DeleteOrder + /// + [Fact (Skip = "not implemented")] + public async Task DeleteOrderAsyncTest() + { + string orderId = default; + await _instance.DeleteOrderAsync(orderId); + } + + /// + /// Test GetInventory + /// + [Fact (Skip = "not implemented")] + public async Task GetInventoryAsyncTest() + { + var response = await _instance.GetInventoryAsync(); + Assert.IsType>(response); + } + + /// + /// Test GetOrderById + /// + [Fact (Skip = "not implemented")] + public async Task GetOrderByIdAsyncTest() + { + long orderId = default; + var response = await _instance.GetOrderByIdAsync(orderId); + Assert.IsType(response); + } + + /// + /// Test PlaceOrder + /// + [Fact (Skip = "not implemented")] + public async Task PlaceOrderAsyncTest() + { + Order order = default; + var response = await _instance.PlaceOrderAsync(order); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/UserApiTests.cs new file mode 100644 index 000000000000..0df256733af7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -0,0 +1,137 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + public sealed class UserApiTests : ApiTestsBase + { + private readonly IUserApi _instance; + + public UserApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test CreateUser + /// + [Fact (Skip = "not implemented")] + public async Task CreateUserAsyncTest() + { + User user = default; + await _instance.CreateUserAsync(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithArrayInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithArrayInputAsync(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithListInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithListInputAsync(user); + } + + /// + /// Test DeleteUser + /// + [Fact (Skip = "not implemented")] + public async Task DeleteUserAsyncTest() + { + string username = default; + await _instance.DeleteUserAsync(username); + } + + /// + /// Test GetUserByName + /// + [Fact (Skip = "not implemented")] + public async Task GetUserByNameAsyncTest() + { + string username = default; + var response = await _instance.GetUserByNameAsync(username); + Assert.IsType(response); + } + + /// + /// Test LoginUser + /// + [Fact (Skip = "not implemented")] + public async Task LoginUserAsyncTest() + { + string username = default; + string password = default; + var response = await _instance.LoginUserAsync(username, password); + Assert.IsType(response); + } + + /// + /// Test LogoutUser + /// + [Fact (Skip = "not implemented")] + public async Task LogoutUserAsyncTest() + { + await _instance.LogoutUserAsync(); + } + + /// + /// Test UpdateUser + /// + [Fact (Skip = "not implemented")] + public async Task UpdateUserAsyncTest() + { + string username = default; + User user = default; + await _instance.UpdateUserAsync(username, user); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs new file mode 100644 index 000000000000..9ab029ed0979 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -0,0 +1,126 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing AdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AdditionalPropertiesClass + //private AdditionalPropertiesClass instance; + + public AdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of AdditionalPropertiesClass + //instance = new AdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AdditionalPropertiesClass + /// + [Fact] + public void AdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" AdditionalPropertiesClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MapProperty' + /// + [Fact] + public void MapPropertyTest() + { + // TODO unit test for the property 'MapProperty' + } + /// + /// Test the property 'MapOfMapProperty' + /// + [Fact] + public void MapOfMapPropertyTest() + { + // TODO unit test for the property 'MapOfMapProperty' + } + /// + /// Test the property 'Anytype1' + /// + [Fact] + public void Anytype1Test() + { + // TODO unit test for the property 'Anytype1' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype1' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype1Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype1' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype2' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype2Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype2' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype3' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype3Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype3' + } + /// + /// Test the property 'EmptyMap' + /// + [Fact] + public void EmptyMapTest() + { + // TODO unit test for the property 'EmptyMap' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesString' + /// + [Fact] + public void MapWithUndeclaredPropertiesStringTest() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs new file mode 100644 index 000000000000..291231a91bef --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Animal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Animal + //private Animal instance; + + public AnimalTests() + { + // TODO uncomment below to create an instance of Animal + //instance = new Animal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Animal + /// + [Fact] + public void AnimalInstanceTest() + { + // TODO uncomment below to test "IsType" Animal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Dog from type Animal + /// + [Fact] + public void DogDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Dog from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Dog().ToJson())); + } + /// + /// Test deserialize a Cat from type Animal + /// + [Fact] + public void CatDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Cat from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Cat().ToJson())); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs new file mode 100644 index 000000000000..2a2e098e6082 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Fact] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs new file mode 100644 index 000000000000..f945f6593685 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing AppleReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AppleReq + //private AppleReq instance; + + public AppleReqTests() + { + // TODO uncomment below to create an instance of AppleReq + //instance = new AppleReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AppleReq + /// + [Fact] + public void AppleReqInstanceTest() + { + // TODO uncomment below to test "IsType" AppleReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 000000000000..468d60184ada --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 000000000000..0b259d7d3916 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly + //private ArrayOfArrayOfNumberOnly instance; + + public ArrayOfArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly + //instance = new ArrayOfArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Fact] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfArrayOfNumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Fact] + public void ArrayArrayNumberTest() + { + // TODO unit test for the property 'ArrayArrayNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs new file mode 100644 index 000000000000..27f312ad25f5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfNumberOnly + //private ArrayOfNumberOnly instance; + + public ArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfNumberOnly + //instance = new ArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfNumberOnly + /// + [Fact] + public void ArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfNumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayNumber' + /// + [Fact] + public void ArrayNumberTest() + { + // TODO unit test for the property 'ArrayNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs new file mode 100644 index 000000000000..a433e8c87cf7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayTest + //private ArrayTest instance; + + public ArrayTestTests() + { + // TODO uncomment below to create an instance of ArrayTest + //instance = new ArrayTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayTest + /// + [Fact] + public void ArrayTestInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayOfString' + /// + [Fact] + public void ArrayOfStringTest() + { + // TODO unit test for the property 'ArrayOfString' + } + /// + /// Test the property 'ArrayArrayOfInteger' + /// + [Fact] + public void ArrayArrayOfIntegerTest() + { + // TODO unit test for the property 'ArrayArrayOfInteger' + } + /// + /// Test the property 'ArrayArrayOfModel' + /// + [Fact] + public void ArrayArrayOfModelTest() + { + // TODO unit test for the property 'ArrayArrayOfModel' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs new file mode 100644 index 000000000000..8a6eeb82eeea --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing BananaReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BananaReq + //private BananaReq instance; + + public BananaReqTests() + { + // TODO uncomment below to create an instance of BananaReq + //instance = new BananaReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BananaReq + /// + [Fact] + public void BananaReqInstanceTest() + { + // TODO uncomment below to test "IsType" BananaReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 000000000000..8d8cc376b038 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs new file mode 100644 index 000000000000..3cdccaa75959 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing BasquePig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BasquePigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BasquePig + //private BasquePig instance; + + public BasquePigTests() + { + // TODO uncomment below to create an instance of BasquePig + //instance = new BasquePig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BasquePig + /// + [Fact] + public void BasquePigInstanceTest() + { + // TODO uncomment below to test "IsType" BasquePig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs new file mode 100644 index 000000000000..185c83666fc7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Capitalization + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CapitalizationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Capitalization + //private Capitalization instance; + + public CapitalizationTests() + { + // TODO uncomment below to create an instance of Capitalization + //instance = new Capitalization(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Capitalization + /// + [Fact] + public void CapitalizationInstanceTest() + { + // TODO uncomment below to test "IsType" Capitalization + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SmallCamel' + /// + [Fact] + public void SmallCamelTest() + { + // TODO unit test for the property 'SmallCamel' + } + /// + /// Test the property 'CapitalCamel' + /// + [Fact] + public void CapitalCamelTest() + { + // TODO unit test for the property 'CapitalCamel' + } + /// + /// Test the property 'SmallSnake' + /// + [Fact] + public void SmallSnakeTest() + { + // TODO unit test for the property 'SmallSnake' + } + /// + /// Test the property 'CapitalSnake' + /// + [Fact] + public void CapitalSnakeTest() + { + // TODO unit test for the property 'CapitalSnake' + } + /// + /// Test the property 'SCAETHFlowPoints' + /// + [Fact] + public void SCAETHFlowPointsTest() + { + // TODO unit test for the property 'SCAETHFlowPoints' + } + /// + /// Test the property 'ATT_NAME' + /// + [Fact] + public void ATT_NAMETest() + { + // TODO unit test for the property 'ATT_NAME' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs new file mode 100644 index 000000000000..fb51c28489cb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing CatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CatAllOf + //private CatAllOf instance; + + public CatAllOfTests() + { + // TODO uncomment below to create an instance of CatAllOf + //instance = new CatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of CatAllOf + /// + [Fact] + public void CatAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" CatAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatTests.cs new file mode 100644 index 000000000000..701ba7602823 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Cat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Cat + //private Cat instance; + + public CatTests() + { + // TODO uncomment below to create an instance of Cat + //instance = new Cat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Cat + /// + [Fact] + public void CatInstanceTest() + { + // TODO uncomment below to test "IsType" Cat + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs new file mode 100644 index 000000000000..6ce48e601e47 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Category + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CategoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + public CategoryTests() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Category + /// + [Fact] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs new file mode 100644 index 000000000000..49a539324904 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ChildCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCatAllOf + //private ChildCatAllOf instance; + + public ChildCatAllOfTests() + { + // TODO uncomment below to create an instance of ChildCatAllOf + //instance = new ChildCatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCatAllOf + /// + [Fact] + public void ChildCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCatAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs new file mode 100644 index 000000000000..68566fd8d560 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ChildCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCat + //private ChildCat instance; + + public ChildCatTests() + { + // TODO uncomment below to create an instance of ChildCat + //instance = new ChildCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCat + /// + [Fact] + public void ChildCatInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCat + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs new file mode 100644 index 000000000000..d29472e83aaf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ClassModel + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ClassModelTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ClassModel + //private ClassModel instance; + + public ClassModelTests() + { + // TODO uncomment below to create an instance of ClassModel + //instance = new ClassModel(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ClassModel + /// + [Fact] + public void ClassModelInstanceTest() + { + // TODO uncomment below to test "IsType" ClassModel + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs new file mode 100644 index 000000000000..b3529280c8d6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ComplexQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ComplexQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ComplexQuadrilateral + //private ComplexQuadrilateral instance; + + public ComplexQuadrilateralTests() + { + // TODO uncomment below to create an instance of ComplexQuadrilateral + //instance = new ComplexQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ComplexQuadrilateral + /// + [Fact] + public void ComplexQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" ComplexQuadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs new file mode 100644 index 000000000000..572d9bffa790 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DanishPig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DanishPigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DanishPig + //private DanishPig instance; + + public DanishPigTests() + { + // TODO uncomment below to create an instance of DanishPig + //instance = new DanishPig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DanishPig + /// + [Fact] + public void DanishPigInstanceTest() + { + // TODO uncomment below to test "IsType" DanishPig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs new file mode 100644 index 000000000000..1da5f4011c95 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DeprecatedObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DeprecatedObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DeprecatedObject + //private DeprecatedObject instance; + + public DeprecatedObjectTests() + { + // TODO uncomment below to create an instance of DeprecatedObject + //instance = new DeprecatedObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DeprecatedObject + /// + [Fact] + public void DeprecatedObjectInstanceTest() + { + // TODO uncomment below to test "IsType" DeprecatedObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs new file mode 100644 index 000000000000..b22a44420963 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DogAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DogAllOf + //private DogAllOf instance; + + public DogAllOfTests() + { + // TODO uncomment below to create an instance of DogAllOf + //instance = new DogAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DogAllOf + /// + [Fact] + public void DogAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" DogAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogTests.cs new file mode 100644 index 000000000000..992f93a51fd5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Dog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Dog + //private Dog instance; + + public DogTests() + { + // TODO uncomment below to create an instance of Dog + //instance = new Dog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Dog + /// + [Fact] + public void DogInstanceTest() + { + // TODO uncomment below to test "IsType" Dog + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs new file mode 100644 index 000000000000..0709ad9eeb3b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Drawing + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DrawingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Drawing + //private Drawing instance; + + public DrawingTests() + { + // TODO uncomment below to create an instance of Drawing + //instance = new Drawing(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Drawing + /// + [Fact] + public void DrawingInstanceTest() + { + // TODO uncomment below to test "IsType" Drawing + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MainShape' + /// + [Fact] + public void MainShapeTest() + { + // TODO unit test for the property 'MainShape' + } + /// + /// Test the property 'ShapeOrNull' + /// + [Fact] + public void ShapeOrNullTest() + { + // TODO unit test for the property 'ShapeOrNull' + } + /// + /// Test the property 'NullableShape' + /// + [Fact] + public void NullableShapeTest() + { + // TODO unit test for the property 'NullableShape' + } + /// + /// Test the property 'Shapes' + /// + [Fact] + public void ShapesTest() + { + // TODO unit test for the property 'Shapes' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs new file mode 100644 index 000000000000..5779ca294775 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumArrays + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArrays + //private EnumArrays instance; + + public EnumArraysTests() + { + // TODO uncomment below to create an instance of EnumArrays + //instance = new EnumArrays(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArrays + /// + [Fact] + public void EnumArraysInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArrays + //Assert.IsType(instance); + } + + + /// + /// Test the property 'JustSymbol' + /// + [Fact] + public void JustSymbolTest() + { + // TODO unit test for the property 'JustSymbol' + } + /// + /// Test the property 'ArrayEnum' + /// + [Fact] + public void ArrayEnumTest() + { + // TODO unit test for the property 'ArrayEnum' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs new file mode 100644 index 000000000000..a17738c5cbc5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumClass + //private EnumClass instance; + + public EnumClassTests() + { + // TODO uncomment below to create an instance of EnumClass + //instance = new EnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumClass + /// + [Fact] + public void EnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" EnumClass + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs new file mode 100644 index 000000000000..4f81b845d493 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTest + //private EnumTest instance; + + public EnumTestTests() + { + // TODO uncomment below to create an instance of EnumTest + //instance = new EnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTest + /// + [Fact] + public void EnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EnumString' + /// + [Fact] + public void EnumStringTest() + { + // TODO unit test for the property 'EnumString' + } + /// + /// Test the property 'EnumStringRequired' + /// + [Fact] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + /// + /// Test the property 'EnumInteger' + /// + [Fact] + public void EnumIntegerTest() + { + // TODO unit test for the property 'EnumInteger' + } + /// + /// Test the property 'EnumIntegerOnly' + /// + [Fact] + public void EnumIntegerOnlyTest() + { + // TODO unit test for the property 'EnumIntegerOnly' + } + /// + /// Test the property 'EnumNumber' + /// + [Fact] + public void EnumNumberTest() + { + // TODO unit test for the property 'EnumNumber' + } + /// + /// Test the property 'OuterEnum' + /// + [Fact] + public void OuterEnumTest() + { + // TODO unit test for the property 'OuterEnum' + } + /// + /// Test the property 'OuterEnumInteger' + /// + [Fact] + public void OuterEnumIntegerTest() + { + // TODO unit test for the property 'OuterEnumInteger' + } + /// + /// Test the property 'OuterEnumDefaultValue' + /// + [Fact] + public void OuterEnumDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumDefaultValue' + } + /// + /// Test the property 'OuterEnumIntegerDefaultValue' + /// + [Fact] + public void OuterEnumIntegerDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumIntegerDefaultValue' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs new file mode 100644 index 000000000000..4663cb667de6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EquilateralTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EquilateralTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EquilateralTriangle + //private EquilateralTriangle instance; + + public EquilateralTriangleTests() + { + // TODO uncomment below to create an instance of EquilateralTriangle + //instance = new EquilateralTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EquilateralTriangle + /// + [Fact] + public void EquilateralTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" EquilateralTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs new file mode 100644 index 000000000000..9f45b4fe89d5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FileSchemaTestClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileSchemaTestClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FileSchemaTestClass + //private FileSchemaTestClass instance; + + public FileSchemaTestClassTests() + { + // TODO uncomment below to create an instance of FileSchemaTestClass + //instance = new FileSchemaTestClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FileSchemaTestClass + /// + [Fact] + public void FileSchemaTestClassInstanceTest() + { + // TODO uncomment below to test "IsType" FileSchemaTestClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + /// + /// Test the property 'Files' + /// + [Fact] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileTests.cs new file mode 100644 index 000000000000..761bb72a844f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing File + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileTests : IDisposable + { + // TODO uncomment below to declare an instance variable for File + //private File instance; + + public FileTests() + { + // TODO uncomment below to create an instance of File + //instance = new File(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of File + /// + [Fact] + public void FileInstanceTest() + { + // TODO uncomment below to test "IsType" File + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SourceURI' + /// + [Fact] + public void SourceURITest() + { + // TODO unit test for the property 'SourceURI' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooTests.cs new file mode 100644 index 000000000000..0b6ed52edbd4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Foo + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Foo + //private Foo instance; + + public FooTests() + { + // TODO uncomment below to create an instance of Foo + //instance = new Foo(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Foo + /// + [Fact] + public void FooInstanceTest() + { + // TODO uncomment below to test "IsType" Foo + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs new file mode 100644 index 000000000000..97332800e9af --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -0,0 +1,190 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FormatTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FormatTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FormatTest + //private FormatTest instance; + + public FormatTestTests() + { + // TODO uncomment below to create an instance of FormatTest + //instance = new FormatTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FormatTest + /// + [Fact] + public void FormatTestInstanceTest() + { + // TODO uncomment below to test "IsType" FormatTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Integer' + /// + [Fact] + public void IntegerTest() + { + // TODO unit test for the property 'Integer' + } + /// + /// Test the property 'Int32' + /// + [Fact] + public void Int32Test() + { + // TODO unit test for the property 'Int32' + } + /// + /// Test the property 'Int64' + /// + [Fact] + public void Int64Test() + { + // TODO unit test for the property 'Int64' + } + /// + /// Test the property 'Number' + /// + [Fact] + public void NumberTest() + { + // TODO unit test for the property 'Number' + } + /// + /// Test the property 'Float' + /// + [Fact] + public void FloatTest() + { + // TODO unit test for the property 'Float' + } + /// + /// Test the property 'Double' + /// + [Fact] + public void DoubleTest() + { + // TODO unit test for the property 'Double' + } + /// + /// Test the property 'Decimal' + /// + [Fact] + public void DecimalTest() + { + // TODO unit test for the property 'Decimal' + } + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + /// + /// Test the property 'Byte' + /// + [Fact] + public void ByteTest() + { + // TODO unit test for the property 'Byte' + } + /// + /// Test the property 'Binary' + /// + [Fact] + public void BinaryTest() + { + // TODO unit test for the property 'Binary' + } + /// + /// Test the property 'Date' + /// + [Fact] + public void DateTest() + { + // TODO unit test for the property 'Date' + } + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'PatternWithDigits' + /// + [Fact] + public void PatternWithDigitsTest() + { + // TODO unit test for the property 'PatternWithDigits' + } + /// + /// Test the property 'PatternWithDigitsAndDelimiter' + /// + [Fact] + public void PatternWithDigitsAndDelimiterTest() + { + // TODO unit test for the property 'PatternWithDigitsAndDelimiter' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs new file mode 100644 index 000000000000..5ea9e3ffc1d5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FruitReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FruitReq + //private FruitReq instance; + + public FruitReqTests() + { + // TODO uncomment below to create an instance of FruitReq + //instance = new FruitReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FruitReq + /// + [Fact] + public void FruitReqInstanceTest() + { + // TODO uncomment below to test "IsType" FruitReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 000000000000..91e069bb42fa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs new file mode 100644 index 000000000000..08fb0e07a1c8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GmFruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GmFruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GmFruit + //private GmFruit instance; + + public GmFruitTests() + { + // TODO uncomment below to create an instance of GmFruit + //instance = new GmFruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GmFruit + /// + [Fact] + public void GmFruitInstanceTest() + { + // TODO uncomment below to test "IsType" GmFruit + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs new file mode 100644 index 000000000000..75f4fd8b0e52 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -0,0 +1,88 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GrandparentAnimal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GrandparentAnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GrandparentAnimal + //private GrandparentAnimal instance; + + public GrandparentAnimalTests() + { + // TODO uncomment below to create an instance of GrandparentAnimal + //instance = new GrandparentAnimal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GrandparentAnimal + /// + [Fact] + public void GrandparentAnimalInstanceTest() + { + // TODO uncomment below to test "IsType" GrandparentAnimal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ParentPet from type GrandparentAnimal + /// + [Fact] + public void ParentPetDeserializeFromGrandparentAnimalTest() + { + // TODO uncomment below to test deserialize a ParentPet from type GrandparentAnimal + //Assert.IsType(JsonConvert.DeserializeObject(new ParentPet().ToJson())); + } + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs new file mode 100644 index 000000000000..651a9f0ce30c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing HasOnlyReadOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HasOnlyReadOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HasOnlyReadOnly + //private HasOnlyReadOnly instance; + + public HasOnlyReadOnlyTests() + { + // TODO uncomment below to create an instance of HasOnlyReadOnly + //instance = new HasOnlyReadOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HasOnlyReadOnly + /// + [Fact] + public void HasOnlyReadOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" HasOnlyReadOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Foo' + /// + [Fact] + public void FooTest() + { + // TODO unit test for the property 'Foo' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs new file mode 100644 index 000000000000..857190a3334d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing HealthCheckResult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HealthCheckResultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HealthCheckResult + //private HealthCheckResult instance; + + public HealthCheckResultTests() + { + // TODO uncomment below to create an instance of HealthCheckResult + //instance = new HealthCheckResult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HealthCheckResult + /// + [Fact] + public void HealthCheckResultInstanceTest() + { + // TODO uncomment below to test "IsType" HealthCheckResult + //Assert.IsType(instance); + } + + + /// + /// Test the property 'NullableMessage' + /// + [Fact] + public void NullableMessageTest() + { + // TODO unit test for the property 'NullableMessage' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs new file mode 100644 index 000000000000..7731f80c16db --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing InlineResponseDefault + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class InlineResponseDefaultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for InlineResponseDefault + //private InlineResponseDefault instance; + + public InlineResponseDefaultTests() + { + // TODO uncomment below to create an instance of InlineResponseDefault + //instance = new InlineResponseDefault(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of InlineResponseDefault + /// + [Fact] + public void InlineResponseDefaultInstanceTest() + { + // TODO uncomment below to test "IsType" InlineResponseDefault + //Assert.IsType(instance); + } + + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs new file mode 100644 index 000000000000..755c417cc54f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing IsoscelesTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class IsoscelesTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for IsoscelesTriangle + //private IsoscelesTriangle instance; + + public IsoscelesTriangleTests() + { + // TODO uncomment below to create an instance of IsoscelesTriangle + //instance = new IsoscelesTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of IsoscelesTriangle + /// + [Fact] + public void IsoscelesTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" IsoscelesTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ListTests.cs new file mode 100644 index 000000000000..2ed828d05208 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing List + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for List + //private List instance; + + public ListTests() + { + // TODO uncomment below to create an instance of List + //instance = new List(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of List + /// + [Fact] + public void ListInstanceTest() + { + // TODO uncomment below to test "IsType" List + //Assert.IsType(instance); + } + + + /// + /// Test the property '_123List' + /// + [Fact] + public void _123ListTest() + { + // TODO unit test for the property '_123List' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs new file mode 100644 index 000000000000..7b46cbf06450 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Mammal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MammalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Mammal + //private Mammal instance; + + public MammalTests() + { + // TODO uncomment below to create an instance of Mammal + //instance = new Mammal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Mammal + /// + [Fact] + public void MammalInstanceTest() + { + // TODO uncomment below to test "IsType" Mammal + //Assert.IsType(instance); + } + + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs new file mode 100644 index 000000000000..20036e1c905e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MapTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTest + //private MapTest instance; + + public MapTestTests() + { + // TODO uncomment below to create an instance of MapTest + //instance = new MapTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTest + /// + [Fact] + public void MapTestInstanceTest() + { + // TODO uncomment below to test "IsType" MapTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MapMapOfString' + /// + [Fact] + public void MapMapOfStringTest() + { + // TODO unit test for the property 'MapMapOfString' + } + /// + /// Test the property 'MapOfEnumString' + /// + [Fact] + public void MapOfEnumStringTest() + { + // TODO unit test for the property 'MapOfEnumString' + } + /// + /// Test the property 'DirectMap' + /// + [Fact] + public void DirectMapTest() + { + // TODO unit test for the property 'DirectMap' + } + /// + /// Test the property 'IndirectMap' + /// + [Fact] + public void IndirectMapTest() + { + // TODO unit test for the property 'IndirectMap' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs new file mode 100644 index 000000000000..f56cd715f45f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixedPropertiesAndAdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedPropertiesAndAdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass + //private MixedPropertiesAndAdditionalPropertiesClass instance; + + public MixedPropertiesAndAdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass + //instance = new MixedPropertiesAndAdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass + /// + [Fact] + public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" MixedPropertiesAndAdditionalPropertiesClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Map' + /// + [Fact] + public void MapTest() + { + // TODO unit test for the property 'Map' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs new file mode 100644 index 000000000000..e25478618f20 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Model200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class Model200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Model200Response + //private Model200Response instance; + + public Model200ResponseTests() + { + // TODO uncomment below to create an instance of Model200Response + //instance = new Model200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Model200Response + /// + [Fact] + public void Model200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" Model200Response + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs new file mode 100644 index 000000000000..24a9e2631586 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ModelClient + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ModelClientTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ModelClient + //private ModelClient instance; + + public ModelClientTests() + { + // TODO uncomment below to create an instance of ModelClient + //instance = new ModelClient(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ModelClient + /// + [Fact] + public void ModelClientInstanceTest() + { + // TODO uncomment below to test "IsType" ModelClient + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Client' + /// + [Fact] + public void _ClientTest() + { + // TODO unit test for the property '_Client' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NameTests.cs new file mode 100644 index 000000000000..c390049e66dc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Name + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Name + //private Name instance; + + public NameTests() + { + // TODO uncomment below to create an instance of Name + //instance = new Name(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Name + /// + [Fact] + public void NameInstanceTest() + { + // TODO uncomment below to test "IsType" Name + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Name' + /// + [Fact] + public void _NameTest() + { + // TODO unit test for the property '_Name' + } + /// + /// Test the property 'SnakeCase' + /// + [Fact] + public void SnakeCaseTest() + { + // TODO unit test for the property 'SnakeCase' + } + /// + /// Test the property 'Property' + /// + [Fact] + public void PropertyTest() + { + // TODO unit test for the property 'Property' + } + /// + /// Test the property '_123Number' + /// + [Fact] + public void _123NumberTest() + { + // TODO unit test for the property '_123Number' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs new file mode 100644 index 000000000000..8f00505612a9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NullableClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableClass + //private NullableClass instance; + + public NullableClassTests() + { + // TODO uncomment below to create an instance of NullableClass + //instance = new NullableClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableClass + /// + [Fact] + public void NullableClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'IntegerProp' + /// + [Fact] + public void IntegerPropTest() + { + // TODO unit test for the property 'IntegerProp' + } + /// + /// Test the property 'NumberProp' + /// + [Fact] + public void NumberPropTest() + { + // TODO unit test for the property 'NumberProp' + } + /// + /// Test the property 'BooleanProp' + /// + [Fact] + public void BooleanPropTest() + { + // TODO unit test for the property 'BooleanProp' + } + /// + /// Test the property 'StringProp' + /// + [Fact] + public void StringPropTest() + { + // TODO unit test for the property 'StringProp' + } + /// + /// Test the property 'DateProp' + /// + [Fact] + public void DatePropTest() + { + // TODO unit test for the property 'DateProp' + } + /// + /// Test the property 'DatetimeProp' + /// + [Fact] + public void DatetimePropTest() + { + // TODO unit test for the property 'DatetimeProp' + } + /// + /// Test the property 'ArrayNullableProp' + /// + [Fact] + public void ArrayNullablePropTest() + { + // TODO unit test for the property 'ArrayNullableProp' + } + /// + /// Test the property 'ArrayAndItemsNullableProp' + /// + [Fact] + public void ArrayAndItemsNullablePropTest() + { + // TODO unit test for the property 'ArrayAndItemsNullableProp' + } + /// + /// Test the property 'ArrayItemsNullable' + /// + [Fact] + public void ArrayItemsNullableTest() + { + // TODO unit test for the property 'ArrayItemsNullable' + } + /// + /// Test the property 'ObjectNullableProp' + /// + [Fact] + public void ObjectNullablePropTest() + { + // TODO unit test for the property 'ObjectNullableProp' + } + /// + /// Test the property 'ObjectAndItemsNullableProp' + /// + [Fact] + public void ObjectAndItemsNullablePropTest() + { + // TODO unit test for the property 'ObjectAndItemsNullableProp' + } + /// + /// Test the property 'ObjectItemsNullable' + /// + [Fact] + public void ObjectItemsNullableTest() + { + // TODO unit test for the property 'ObjectItemsNullable' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs new file mode 100644 index 000000000000..5662f91d6e64 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NullableShape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableShape + //private NullableShape instance; + + public NullableShapeTests() + { + // TODO uncomment below to create an instance of NullableShape + //instance = new NullableShape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableShape + /// + [Fact] + public void NullableShapeInstanceTest() + { + // TODO uncomment below to test "IsType" NullableShape + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs new file mode 100644 index 000000000000..3a06cb020b2a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NumberOnly + //private NumberOnly instance; + + public NumberOnlyTests() + { + // TODO uncomment below to create an instance of NumberOnly + //instance = new NumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NumberOnly + /// + [Fact] + public void NumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" NumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'JustNumber' + /// + [Fact] + public void JustNumberTest() + { + // TODO unit test for the property 'JustNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs new file mode 100644 index 000000000000..82f93fab48c5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ObjectWithDeprecatedFields + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ObjectWithDeprecatedFieldsTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ObjectWithDeprecatedFields + //private ObjectWithDeprecatedFields instance; + + public ObjectWithDeprecatedFieldsTests() + { + // TODO uncomment below to create an instance of ObjectWithDeprecatedFields + //instance = new ObjectWithDeprecatedFields(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ObjectWithDeprecatedFields + /// + [Fact] + public void ObjectWithDeprecatedFieldsInstanceTest() + { + // TODO uncomment below to test "IsType" ObjectWithDeprecatedFields + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'DeprecatedRef' + /// + [Fact] + public void DeprecatedRefTest() + { + // TODO unit test for the property 'DeprecatedRef' + } + /// + /// Test the property 'Bars' + /// + [Fact] + public void BarsTest() + { + // TODO unit test for the property 'Bars' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs new file mode 100644 index 000000000000..cf5c561c5476 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Fact] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'PetId' + /// + [Fact] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + /// + /// Test the property 'Quantity' + /// + [Fact] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + /// + /// Test the property 'ShipDate' + /// + [Fact] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + /// + /// Test the property 'Complete' + /// + [Fact] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs new file mode 100644 index 000000000000..2efda0db59c4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterComposite + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterCompositeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + public OuterCompositeTests() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterComposite + /// + [Fact] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsType" OuterComposite + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MyNumber' + /// + [Fact] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + /// + /// Test the property 'MyString' + /// + [Fact] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + /// + /// Test the property 'MyBoolean' + /// + [Fact] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs new file mode 100644 index 000000000000..986fff774c46 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumDefaultValue + //private OuterEnumDefaultValue instance; + + public OuterEnumDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumDefaultValue + //instance = new OuterEnumDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumDefaultValue + /// + [Fact] + public void OuterEnumDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumDefaultValue + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs new file mode 100644 index 000000000000..015d5dab945e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumIntegerDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumIntegerDefaultValue + //private OuterEnumIntegerDefaultValue instance; + + public OuterEnumIntegerDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumIntegerDefaultValue + //instance = new OuterEnumIntegerDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumIntegerDefaultValue + /// + [Fact] + public void OuterEnumIntegerDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumIntegerDefaultValue + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs new file mode 100644 index 000000000000..385e899110a4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumInteger + //private OuterEnumInteger instance; + + public OuterEnumIntegerTests() + { + // TODO uncomment below to create an instance of OuterEnumInteger + //instance = new OuterEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumInteger + /// + [Fact] + public void OuterEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumInteger + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs new file mode 100644 index 000000000000..f47304767b9e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnum + //private OuterEnum instance; + + public OuterEnumTests() + { + // TODO uncomment below to create an instance of OuterEnum + //instance = new OuterEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnum + /// + [Fact] + public void OuterEnumInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnum + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs new file mode 100644 index 000000000000..1e17568ed331 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ParentPet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ParentPetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ParentPet + //private ParentPet instance; + + public ParentPetTests() + { + // TODO uncomment below to create an instance of ParentPet + //instance = new ParentPet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ParentPet + /// + [Fact] + public void ParentPetInstanceTest() + { + // TODO uncomment below to test "IsType" ParentPet + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PetTests.cs new file mode 100644 index 000000000000..154e66f8dfc0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + public PetTests() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pet + /// + [Fact] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsType" Pet + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PhotoUrls' + /// + [Fact] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PigTests.cs new file mode 100644 index 000000000000..55cf2189046b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Pig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pig + //private Pig instance; + + public PigTests() + { + // TODO uncomment below to create an instance of Pig + //instance = new Pig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pig + /// + [Fact] + public void PigInstanceTest() + { + // TODO uncomment below to test "IsType" Pig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs new file mode 100644 index 000000000000..6eef9f4c816d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing QuadrilateralInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for QuadrilateralInterface + //private QuadrilateralInterface instance; + + public QuadrilateralInterfaceTests() + { + // TODO uncomment below to create an instance of QuadrilateralInterface + //instance = new QuadrilateralInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of QuadrilateralInterface + /// + [Fact] + public void QuadrilateralInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" QuadrilateralInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs new file mode 100644 index 000000000000..26826681a478 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Quadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Quadrilateral + //private Quadrilateral instance; + + public QuadrilateralTests() + { + // TODO uncomment below to create an instance of Quadrilateral + //instance = new Quadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Quadrilateral + /// + [Fact] + public void QuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" Quadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs new file mode 100644 index 000000000000..dc3d0fad54cd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ReadOnlyFirst + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReadOnlyFirstTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ReadOnlyFirst + //private ReadOnlyFirst instance; + + public ReadOnlyFirstTests() + { + // TODO uncomment below to create an instance of ReadOnlyFirst + //instance = new ReadOnlyFirst(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ReadOnlyFirst + /// + [Fact] + public void ReadOnlyFirstInstanceTest() + { + // TODO uncomment below to test "IsType" ReadOnlyFirst + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Baz' + /// + [Fact] + public void BazTest() + { + // TODO unit test for the property 'Baz' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs new file mode 100644 index 000000000000..c8c1d6510d2f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReturnTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + public ReturnTests() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Return + /// + [Fact] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsType" Return + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Return' + /// + [Fact] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs new file mode 100644 index 000000000000..04cb9f1ab6b1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ScaleneTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ScaleneTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ScaleneTriangle + //private ScaleneTriangle instance; + + public ScaleneTriangleTests() + { + // TODO uncomment below to create an instance of ScaleneTriangle + //instance = new ScaleneTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ScaleneTriangle + /// + [Fact] + public void ScaleneTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" ScaleneTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs new file mode 100644 index 000000000000..7bd0bc86f963 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ShapeInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeInterface + //private ShapeInterface instance; + + public ShapeInterfaceTests() + { + // TODO uncomment below to create an instance of ShapeInterface + //instance = new ShapeInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeInterface + /// + [Fact] + public void ShapeInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs new file mode 100644 index 000000000000..d0af114157c9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ShapeOrNull + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeOrNullTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeOrNull + //private ShapeOrNull instance; + + public ShapeOrNullTests() + { + // TODO uncomment below to create an instance of ShapeOrNull + //instance = new ShapeOrNull(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeOrNull + /// + [Fact] + public void ShapeOrNullInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeOrNull + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs new file mode 100644 index 000000000000..b01bd531f857 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Shape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Shape + //private Shape instance; + + public ShapeTests() + { + // TODO uncomment below to create an instance of Shape + //instance = new Shape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Shape + /// + [Fact] + public void ShapeInstanceTest() + { + // TODO uncomment below to test "IsType" Shape + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs new file mode 100644 index 000000000000..6648e9809281 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SimpleQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SimpleQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SimpleQuadrilateral + //private SimpleQuadrilateral instance; + + public SimpleQuadrilateralTests() + { + // TODO uncomment below to create an instance of SimpleQuadrilateral + //instance = new SimpleQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SimpleQuadrilateral + /// + [Fact] + public void SimpleQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" SimpleQuadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 000000000000..0f0e1ff12a9e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SpecialModelName + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialModelNameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SpecialModelName + //private SpecialModelName instance; + + public SpecialModelNameTests() + { + // TODO uncomment below to create an instance of SpecialModelName + //instance = new SpecialModelName(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SpecialModelName + /// + [Fact] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsType" SpecialModelName + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SpecialPropertyName' + /// + [Fact] + public void SpecialPropertyNameTest() + { + // TODO unit test for the property 'SpecialPropertyName' + } + /// + /// Test the property '_SpecialModelName' + /// + [Fact] + public void _SpecialModelNameTest() + { + // TODO unit test for the property '_SpecialModelName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TagTests.cs new file mode 100644 index 000000000000..6d56232d0a76 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Fact] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs new file mode 100644 index 000000000000..fba65470bee6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TriangleInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TriangleInterface + //private TriangleInterface instance; + + public TriangleInterfaceTests() + { + // TODO uncomment below to create an instance of TriangleInterface + //instance = new TriangleInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TriangleInterface + /// + [Fact] + public void TriangleInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" TriangleInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs new file mode 100644 index 000000000000..bdaab0b47965 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Triangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Triangle + //private Triangle instance; + + public TriangleTests() + { + // TODO uncomment below to create an instance of Triangle + //instance = new Triangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Triangle + /// + [Fact] + public void TriangleInstanceTest() + { + // TODO uncomment below to test "IsType" Triangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/UserTests.cs new file mode 100644 index 000000000000..a7b095e4c28e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Fact] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'Phone' + /// + [Fact] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + /// + /// Test the property 'UserStatus' + /// + [Fact] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + /// + /// Test the property 'ObjectWithNoDeclaredProps' + /// + [Fact] + public void ObjectWithNoDeclaredPropsTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredProps' + } + /// + /// Test the property 'ObjectWithNoDeclaredPropsNullable' + /// + [Fact] + public void ObjectWithNoDeclaredPropsNullableTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' + } + /// + /// Test the property 'AnyTypeProp' + /// + [Fact] + public void AnyTypePropTest() + { + // TODO unit test for the property 'AnyTypeProp' + } + /// + /// Test the property 'AnyTypePropNullable' + /// + [Fact] + public void AnyTypePropNullableTest() + { + // TODO unit test for the property 'AnyTypePropNullable' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs new file mode 100644 index 000000000000..09610791943c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Whale + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class WhaleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Whale + //private Whale instance; + + public WhaleTests() + { + // TODO uncomment below to create an instance of Whale + //instance = new Whale(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Whale + /// + [Fact] + public void WhaleInstanceTest() + { + // TODO uncomment below to test "IsType" Whale + //Assert.IsType(instance); + } + + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs new file mode 100644 index 000000000000..f44e92131400 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Zebra + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Zebra + //private Zebra instance; + + public ZebraTests() + { + // TODO uncomment below to create an instance of Zebra + //instance = new Zebra(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Zebra + /// + [Fact] + public void ZebraInstanceTest() + { + // TODO uncomment below to test "IsType" Zebra + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 000000000000..d5b9ccb183d8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,20 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net6.0 + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs new file mode 100644 index 000000000000..04fbded6ac35 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -0,0 +1,247 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApi : IApi + { + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ModelClient>> + Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient> + Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class AnotherFakeApi : IAnotherFakeApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + + if ((modelClient as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Patch; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/another-fake/dummy")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 000000000000..ca94212113b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,221 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApi : IApi + { + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<InlineResponseDefault>> + Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<InlineResponseDefault> + Task FooGetAsync(System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class DefaultApi : IDefaultApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/foo"; + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/foo")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs new file mode 100644 index 000000000000..23b051d8c53d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -0,0 +1,2404 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApi : IApi + { + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<HealthCheckResult>> + Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<HealthCheckResult> + Task FakeHealthGetAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<bool>> + Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<bool> + Task FakeOuterBooleanSerializeAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<OuterComposite>> + Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<OuterComposite> + Task FakeOuterCompositeSerializeAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<decimal>> + Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<decimal> + Task FakeOuterNumberSerializeAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<string>> + Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<string> + Task FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<OuterEnum>>> + Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<OuterEnum>> + Task> GetArrayOfEnumsAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestBodyWithQueryParamsWithHttpInfoAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ModelClient>> + Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient> + Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestEndpointParametersWithHttpInfoAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestEndpointParametersAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestEnumParametersWithHttpInfoAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestEnumParametersAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestGroupParametersWithHttpInfoAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestGroupParametersAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeApi : IFakeApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/health")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + + if ((body as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/boolean")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeOrDefaultAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + + if ((outerComposite as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(outerComposite, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/composite")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + + if ((body as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/number")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + + if ((body as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/string")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task> GetArrayOfEnumsAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task> GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = null; + try + { + result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/array-of-enums")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (fileSchemaTestClass == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + + if ((fileSchemaTestClass as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(fileSchemaTestClass, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-file-schema")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestBodyWithQueryParamsWithHttpInfoAsync(query, user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsOrDefaultAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestBodyWithQueryParamsWithHttpInfoAsync(query, user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestBodyWithQueryParamsWithHttpInfoAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (query == null) + throw new ArgumentNullException(nameof(query)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["query"] = Uri.EscapeDataString(query.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-query-params")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + if ((modelClient as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Patch; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestEndpointParametersWithHttpInfoAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersOrDefaultAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestEndpointParametersWithHttpInfoAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestEndpointParametersWithHttpInfoAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (patternWithoutDelimiter == null) + throw new ArgumentNullException(nameof(patternWithoutDelimiter)); + + if (_byte == null) + throw new ArgumentNullException(nameof(_byte)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (integer != null) + formParams.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer))); + + if (int32 != null) + formParams.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32))); + + if (int64 != null) + formParams.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64))); + + formParams.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + + if (_float != null) + formParams.Add(new KeyValuePair("float", ClientUtils.ParameterToString(_float))); + + formParams.Add(new KeyValuePair("double", ClientUtils.ParameterToString(_double))); + + if (_string != null) + formParams.Add(new KeyValuePair("string", ClientUtils.ParameterToString(_string))); + + formParams.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + + formParams.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(_byte))); + + if (binary != null) + multipartContent.Add(new StreamContent(binary)); + + if (date != null) + formParams.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date))); + + if (dateTime != null) + formParams.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime))); + + if (password != null) + formParams.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password))); + + if (callback != null) + formParams.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback))); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(basicToken); + + basicToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersOrDefaultAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestEnumParametersWithHttpInfoAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + if (enumQueryStringArray != null) + parseQueryString["enum_query_string_array"] = Uri.EscapeDataString(enumQueryStringArray.ToString()); + + if (enumQueryString != null) + parseQueryString["enum_query_string"] = Uri.EscapeDataString(enumQueryString.ToString()); + + if (enumQueryInteger != null) + parseQueryString["enum_query_integer"] = Uri.EscapeDataString(enumQueryInteger.ToString()); + + if (enumQueryDouble != null) + parseQueryString["enum_query_double"] = Uri.EscapeDataString(enumQueryDouble.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + if (enumHeaderStringArray != null) + request.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray)); + + if (enumHeaderString != null) + request.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString)); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (enumFormStringArray != null) + formParams.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray))); + + if (enumFormString != null) + formParams.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString))); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestGroupParametersWithHttpInfoAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersOrDefaultAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestGroupParametersWithHttpInfoAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestGroupParametersWithHttpInfoAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["required_string_group"] = Uri.EscapeDataString(requiredStringGroup.ToString()); + parseQueryString["required_int64_group"] = Uri.EscapeDataString(requiredInt64Group.ToString()); + + if (stringGroup != null) + parseQueryString["string_group"] = Uri.EscapeDataString(stringGroup.ToString()); + + if (int64Group != null) + parseQueryString["int64_group"] = Uri.EscapeDataString(int64Group.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + request.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + + if (booleanGroup != null) + request.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(bearerToken); + + bearerToken.UseInHeader(request, ""); + + request.Method = HttpMethod.Delete; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + + if ((requestBody as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestBody, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/inline-additionalProperties")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (param == null) + throw new ArgumentNullException(nameof(param)); + + if (param2 == null) + throw new ArgumentNullException(nameof(param2)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + formParams.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + + formParams.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/jsonFormData")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (pipe == null) + throw new ArgumentNullException(nameof(pipe)); + + if (ioutil == null) + throw new ArgumentNullException(nameof(ioutil)); + + if (http == null) + throw new ArgumentNullException(nameof(http)); + + if (url == null) + throw new ArgumentNullException(nameof(url)); + + if (context == null) + throw new ArgumentNullException(nameof(context)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["pipe"] = Uri.EscapeDataString(pipe.ToString()); + parseQueryString["ioutil"] = Uri.EscapeDataString(ioutil.ToString()); + parseQueryString["http"] = Uri.EscapeDataString(http.ToString()); + parseQueryString["url"] = Uri.EscapeDataString(url.ToString()); + parseQueryString["context"] = Uri.EscapeDataString(context.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + request.RequestUri = uriBuilder.Uri; + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/test-query-parameters")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs new file mode 100644 index 000000000000..64db05ad389b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,262 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123Api : IApi + { + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ModelClient>> + Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient> + Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + if ((modelClient as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings)); + + List tokens = new List(); + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey); + + apiKey.UseInQuery(request, uriBuilder, parseQueryString, "api_key_query"); + + uriBuilder.Query = parseQueryString.ToString(); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Patch; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake_classname_test")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs new file mode 100644 index 000000000000..fc205708a1da --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs @@ -0,0 +1,1572 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApi : IApi + { + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task AddPetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> DeletePetWithHttpInfoAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task DeletePetAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<Pet>>> + Task>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Pet>> + Task> FindPetsByStatusAsync(List status, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<Pet>>> + Task>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Pet>> + Task> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Pet>> + Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Pet> + Task GetPetByIdAsync(long petId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task UpdatePetWithFormAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ApiResponse>> + Task> UploadFileWithHttpInfoAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ApiResponse> + Task UploadFileAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ApiResponse>> + Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ApiResponse> + Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PetApi : IPetApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet"; + + if ((pet as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetOrDefaultAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> DeletePetWithHttpInfoAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + if (apiKey != null) + request.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + request.Method = HttpMethod.Delete; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task> FindPetsByStatusAsync(List status, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task> FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = null; + try + { + result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (status == null) + throw new ArgumentNullException(nameof(status)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["status"] = Uri.EscapeDataString(status.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByStatus")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task> FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = null; + try + { + result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (tags == null) + throw new ArgumentNullException(nameof(tags)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["tags"] = Uri.EscapeDataString(tags.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByTags")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + List tokens = new List(); + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey); + + apiKey.UseInHeader(request, "api_key"); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet"; + + if ((pet as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormOrDefaultAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (name != null) + formParams.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name))); + + if (status != null) + formParams.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status))); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UploadFileWithHttpInfoAsync(petId, additionalMetadata, file, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileOrDefaultAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UploadFileWithHttpInfoAsync(petId, additionalMetadata, file, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UploadFileWithHttpInfoAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (additionalMetadata != null) + formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + + if (file != null) + multipartContent.Add(new StreamContent(file)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}/uploadImage")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UploadFileWithRequiredFileWithHttpInfoAsync(petId, requiredFile, additionalMetadata, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileOrDefaultAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UploadFileWithRequiredFileWithHttpInfoAsync(petId, requiredFile, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (requiredFile == null) + throw new ArgumentNullException(nameof(requiredFile)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (additionalMetadata != null) + formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + + multipartContent.Add(new StreamContent(requiredFile)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/{petId}/uploadImageWithRequiredFile")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/StoreApi.cs new file mode 100644 index 000000000000..2fbc676393c5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/StoreApi.cs @@ -0,0 +1,626 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApi : IApi + { + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Dictionary<string, int>>> + Task>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Dictionary<string, int>> + Task> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Order>> + Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Order> + Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Order>> + Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Order> + Task PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StoreApi : IStoreApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (orderId == null) + throw new ArgumentNullException(nameof(orderId)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + request.RequestUri = uriBuilder.Uri; + + request.Method = HttpMethod.Delete; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + + List tokens = new List(); + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey); + + apiKey.UseInHeader(request, "api_key"); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/inventory")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (order == null) + throw new ArgumentNullException(nameof(order)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + + if ((order as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(order, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs new file mode 100644 index 000000000000..389c19c783e1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs @@ -0,0 +1,1181 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApi : IApi + { + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<User>> + Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<User> + Task GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<string>> + Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<string> + Task LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> UpdateUserWithHttpInfoAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task UpdateUserAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class UserApi : IUserApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user"; + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithArray")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Post; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithList")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + request.RequestUri = uriBuilder.Uri; + + request.Method = HttpMethod.Delete; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (password == null) + throw new ArgumentNullException(nameof(password)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["username"] = Uri.EscapeDataString(username.ToString()); + parseQueryString["password"] = Uri.EscapeDataString(password.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/login")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + + request.RequestUri = uriBuilder.Uri; + + request.Method = HttpMethod.Get; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/logout")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UpdateUserWithHttpInfoAsync(username, user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserOrDefaultAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UpdateUserWithHttpInfoAsync(username, user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UpdateUserWithHttpInfoAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = HttpMethod.Put; + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 000000000000..7d4a463a9657 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,52 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the reponse + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiKeyToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiKeyToken.cs new file mode 100644 index 000000000000..a364874a105c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiKeyToken.cs @@ -0,0 +1,59 @@ +// + + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + public ApiKeyToken(string value, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the cookie. + /// + /// + /// + public virtual void UseInCookie(System.Net.Http.HttpRequestMessage request, string cookieName) + { + request.Headers.Add("Cookie", $"{ cookieName }=_raw"); + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Add(headerName, _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + /// + public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString, string parameterName) + { + parseQueryString[parameterName] = Uri.EscapeDataString(_raw).ToString(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 000000000000..e5da60003214 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,47 @@ +using System; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health. + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The time the request was sent. + /// + public DateTime RequestedAt { get; } + /// + /// The time the response was received. + /// + public DateTime ReceivedAt { get; } + /// + /// The HttpStatusCode received. + /// + public HttpStatusCode HttpStatus { get; } + /// + /// The path requested. + /// + public string Path { get; } + /// + /// The elapsed time from request to response. + /// + public TimeSpan ToTimeSpan => this.ReceivedAt - this.RequestedAt; + + /// + /// The event args used to track server health. + /// + /// + /// + /// + /// + public ApiResponseEventArgs(DateTime requestedAt, DateTime receivedAt, HttpStatusCode httpStatus, string path) + { + RequestedAt = requestedAt; + ReceivedAt = receivedAt; + HttpStatus = httpStatus; + Path = path; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 000000000000..04e92f7b19eb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,104 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + #region Properties + + /// + /// The deserialized content + /// + public T Content { get; set; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The raw data + /// + public string RawContent { get; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + #endregion Properties + + /// + /// Construct the reponse using an HttpResponseMessage + /// + /// + /// + public ApiResponse(System.Net.Http.HttpResponseMessage response, string rawContent) + { + StatusCode = response.StatusCode; + Headers = response.Headers; + IsSuccessStatusCode = response.IsSuccessStatusCode; + ReasonPhrase = response.ReasonPhrase; + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/BasicToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/BasicToken.cs new file mode 100644 index 000000000000..66cc12da4f66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/BasicToken.cs @@ -0,0 +1,44 @@ +// + + + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Org.OpenAPITools.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/BearerToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/BearerToken.cs new file mode 100644 index 000000000000..16f90e96c149 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/BearerToken.cs @@ -0,0 +1,39 @@ +// + + + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a token from a bearer token. + /// + public class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 000000000000..7a500bb08964 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,366 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; +using System.Net.Http; +using Org.OpenAPITools.Api; +using KellermanSoftware.CompareNetObjects; + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + compareLogic = new CompareLogic(); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Custom JSON serializer + /// + public static Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get; set; } = new Newtonsoft.Json.JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = Newtonsoft.Json.ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore, + ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver + { + NamingStrategy = new Newtonsoft.Json.Serialization.CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is System.Collections.ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// The base path of the API + /// + public const string BASE_ADDRESS = "http://petstore.swagger.io:80/v2"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v2"; + + /// + /// The host of the API + /// + public const string HOST = "petstore.swagger.io"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, config); + + AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + private static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circiut breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 000000000000..7581b3998404 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + where TAnotherFakeApi : class, IAnotherFakeApi + where TDefaultApi : class, IDefaultApi + where TFakeApi : class, IFakeApi + where TFakeClassnameTags123Api : class, IFakeClassnameTags123Api + where TPetApi : class, IPetApi + where TStoreApi : class, IStoreApi + where TUserApi : class, IUserApi + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients( + Action client = null, Action builder = null) + { + AddApiHttpClients(client, builder); + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(Client.ClientUtils.JsonSerializerSettings); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs new file mode 100644 index 000000000000..22d8834f4cb6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -0,0 +1,684 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace Org.OpenAPITools.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + #region + /// + /// Create an instance + /// + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + { + KeyId = keyId; + KeyFilePath = keyFilePath; + KeyPassPhrase = keyPassPhrase; + HttpSigningHeader = httpSigningHeader; + HashAlgorithm = hashAlgorithm; + SigningAlgorithm = signingAlgorithm; + SignatureValidityPeriod = signatureValidityPeriod; + } + #endregion + + #region Properties + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } = HashAlgorithmName.SHA256; + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validaty period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + #endregion + + #region enum + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + #endregion + + #region Methods + /// + /// Gets the Headers for HttpSigning + /// + /// + /// + /// + internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + if (request.RequestUri == null) + throw new NullReferenceException("The request URI was null"); + + const string HEADER_REQUEST_TARGET = "(request-target)"; + + // The time when the HTTP signature expires. The API server should reject HTTP requests that have expired. + const string HEADER_EXPIRES = "(expires)"; + + //The 'Date' header. + const string HEADER_DATE = "Date"; + + //The 'Host' header. + const string HEADER_HOST = "Host"; + + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + + var httpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + HttpSigningHeader.Add("(created)"); + + var dateTime = DateTime.Now; + string digest = String.Empty; + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + + foreach (var header in HttpSigningHeader) + if (header.Equals(HEADER_REQUEST_TARGET)) + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + httpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + HttpSignedRequestHeader.Add(HEADER_HOST, request.RequestUri.ToString()); + } + else if (header.Equals(HEADER_CREATED)) + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, digest); + httpSignatureHeader.Add(header.ToLower(), digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in request.Headers) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + httpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + + if (!isHeaderFound) + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + + var headersKeysString = String.Join(" ", httpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in httpSignatureHeader) + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + //Concatinate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + string headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + headerSignatureStr = GetRSASignature(signatureStringHash); + + else if (keyType == PrivateKeyType.ECDSA) + headerSignatureStr = GetECDSASignature(signatureStringHash); + + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (httpSignatureHeader.ContainsKey(HEADER_CREATED)) + authorizationHeaderValue += string.Format(",created={0}", httpSignatureHeader[HEADER_CREATED]); + + if (httpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + authorizationHeaderValue += string.Format(",expires={0}", httpSignatureHeader[HEADER_EXPIRES]); + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(string hashName, string stringToBeHashed) + { + var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + var stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (KeyPassPhrase == null) + throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); + + RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + + if (rsa == null) + return string.Empty; + else if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + if (!File.Exists(KeyFilePath)) + { + throw new Exception("key file path does not exist."); + } + + var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + var keyStr = File.ReadAllText(KeyFilePath); + var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); + var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); + var ecdsa = ECDsa.Create(); + +#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) + var byteCount = 0; + if (KeyPassPhrase != null) + { + IntPtr unmanagedString = IntPtr.Zero; + try + { + // convert secure string to byte array + unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(KeyPassPhrase); + + string ptrToStringUni = Marshal.PtrToStringUni(unmanagedString) ?? throw new NullReferenceException(); + + ecdsa.ImportEncryptedPkcs8PrivateKey(Encoding.UTF8.GetBytes(ptrToStringUni), keyBytes, out byteCount); + } + finally + { + if (unmanagedString != IntPtr.Zero) + Marshal.ZeroFreeBSTR(unmanagedString); + } + } + else + { + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); + } + var signedBytes = ecdsa.SignHash(dataToSign); + var derBytes = ConvertToECDSAANS1Format(signedBytes); + var signedString = System.Convert.ToBase64String(derBytes); + + return signedString; +#else + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); +#endif + + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + rBytes.Add(signedBytes[i]); + + for (int i = 32; i < 64; i++) + sBytes.Add(signedBytes[i]); + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r lenth, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile, SecureString keyPassPharse = null) + { + const String pempubheader = "-----BEGIN PUBLIC KEY-----"; + const String pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[] pemkey = null; + + if (!File.Exists(pemfile)) + throw new Exception("private key file does not exist."); + + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + isPrivateKeyFile = false; + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse); + + if (pemkey == null) + return null; + + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPharse = null) + { + const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; + String pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + return null; + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + String pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + return null; + + String saltline = str.ReadLine(); // TODO: what do we do here if ReadLine is null? + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + return null; + + String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + + if (!(str.ReadLine() == "")) + return null; + + //------ remaining b64 data is encrypted RSA key ---- + String encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 fromat + return null; + } + + // TODO: what do we do here if keyPassPharse is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPharse, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + return null; + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + + return rsakey; + } + } + + private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + binr.ReadByte(); //advance 1 byte + else if (twobytes == 0x8230) + binr.ReadInt16(); //advance 2 bytes + else + return null; + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + return null; + + bt = binr.ReadByte(); + if (bt != 0x00) + return null; + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + return 0; + + bt = binr.ReadByte(); + + if (bt == 0x81) + count = binr.ReadByte(); // data size in next byte + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + count = bt; // we already have the data size + + while (binr.ReadByte() == 0x00) + //remove high order zeros in data + count -= 1; + + binr.BaseStream.Seek(-1, SeekOrigin.Current); + + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = new MD5CryptoServiceProvider(); + byte[] result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + result = data00; //initialize + else + { + Array.Copy(result, hashtarget, result.Length); // TODO: what do we do if result is null here? + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result, 0, result.Length); // TODO: what do we do if result is null here? + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + throw new Exception("Key file path does not exist."); + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + keyType = PrivateKeyType.RSA; + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + keyType = PrivateKeyType.ECDSA; + + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + throw new Exception("Either the key is invalid or key is not supported"); + + return keyType; + } + #endregion + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HttpSigningToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HttpSigningToken.cs new file mode 100644 index 000000000000..7cc2dc394d7c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HttpSigningToken.cs @@ -0,0 +1,43 @@ +// + + + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an HttpSigningConfiguration + /// + public class HttpSignatureToken : TokenBase + { + private HttpSigningConfiguration _configuration; + + /// + /// Constructs an HttpSignatureToken object. + /// + /// + /// + public HttpSignatureToken(HttpSigningConfiguration configuration, TimeSpan? timeout = null) : base(timeout) + { + _configuration = configuration; + } + + /// + /// Places the token in the header. + /// + /// + /// + /// + public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken? cancellationToken = null) + { + var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); + + foreach (var signedHeader in signedHeaders) + request.Headers.Add(signedHeader.Key, signedHeader.Value); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/IApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/IApi.cs new file mode 100644 index 000000000000..bd74ad34fd3d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/IApi.cs @@ -0,0 +1,21 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Client +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + event ClientUtils.EventHandler ApiResponded; + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/OAuthToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/OAuthToken.cs new file mode 100644 index 000000000000..530e8211d821 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/OAuthToken.cs @@ -0,0 +1,39 @@ +// + + + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed with OAuth. + /// + public class OAuthToken : TokenBase + { + private string _raw; + + /// + /// Consturcts an OAuthToken object. + /// + /// + /// + public OAuthToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs new file mode 100644 index 000000000000..a5253e582013 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 000000000000..15cc15143c06 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,49 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Channel AvailableTokens { get; } + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens = Channel.CreateBounded(options); + + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => AvailableTokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null) + => await AvailableTokens.Reader.ReadAsync(cancellation.GetValueOrDefault()).ConfigureAwait(false); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 000000000000..7098850e99e2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,71 @@ +// + + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 000000000000..1be1b27f2a9f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,37 @@ +// + + + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 000000000000..cc3135247d17 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,44 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs new file mode 100644 index 000000000000..b3fc4c3c7a3a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Org.OpenAPITools.Model +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs new file mode 100644 index 000000000000..b3ddad35a07d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,224 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesClass + /// + [DataContract(Name = "AdditionalPropertiesClass")] + public partial class AdditionalPropertiesClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mapProperty. + /// mapOfMapProperty. + /// anytype1. + /// mapWithUndeclaredPropertiesAnytype1. + /// mapWithUndeclaredPropertiesAnytype2. + /// mapWithUndeclaredPropertiesAnytype3. + /// an object with no declared properties and no undeclared properties, hence it's an empty map.. + /// mapWithUndeclaredPropertiesString. + public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>), Object anytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype2 = default(Object), Dictionary mapWithUndeclaredPropertiesAnytype3 = default(Dictionary), Object emptyMap = default(Object), Dictionary mapWithUndeclaredPropertiesString = default(Dictionary)) + { + this.MapProperty = mapProperty; + this.MapOfMapProperty = mapOfMapProperty; + this.Anytype1 = anytype1; + this.MapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + this.MapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + this.MapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + this.EmptyMap = emptyMap; + this.MapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name = "map_property", EmitDefaultValue = false)] + public Dictionary MapProperty { get; set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name = "map_of_map_property", EmitDefaultValue = false)] + public Dictionary> MapOfMapProperty { get; set; } + + /// + /// Gets or Sets Anytype1 + /// + [DataMember(Name = "anytype_1", EmitDefaultValue = true)] + public Object Anytype1 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype1 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_1", EmitDefaultValue = false)] + public Object MapWithUndeclaredPropertiesAnytype1 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype2 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_2", EmitDefaultValue = false)] + public Object MapWithUndeclaredPropertiesAnytype2 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype3 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_3", EmitDefaultValue = false)] + public Dictionary MapWithUndeclaredPropertiesAnytype3 { get; set; } + + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + [DataMember(Name = "empty_map", EmitDefaultValue = false)] + public Object EmptyMap { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesString + /// + [DataMember(Name = "map_with_undeclared_properties_string", EmitDefaultValue = false)] + public Dictionary MapWithUndeclaredPropertiesString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype1: ").Append(MapWithUndeclaredPropertiesAnytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype2: ").Append(MapWithUndeclaredPropertiesAnytype2).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype3: ").Append(MapWithUndeclaredPropertiesAnytype3).Append("\n"); + sb.Append(" EmptyMap: ").Append(EmptyMap).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesString: ").Append(MapWithUndeclaredPropertiesString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as AdditionalPropertiesClass).AreEqual; + } + + /// + /// Returns true if AdditionalPropertiesClass instances are equal + /// + /// Instance of AdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(AdditionalPropertiesClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapProperty != null) + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } + if (this.MapOfMapProperty != null) + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } + if (this.Anytype1 != null) + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype1 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype2 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype3 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } + if (this.EmptyMap != null) + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesString != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs new file mode 100644 index 000000000000..e8ea00bb46a8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs @@ -0,0 +1,172 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Animal + /// + [DataContract(Name = "Animal")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] + public partial class Animal : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Animal() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + /// color (default to "red"). + public Animal(string className = default(string), string color = "red") + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } + this.ClassName = className; + // use default value if no "color" provided + this.Color = color ?? "red"; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name = "color", EmitDefaultValue = false)] + public string Color { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Animal).AreEqual; + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.Color != null) + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs new file mode 100644 index 000000000000..79873f4ddfed --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -0,0 +1,155 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ApiResponse + /// + [DataContract(Name = "ApiResponse")] + public partial class ApiResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// type. + /// message. + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) + { + this.Code = code; + this.Type = type; + this.Message = message; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name = "code", EmitDefaultValue = false)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ApiResponse).AreEqual; + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Code.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 000000000000..8b1f87d1aa9a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,159 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Apple + /// + [DataContract(Name = "apple")] + public partial class Apple : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// cultivar. + /// origin. + public Apple(string cultivar = default(string), string origin = default(string)) + { + this.Cultivar = cultivar; + this.Origin = origin; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Cultivar + /// + [DataMember(Name = "cultivar", EmitDefaultValue = false)] + public string Cultivar { get; set; } + + /// + /// Gets or Sets Origin + /// + [DataMember(Name = "origin", EmitDefaultValue = false)] + public string Origin { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Apple {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Origin: ").Append(Origin).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Apple).AreEqual; + } + + /// + /// Returns true if Apple instances are equal + /// + /// Instance of Apple to be compared + /// Boolean + public bool Equals(Apple input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cultivar != null) + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + if (this.Origin != null) + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // Cultivar (string) pattern + Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + if (false == regexCultivar.Match(this.Cultivar).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); + } + + // Origin (string) pattern + Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexOrigin.Match(this.Origin).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); + } + + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs new file mode 100644 index 000000000000..1d6d42dc9b3a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -0,0 +1,139 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// AppleReq + /// + [DataContract(Name = "appleReq")] + public partial class AppleReq : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AppleReq() { } + /// + /// Initializes a new instance of the class. + /// + /// cultivar (required). + /// mealy. + public AppleReq(string cultivar = default(string), bool mealy = default(bool)) + { + // to ensure "cultivar" is required (not null) + if (cultivar == null) { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } + this.Cultivar = cultivar; + this.Mealy = mealy; + } + + /// + /// Gets or Sets Cultivar + /// + [DataMember(Name = "cultivar", IsRequired = true, EmitDefaultValue = false)] + public string Cultivar { get; set; } + + /// + /// Gets or Sets Mealy + /// + [DataMember(Name = "mealy", EmitDefaultValue = true)] + public bool Mealy { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppleReq {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Mealy: ").Append(Mealy).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as AppleReq).AreEqual; + } + + /// + /// Returns true if AppleReq instances are equal + /// + /// Instance of AppleReq to be compared + /// Boolean + public bool Equals(AppleReq input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cultivar != null) + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 000000000000..30bf57ef0f52 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + [DataContract(Name = "ArrayOfArrayOfNumberOnly")] + public partial class ArrayOfArrayOfNumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber. + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + { + this.ArrayArrayNumber = arrayArrayNumber; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [DataMember(Name = "ArrayArrayNumber", EmitDefaultValue = false)] + public List> ArrayArrayNumber { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfArrayOfNumberOnly).AreEqual; + } + + /// + /// Returns true if ArrayOfArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfArrayOfNumberOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayArrayNumber != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs new file mode 100644 index 000000000000..8a215aad133b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayOfNumberOnly + /// + [DataContract(Name = "ArrayOfNumberOnly")] + public partial class ArrayOfNumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber. + public ArrayOfNumberOnly(List arrayNumber = default(List)) + { + this.ArrayNumber = arrayNumber; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ArrayNumber + /// + [DataMember(Name = "ArrayNumber", EmitDefaultValue = false)] + public List ArrayNumber { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfNumberOnly).AreEqual; + } + + /// + /// Returns true if ArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfNumberOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayNumber != null) + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs new file mode 100644 index 000000000000..1a879a1d9ca2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayTest + /// + [DataContract(Name = "ArrayTest")] + public partial class ArrayTest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayOfString. + /// arrayArrayOfInteger. + /// arrayArrayOfModel. + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + { + this.ArrayOfString = arrayOfString; + this.ArrayArrayOfInteger = arrayArrayOfInteger; + this.ArrayArrayOfModel = arrayArrayOfModel; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name = "array_of_string", EmitDefaultValue = false)] + public List ArrayOfString { get; set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name = "array_array_of_integer", EmitDefaultValue = false)] + public List> ArrayArrayOfInteger { get; set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name = "array_array_of_model", EmitDefaultValue = false)] + public List> ArrayArrayOfModel { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayTest).AreEqual; + } + + /// + /// Returns true if ArrayTest instances are equal + /// + /// Instance of ArrayTest to be compared + /// Boolean + public bool Equals(ArrayTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayOfString != null) + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } + if (this.ArrayArrayOfInteger != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } + if (this.ArrayArrayOfModel != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 000000000000..97939597ede8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Banana + /// + [DataContract(Name = "banana")] + public partial class Banana : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm. + public Banana(decimal lengthCm = default(decimal)) + { + this.LengthCm = lengthCm; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets LengthCm + /// + [DataMember(Name = "lengthCm", EmitDefaultValue = false)] + public decimal LengthCm { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Banana {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Banana).AreEqual; + } + + /// + /// Returns true if Banana instances are equal + /// + /// Instance of Banana to be compared + /// Boolean + public bool Equals(Banana input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs new file mode 100644 index 000000000000..fdd36929d13c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BananaReq + /// + [DataContract(Name = "bananaReq")] + public partial class BananaReq : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BananaReq() { } + /// + /// Initializes a new instance of the class. + /// + /// lengthCm (required). + /// sweet. + public BananaReq(decimal lengthCm = default(decimal), bool sweet = default(bool)) + { + this.LengthCm = lengthCm; + this.Sweet = sweet; + } + + /// + /// Gets or Sets LengthCm + /// + [DataMember(Name = "lengthCm", IsRequired = true, EmitDefaultValue = false)] + public decimal LengthCm { get; set; } + + /// + /// Gets or Sets Sweet + /// + [DataMember(Name = "sweet", EmitDefaultValue = true)] + public bool Sweet { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BananaReq {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" Sweet: ").Append(Sweet).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BananaReq).AreEqual; + } + + /// + /// Returns true if BananaReq instances are equal + /// + /// Instance of BananaReq to be compared + /// Boolean + public bool Equals(BananaReq input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs new file mode 100644 index 000000000000..ea4ff737c89a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BasquePig + /// + [DataContract(Name = "BasquePig")] + public partial class BasquePig : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BasquePig() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + public BasquePig(string className = default(string)) + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } + this.ClassName = className; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BasquePig {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BasquePig).AreEqual; + } + + /// + /// Returns true if BasquePig instances are equal + /// + /// Instance of BasquePig to be compared + /// Boolean + public bool Equals(BasquePig input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs new file mode 100644 index 000000000000..be68a50a116a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -0,0 +1,198 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Capitalization + /// + [DataContract(Name = "Capitalization")] + public partial class Capitalization : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// smallCamel. + /// capitalCamel. + /// smallSnake. + /// capitalSnake. + /// sCAETHFlowPoints. + /// Name of the pet . + public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + { + this.SmallCamel = smallCamel; + this.CapitalCamel = capitalCamel; + this.SmallSnake = smallSnake; + this.CapitalSnake = capitalSnake; + this.SCAETHFlowPoints = sCAETHFlowPoints; + this.ATT_NAME = aTTNAME; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SmallCamel + /// + [DataMember(Name = "smallCamel", EmitDefaultValue = false)] + public string SmallCamel { get; set; } + + /// + /// Gets or Sets CapitalCamel + /// + [DataMember(Name = "CapitalCamel", EmitDefaultValue = false)] + public string CapitalCamel { get; set; } + + /// + /// Gets or Sets SmallSnake + /// + [DataMember(Name = "small_Snake", EmitDefaultValue = false)] + public string SmallSnake { get; set; } + + /// + /// Gets or Sets CapitalSnake + /// + [DataMember(Name = "Capital_Snake", EmitDefaultValue = false)] + public string CapitalSnake { get; set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [DataMember(Name = "SCA_ETH_Flow_Points", EmitDefaultValue = false)] + public string SCAETHFlowPoints { get; set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [DataMember(Name = "ATT_NAME", EmitDefaultValue = false)] + public string ATT_NAME { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Capitalization {\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Capitalization).AreEqual; + } + + /// + /// Returns true if Capitalization instances are equal + /// + /// Instance of Capitalization to be compared + /// Boolean + public bool Equals(Capitalization input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SmallCamel != null) + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } + if (this.CapitalCamel != null) + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } + if (this.SmallSnake != null) + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } + if (this.CapitalSnake != null) + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } + if (this.SCAETHFlowPoints != null) + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } + if (this.ATT_NAME != null) + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs new file mode 100644 index 000000000000..2bc55707da95 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Cat + /// + [DataContract(Name = "Cat")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + public partial class Cat : Animal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Cat() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// declawed. + /// className (required) (default to "Cat"). + /// color (default to "red"). + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + { + this.Declawed = declawed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name = "declawed", EmitDefaultValue = true)] + public bool Declawed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Cat).AreEqual; + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs new file mode 100644 index 000000000000..3a960e9925e3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// CatAllOf + /// + [DataContract(Name = "Cat_allOf")] + public partial class CatAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public CatAllOf(bool declawed = default(bool)) + { + this.Declawed = declawed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name = "declawed", EmitDefaultValue = true)] + public bool Declawed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as CatAllOf).AreEqual; + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs new file mode 100644 index 000000000000..0cc23f5f6c23 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Category + /// + [DataContract(Name = "Category")] + public partial class Category : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Category() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name (required) (default to "default-name"). + public Category(long id = default(long), string name = "default-name") + { + // to ensure "name" is required (not null) + if (name == null) { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this.Name = name; + this.Id = id; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Category).AreEqual; + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCat.cs new file mode 100644 index 000000000000..7a15a5297df2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCat.cs @@ -0,0 +1,181 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ChildCat + /// + [DataContract(Name = "ChildCat")] + [JsonConverter(typeof(JsonSubtypes), "PetType")] + public partial class ChildCat : ParentPet, IEquatable, IValidatableObject + { + /// + /// Defines PetType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + [EnumMember(Value = "ChildCat")] + ChildCat = 1 + + } + + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)] + public PetTypeEnum PetType { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ChildCat() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// name. + /// petType (required) (default to PetTypeEnum.ChildCat). + public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base() + { + this.PetType = petType; + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ChildCat).AreEqual; + } + + /// + /// Returns true if ChildCat instances are equal + /// + /// Instance of ChildCat to be compared + /// Boolean + public bool Equals(ChildCat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs new file mode 100644 index 000000000000..a353ad7ffd71 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ChildCatAllOf + /// + [DataContract(Name = "ChildCat_allOf")] + public partial class ChildCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines PetType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + [EnumMember(Value = "ChildCat")] + ChildCat = 1 + + } + + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", EmitDefaultValue = false)] + public PetTypeEnum? PetType { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// name. + /// petType (default to PetTypeEnum.ChildCat). + public ChildCatAllOf(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) + { + this.Name = name; + this.PetType = petType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCatAllOf {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ChildCatAllOf).AreEqual; + } + + /// + /// Returns true if ChildCatAllOf instances are equal + /// + /// Instance of ChildCatAllOf to be compared + /// Boolean + public bool Equals(ChildCatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs new file mode 100644 index 000000000000..7177e9bf0b6c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model with \"_class\" property + /// + [DataContract(Name = "ClassModel")] + public partial class ClassModel : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _class. + public ClassModel(string _class = default(string)) + { + this.Class = _class; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Class + /// + [DataMember(Name = "_class", EmitDefaultValue = false)] + public string Class { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ClassModel {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ClassModel).AreEqual; + } + + /// + /// Returns true if ClassModel instances are equal + /// + /// Instance of ClassModel to be compared + /// Boolean + public bool Equals(ClassModel input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Class != null) + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs new file mode 100644 index 000000000000..807f0eb26bf8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ComplexQuadrilateral + /// + [DataContract(Name = "ComplexQuadrilateral")] + public partial class ComplexQuadrilateral : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ComplexQuadrilateral() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// quadrilateralType (required). + public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ComplexQuadrilateral {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ComplexQuadrilateral).AreEqual; + } + + /// + /// Returns true if ComplexQuadrilateral instances are equal + /// + /// Instance of ComplexQuadrilateral to be compared + /// Boolean + public bool Equals(ComplexQuadrilateral input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs new file mode 100644 index 000000000000..a27b1db39297 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DanishPig + /// + [DataContract(Name = "DanishPig")] + public partial class DanishPig : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DanishPig() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + public DanishPig(string className = default(string)) + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } + this.ClassName = className; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DanishPig {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DanishPig).AreEqual; + } + + /// + /// Returns true if DanishPig instances are equal + /// + /// Instance of DanishPig to be compared + /// Boolean + public bool Equals(DanishPig input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs new file mode 100644 index 000000000000..1928b236bf66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DeprecatedObject + /// + [DataContract(Name = "DeprecatedObject")] + public partial class DeprecatedObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public DeprecatedObject(string name = default(string)) + { + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DeprecatedObject {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DeprecatedObject).AreEqual; + } + + /// + /// Returns true if DeprecatedObject instances are equal + /// + /// Instance of DeprecatedObject to be compared + /// Boolean + public bool Equals(DeprecatedObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs new file mode 100644 index 000000000000..9cd520deaf82 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs @@ -0,0 +1,159 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Dog + /// + [DataContract(Name = "Dog")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + public partial class Dog : Animal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Dog() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// breed. + /// className (required) (default to "Dog"). + /// color (default to "red"). + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + { + this.Breed = breed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name = "breed", EmitDefaultValue = false)] + public string Breed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Dog).AreEqual; + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Breed != null) + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs new file mode 100644 index 000000000000..7b026acbf1e5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DogAllOf + /// + [DataContract(Name = "Dog_allOf")] + public partial class DogAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed. + public DogAllOf(string breed = default(string)) + { + this.Breed = breed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name = "breed", EmitDefaultValue = false)] + public string Breed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DogAllOf).AreEqual; + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Breed != null) + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs new file mode 100644 index 000000000000..d8cd2a70ef61 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Drawing + /// + [DataContract(Name = "Drawing")] + public partial class Drawing : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mainShape. + /// shapeOrNull. + /// nullableShape. + /// shapes. + public Drawing(Shape mainShape = default(Shape), ShapeOrNull shapeOrNull = default(ShapeOrNull), NullableShape nullableShape = default(NullableShape), List shapes = default(List)) : base() + { + this.MainShape = mainShape; + this.ShapeOrNull = shapeOrNull; + this.NullableShape = nullableShape; + this.Shapes = shapes; + } + + /// + /// Gets or Sets MainShape + /// + [DataMember(Name = "mainShape", EmitDefaultValue = false)] + public Shape MainShape { get; set; } + + /// + /// Gets or Sets ShapeOrNull + /// + [DataMember(Name = "shapeOrNull", EmitDefaultValue = false)] + public ShapeOrNull ShapeOrNull { get; set; } + + /// + /// Gets or Sets NullableShape + /// + [DataMember(Name = "nullableShape", EmitDefaultValue = true)] + public NullableShape NullableShape { get; set; } + + /// + /// Gets or Sets Shapes + /// + [DataMember(Name = "shapes", EmitDefaultValue = false)] + public List Shapes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Drawing {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" MainShape: ").Append(MainShape).Append("\n"); + sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n"); + sb.Append(" NullableShape: ").Append(NullableShape).Append("\n"); + sb.Append(" Shapes: ").Append(Shapes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Drawing).AreEqual; + } + + /// + /// Returns true if Drawing instances are equal + /// + /// Instance of Drawing to be compared + /// Boolean + public bool Equals(Drawing input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.MainShape != null) + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } + if (this.ShapeOrNull != null) + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } + if (this.NullableShape != null) + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } + if (this.Shapes != null) + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs new file mode 100644 index 000000000000..6d7830c0e8ba --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -0,0 +1,180 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// EnumArrays + /// + [DataContract(Name = "EnumArrays")] + public partial class EnumArrays : IEquatable, IValidatableObject + { + /// + /// Defines JustSymbol + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum JustSymbolEnum + { + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + [EnumMember(Value = ">=")] + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + [EnumMember(Value = "$")] + Dollar = 2 + + } + + + /// + /// Gets or Sets JustSymbol + /// + [DataMember(Name = "just_symbol", EmitDefaultValue = false)] + public JustSymbolEnum? JustSymbol { get; set; } + /// + /// Defines ArrayEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ArrayEnumEnum + { + /// + /// Enum Fish for value: fish + /// + [EnumMember(Value = "fish")] + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + [EnumMember(Value = "crab")] + Crab = 2 + + } + + + + /// + /// Gets or Sets ArrayEnum + /// + [DataMember(Name = "array_enum", EmitDefaultValue = false)] + public List ArrayEnum { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// justSymbol. + /// arrayEnum. + public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + { + this.JustSymbol = justSymbol; + this.ArrayEnum = arrayEnum; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnumArrays {\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumArrays).AreEqual; + } + + /// + /// Returns true if EnumArrays instances are equal + /// + /// Instance of EnumArrays to be compared + /// Boolean + public bool Equals(EnumArrays input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumClass.cs new file mode 100644 index 000000000000..48b3d7d0e7e0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumClass.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines EnumClass + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumClass + { + /// + /// Enum Abc for value: _abc + /// + [EnumMember(Value = "_abc")] + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + [EnumMember(Value = "-efg")] + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + [EnumMember(Value = "(xyz)")] + Xyz = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs new file mode 100644 index 000000000000..6f3d2272c5c3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -0,0 +1,323 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// EnumTest + /// + [DataContract(Name = "Enum_Test")] + public partial class EnumTest : IEquatable, IValidatableObject + { + /// + /// Defines EnumString + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + + } + + + /// + /// Gets or Sets EnumString + /// + [DataMember(Name = "enum_string", EmitDefaultValue = false)] + public EnumStringEnum? EnumString { get; set; } + /// + /// Defines EnumStringRequired + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringRequiredEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + + } + + + /// + /// Gets or Sets EnumStringRequired + /// + [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } + /// + /// Defines EnumInteger + /// + public enum EnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + + } + + + /// + /// Gets or Sets EnumInteger + /// + [DataMember(Name = "enum_integer", EmitDefaultValue = false)] + public EnumIntegerEnum? EnumInteger { get; set; } + /// + /// Defines EnumIntegerOnly + /// + public enum EnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + + } + + + /// + /// Gets or Sets EnumIntegerOnly + /// + [DataMember(Name = "enum_integer_only", EmitDefaultValue = false)] + public EnumIntegerOnlyEnum? EnumIntegerOnly { get; set; } + /// + /// Defines EnumNumber + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumNumberEnum + { + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + [EnumMember(Value = "1.1")] + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + [EnumMember(Value = "-1.2")] + NUMBER_MINUS_1_DOT_2 = 2 + + } + + + /// + /// Gets or Sets EnumNumber + /// + [DataMember(Name = "enum_number", EmitDefaultValue = false)] + public EnumNumberEnum? EnumNumber { get; set; } + + /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name = "outerEnum", EmitDefaultValue = true)] + public OuterEnum? OuterEnum { get; set; } + + /// + /// Gets or Sets OuterEnumInteger + /// + [DataMember(Name = "outerEnumInteger", EmitDefaultValue = false)] + public OuterEnumInteger? OuterEnumInteger { get; set; } + + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [DataMember(Name = "outerEnumDefaultValue", EmitDefaultValue = false)] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [DataMember(Name = "outerEnumIntegerDefaultValue", EmitDefaultValue = false)] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EnumTest() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// enumString. + /// enumStringRequired (required). + /// enumInteger. + /// enumIntegerOnly. + /// enumNumber. + /// outerEnum. + /// outerEnumInteger. + /// outerEnumDefaultValue. + /// outerEnumIntegerDefaultValue. + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumIntegerOnlyEnum? enumIntegerOnly = default(EnumIntegerOnlyEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?), OuterEnumInteger? outerEnumInteger = default(OuterEnumInteger?), OuterEnumDefaultValue? outerEnumDefaultValue = default(OuterEnumDefaultValue?), OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue?)) + { + this.EnumStringRequired = enumStringRequired; + this.EnumString = enumString; + this.EnumInteger = enumInteger; + this.EnumIntegerOnly = enumIntegerOnly; + this.EnumNumber = enumNumber; + this.OuterEnum = outerEnum; + this.OuterEnumInteger = outerEnumInteger; + this.OuterEnumDefaultValue = outerEnumDefaultValue; + this.OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnumTest {\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumTest).AreEqual; + } + + /// + /// Returns true if EnumTest instances are equal + /// + /// Instance of EnumTest to be compared + /// Boolean + public bool Equals(EnumTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs new file mode 100644 index 000000000000..a931c0d6327a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// EquilateralTriangle + /// + [DataContract(Name = "EquilateralTriangle")] + public partial class EquilateralTriangle : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EquilateralTriangle() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } + this.TriangleType = triangleType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EquilateralTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as EquilateralTriangle).AreEqual; + } + + /// + /// Returns true if EquilateralTriangle instances are equal + /// + /// Instance of EquilateralTriangle to be compared + /// Boolean + public bool Equals(EquilateralTriangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 000000000000..e77d15e06bce --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Must be named `File` for test. + /// + [DataContract(Name = "File")] + public partial class File : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization. + public File(string sourceURI = default(string)) + { + this.SourceURI = sourceURI; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Test capitalization + /// + /// Test capitalization + [DataMember(Name = "sourceURI", EmitDefaultValue = false)] + public string SourceURI { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as File).AreEqual; + } + + /// + /// Returns true if File instances are equal + /// + /// Instance of File to be compared + /// Boolean + public bool Equals(File input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SourceURI != null) + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 000000000000..6808978c49f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// FileSchemaTestClass + /// + [DataContract(Name = "FileSchemaTestClass")] + public partial class FileSchemaTestClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// file. + /// files. + public FileSchemaTestClass(File file = default(File), List files = default(List)) + { + this.File = file; + this.Files = files; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets File + /// + [DataMember(Name = "file", EmitDefaultValue = false)] + public File File { get; set; } + + /// + /// Gets or Sets Files + /// + [DataMember(Name = "files", EmitDefaultValue = false)] + public List Files { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as FileSchemaTestClass).AreEqual; + } + + /// + /// Returns true if FileSchemaTestClass instances are equal + /// + /// Instance of FileSchemaTestClass to be compared + /// Boolean + public bool Equals(FileSchemaTestClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.File != null) + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 000000000000..e64aac7b6317 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Foo + /// + [DataContract(Name = "Foo")] + public partial class Foo : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar"). + public Foo(string bar = "bar") + { + // use default value if no "bar" provided + this.Bar = bar ?? "bar"; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Foo {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Foo).AreEqual; + } + + /// + /// Returns true if Foo instances are equal + /// + /// Instance of Foo to be compared + /// Boolean + public bool Equals(Foo input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs new file mode 100644 index 000000000000..eb38d586bbb7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -0,0 +1,418 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// FormatTest + /// + [DataContract(Name = "format_test")] + public partial class FormatTest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FormatTest() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// integer. + /// int32. + /// int64. + /// number (required). + /// _float. + /// _double. + /// _decimal. + /// _string. + /// _byte (required). + /// binary. + /// date (required). + /// dateTime. + /// uuid. + /// password (required). + /// A string that is a 10 digit number. Can have leading zeros.. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. + public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + { + this.Number = number; + // to ensure "_byte" is required (not null) + if (_byte == null) { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this.Byte = _byte; + this.Date = date; + // to ensure "password" is required (not null) + if (password == null) { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } + this.Password = password; + this.Integer = integer; + this.Int32 = int32; + this.Int64 = int64; + this.Float = _float; + this.Double = _double; + this.Decimal = _decimal; + this.String = _string; + this.Binary = binary; + this.DateTime = dateTime; + this.Uuid = uuid; + this.PatternWithDigits = patternWithDigits; + this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Integer + /// + [DataMember(Name = "integer", EmitDefaultValue = false)] + public int Integer { get; set; } + + /// + /// Gets or Sets Int32 + /// + [DataMember(Name = "int32", EmitDefaultValue = false)] + public int Int32 { get; set; } + + /// + /// Gets or Sets Int64 + /// + [DataMember(Name = "int64", EmitDefaultValue = false)] + public long Int64 { get; set; } + + /// + /// Gets or Sets Number + /// + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)] + public decimal Number { get; set; } + + /// + /// Gets or Sets Float + /// + [DataMember(Name = "float", EmitDefaultValue = false)] + public float Float { get; set; } + + /// + /// Gets or Sets Double + /// + [DataMember(Name = "double", EmitDefaultValue = false)] + public double Double { get; set; } + + /// + /// Gets or Sets Decimal + /// + [DataMember(Name = "decimal", EmitDefaultValue = false)] + public decimal Decimal { get; set; } + + /// + /// Gets or Sets String + /// + [DataMember(Name = "string", EmitDefaultValue = false)] + public string String { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Binary + /// + [DataMember(Name = "binary", EmitDefaultValue = false)] + public System.IO.Stream Binary { get; set; } + + /// + /// Gets or Sets Date + /// + [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime Date { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name = "dateTime", EmitDefaultValue = false)] + public DateTime DateTime { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [DataMember(Name = "pattern_with_digits", EmitDefaultValue = false)] + public string PatternWithDigits { get; set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)] + public string PatternWithDigitsAndDelimiter { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FormatTest {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" Decimal: ").Append(Decimal).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as FormatTest).AreEqual; + } + + /// + /// Returns true if FormatTest instances are equal + /// + /// Instance of FormatTest to be compared + /// Boolean + public bool Equals(FormatTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); + if (this.String != null) + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } + if (this.Byte != null) + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } + if (this.Binary != null) + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } + if (this.Date != null) + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } + if (this.DateTime != null) + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } + if (this.PatternWithDigits != null) + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } + if (this.PatternWithDigitsAndDelimiter != null) + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // Integer (int) maximum + if (this.Integer > (int)100) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + } + + // Integer (int) minimum + if (this.Integer < (int)10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + } + + // Int32 (int) maximum + if (this.Int32 > (int)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + } + + // Int32 (int) minimum + if (this.Int32 < (int)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + } + + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Float (float) maximum + if (this.Float > (float)987.6) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + } + + // Float (float) minimum + if (this.Float < (float)54.3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + } + + // Double (double) maximum + if (this.Double > (double)123.4) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + } + + // Double (double) minimum + if (this.Double < (double)67.8) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + } + + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + + // PatternWithDigits (string) pattern + Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); + } + + // PatternWithDigitsAndDelimiter (string) pattern + Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); + } + + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 000000000000..726b1e8f72e7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,291 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Fruit + /// + [JsonConverter(typeof(FruitJsonConverter))] + [DataContract(Name = "fruit")] + public partial class Fruit : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Apple. + public Fruit(Apple actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Banana. + public Fruit(Banana actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Apple)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Banana)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana"); + } + } + } + + /// + /// Get the actual instance of `Apple`. If the actual instance is not `Apple`, + /// the InvalidClassException will be thrown + /// + /// An instance of Apple + public Apple GetApple() + { + return (Apple)this.ActualInstance; + } + + /// + /// Get the actual instance of `Banana`. If the actual instance is not `Banana`, + /// the InvalidClassException will be thrown + /// + /// An instance of Banana + public Banana GetBanana() + { + return (Banana)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Fruit {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Fruit.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Fruit + /// + /// JSON string + /// An instance of Fruit + public static Fruit FromJson(string jsonString) + { + Fruit newFruit = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newFruit; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Apple).GetProperty("AdditionalProperties") == null) + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.SerializerSettings)); + } + else + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Apple"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Banana).GetProperty("AdditionalProperties") == null) + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.SerializerSettings)); + } + else + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Banana"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newFruit; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Fruit).AreEqual; + } + + /// + /// Returns true if Fruit instances are equal + /// + /// Instance of Fruit to be compared + /// Boolean + public bool Equals(Fruit input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Fruit + /// + public class FruitJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Fruit).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Fruit.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs new file mode 100644 index 000000000000..548da490def0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs @@ -0,0 +1,300 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// FruitReq + /// + [JsonConverter(typeof(FruitReqJsonConverter))] + [DataContract(Name = "fruitReq")] + public partial class FruitReq : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + public FruitReq() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of AppleReq. + public FruitReq(AppleReq actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of BananaReq. + public FruitReq(BananaReq actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(AppleReq)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(BananaReq)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: AppleReq, BananaReq"); + } + } + } + + /// + /// Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`, + /// the InvalidClassException will be thrown + /// + /// An instance of AppleReq + public AppleReq GetAppleReq() + { + return (AppleReq)this.ActualInstance; + } + + /// + /// Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`, + /// the InvalidClassException will be thrown + /// + /// An instance of BananaReq + public BananaReq GetBananaReq() + { + return (BananaReq)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FruitReq {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, FruitReq.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of FruitReq + /// + /// JSON string + /// An instance of FruitReq + public static FruitReq FromJson(string jsonString) + { + FruitReq newFruitReq = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newFruitReq; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(AppleReq).GetProperty("AdditionalProperties") == null) + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.SerializerSettings)); + } + else + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("AppleReq"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into AppleReq: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(BananaReq).GetProperty("AdditionalProperties") == null) + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.SerializerSettings)); + } + else + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("BananaReq"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BananaReq: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newFruitReq; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as FruitReq).AreEqual; + } + + /// + /// Returns true if FruitReq instances are equal + /// + /// Instance of FruitReq to be compared + /// Boolean + public bool Equals(FruitReq input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for FruitReq + /// + public class FruitReqJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(FruitReq).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return FruitReq.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs new file mode 100644 index 000000000000..bd8f4435c92f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs @@ -0,0 +1,263 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// GmFruit + /// + [JsonConverter(typeof(GmFruitJsonConverter))] + [DataContract(Name = "gmFruit")] + public partial class GmFruit : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Apple. + public GmFruit(Apple actualInstance) + { + this.IsNullable = false; + this.SchemaType= "anyOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Banana. + public GmFruit(Banana actualInstance) + { + this.IsNullable = false; + this.SchemaType= "anyOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Apple)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Banana)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana"); + } + } + } + + /// + /// Get the actual instance of `Apple`. If the actual instance is not `Apple`, + /// the InvalidClassException will be thrown + /// + /// An instance of Apple + public Apple GetApple() + { + return (Apple)this.ActualInstance; + } + + /// + /// Get the actual instance of `Banana`. If the actual instance is not `Banana`, + /// the InvalidClassException will be thrown + /// + /// An instance of Banana + public Banana GetBanana() + { + return (Banana)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class GmFruit {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of GmFruit + /// + /// JSON string + /// An instance of GmFruit + public static GmFruit FromJson(string jsonString) + { + GmFruit newGmFruit = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newGmFruit; + } + + try + { + newGmFruit = new GmFruit(JsonConvert.DeserializeObject(jsonString, GmFruit.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newGmFruit; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString())); + } + + try + { + newGmFruit = new GmFruit(JsonConvert.DeserializeObject(jsonString, GmFruit.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newGmFruit; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as GmFruit).AreEqual; + } + + /// + /// Returns true if GmFruit instances are equal + /// + /// Instance of GmFruit to be compared + /// Boolean + public bool Equals(GmFruit input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for GmFruit + /// + public class GmFruitJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(GmFruit).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return GmFruit.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs new file mode 100644 index 000000000000..cee75f3f8157 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// GrandparentAnimal + /// + [DataContract(Name = "GrandparentAnimal")] + [JsonConverter(typeof(JsonSubtypes), "PetType")] + [JsonSubtypes.KnownSubType(typeof(ChildCat), "ChildCat")] + [JsonSubtypes.KnownSubType(typeof(ParentPet), "ParentPet")] + public partial class GrandparentAnimal : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected GrandparentAnimal() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// petType (required). + public GrandparentAnimal(string petType = default(string)) + { + // to ensure "petType" is required (not null) + if (petType == null) { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } + this.PetType = petType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)] + public string PetType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GrandparentAnimal {\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as GrandparentAnimal).AreEqual; + } + + /// + /// Returns true if GrandparentAnimal instances are equal + /// + /// Instance of GrandparentAnimal to be compared + /// Boolean + public bool Equals(GrandparentAnimal input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PetType != null) + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs new file mode 100644 index 000000000000..52099a7095e1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// HasOnlyReadOnly + /// + [DataContract(Name = "hasOnlyReadOnly")] + public partial class HasOnlyReadOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public HasOnlyReadOnly() + { + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; private set; } + + /// + /// Returns false as Bar should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBar() + { + return false; + } + /// + /// Gets or Sets Foo + /// + [DataMember(Name = "foo", EmitDefaultValue = false)] + public string Foo { get; private set; } + + /// + /// Returns false as Foo should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeFoo() + { + return false; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HasOnlyReadOnly).AreEqual; + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.Foo != null) + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 000000000000..e8cbb68e2e4c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + [DataContract(Name = "HealthCheckResult")] + public partial class HealthCheckResult : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage. + public HealthCheckResult(string nullableMessage = default(string)) + { + this.NullableMessage = nullableMessage; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets NullableMessage + /// + [DataMember(Name = "NullableMessage", EmitDefaultValue = true)] + public string NullableMessage { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HealthCheckResult).AreEqual; + } + + /// + /// Returns true if HealthCheckResult instances are equal + /// + /// Instance of HealthCheckResult to be compared + /// Boolean + public bool Equals(HealthCheckResult input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.NullableMessage != null) + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs new file mode 100644 index 000000000000..ae46f1f0098f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineResponseDefault + /// + [DataContract(Name = "inline_response_default")] + public partial class InlineResponseDefault : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _string. + public InlineResponseDefault(Foo _string = default(Foo)) + { + this.String = _string; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets String + /// + [DataMember(Name = "string", EmitDefaultValue = false)] + public Foo String { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class InlineResponseDefault {\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as InlineResponseDefault).AreEqual; + } + + /// + /// Returns true if InlineResponseDefault instances are equal + /// + /// Instance of InlineResponseDefault to be compared + /// Boolean + public bool Equals(InlineResponseDefault input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.String != null) + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs new file mode 100644 index 000000000000..50e7ce4aaa8d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -0,0 +1,146 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// IsoscelesTriangle + /// + [DataContract(Name = "IsoscelesTriangle")] + public partial class IsoscelesTriangle : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected IsoscelesTriangle() { } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } + this.TriangleType = triangleType; + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IsoscelesTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as IsoscelesTriangle).AreEqual; + } + + /// + /// Returns true if IsoscelesTriangle instances are equal + /// + /// Instance of IsoscelesTriangle to be compared + /// Boolean + public bool Equals(IsoscelesTriangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs new file mode 100644 index 000000000000..00814d110694 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// List + /// + [DataContract(Name = "List")] + public partial class List : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _123list. + public List(string _123list = default(string)) + { + this._123List = _123list; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _123List + /// + [DataMember(Name = "123-list", EmitDefaultValue = false)] + public string _123List { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class List {\n"); + sb.Append(" _123List: ").Append(_123List).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as List).AreEqual; + } + + /// + /// Returns true if List instances are equal + /// + /// Instance of List to be compared + /// Boolean + public bool Equals(List input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._123List != null) + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs new file mode 100644 index 000000000000..68ac31619921 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs @@ -0,0 +1,338 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Mammal + /// + [JsonConverter(typeof(MammalJsonConverter))] + [DataContract(Name = "mammal")] + public partial class Mammal : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Pig. + public Mammal(Pig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Whale. + public Mammal(Whale actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Zebra. + public Mammal(Zebra actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Pig)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Whale)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Zebra)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Pig, Whale, Zebra"); + } + } + } + + /// + /// Get the actual instance of `Pig`. If the actual instance is not `Pig`, + /// the InvalidClassException will be thrown + /// + /// An instance of Pig + public Pig GetPig() + { + return (Pig)this.ActualInstance; + } + + /// + /// Get the actual instance of `Whale`. If the actual instance is not `Whale`, + /// the InvalidClassException will be thrown + /// + /// An instance of Whale + public Whale GetWhale() + { + return (Whale)this.ActualInstance; + } + + /// + /// Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + /// the InvalidClassException will be thrown + /// + /// An instance of Zebra + public Zebra GetZebra() + { + return (Zebra)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Mammal {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Mammal.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Mammal + /// + /// JSON string + /// An instance of Mammal + public static Mammal FromJson(string jsonString) + { + Mammal newMammal = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newMammal; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Pig).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Pig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Pig: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Whale).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Whale"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Whale: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Zebra).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Zebra"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Zebra: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newMammal; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Mammal).AreEqual; + } + + /// + /// Returns true if Mammal instances are equal + /// + /// Instance of Mammal to be compared + /// Boolean + public bool Equals(Mammal input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Mammal + /// + public class MammalJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Mammal).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Mammal.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs new file mode 100644 index 000000000000..8b5a73e77365 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -0,0 +1,189 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MapTest + /// + [DataContract(Name = "MapTest")] + public partial class MapTest : IEquatable, IValidatableObject + { + /// + /// Defines Inner + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum InnerEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2 + + } + + + + /// + /// Gets or Sets MapOfEnumString + /// + [DataMember(Name = "map_of_enum_string", EmitDefaultValue = false)] + public Dictionary MapOfEnumString { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// mapMapOfString. + /// mapOfEnumString. + /// directMap. + /// indirectMap. + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + { + this.MapMapOfString = mapMapOfString; + this.MapOfEnumString = mapOfEnumString; + this.DirectMap = directMap; + this.IndirectMap = indirectMap; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets MapMapOfString + /// + [DataMember(Name = "map_map_of_string", EmitDefaultValue = false)] + public Dictionary> MapMapOfString { get; set; } + + /// + /// Gets or Sets DirectMap + /// + [DataMember(Name = "direct_map", EmitDefaultValue = false)] + public Dictionary DirectMap { get; set; } + + /// + /// Gets or Sets IndirectMap + /// + [DataMember(Name = "indirect_map", EmitDefaultValue = false)] + public Dictionary IndirectMap { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MapTest {\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MapTest).AreEqual; + } + + /// + /// Returns true if MapTest instances are equal + /// + /// Instance of MapTest to be compared + /// Boolean + public bool Equals(MapTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapMapOfString != null) + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); + if (this.DirectMap != null) + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } + if (this.IndirectMap != null) + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 000000000000..3225727af37b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + [DataContract(Name = "MixedPropertiesAndAdditionalPropertiesClass")] + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// dateTime. + /// map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + { + this.Uuid = uuid; + this.DateTime = dateTime; + this.Map = map; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name = "dateTime", EmitDefaultValue = false)] + public DateTime DateTime { get; set; } + + /// + /// Gets or Sets Map + /// + [DataMember(Name = "map", EmitDefaultValue = false)] + public Dictionary Map { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MixedPropertiesAndAdditionalPropertiesClass).AreEqual; + } + + /// + /// Returns true if MixedPropertiesAndAdditionalPropertiesClass instances are equal + /// + /// Instance of MixedPropertiesAndAdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + if (this.DateTime != null) + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } + if (this.Map != null) + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs new file mode 100644 index 000000000000..79a49ef91d28 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model name starting with number + /// + [DataContract(Name = "200_response")] + public partial class Model200Response : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// _class. + public Model200Response(int name = default(int), string _class = default(string)) + { + this.Name = name; + this.Class = _class; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public int Name { get; set; } + + /// + /// Gets or Sets Class + /// + [DataMember(Name = "class", EmitDefaultValue = false)] + public string Class { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Model200Response {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Model200Response).AreEqual; + } + + /// + /// Returns true if Model200Response instances are equal + /// + /// Instance of Model200Response to be compared + /// Boolean + public bool Equals(Model200Response input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + if (this.Class != null) + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs new file mode 100644 index 000000000000..1995ec4b1692 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ModelClient + /// + [DataContract(Name = "_Client")] + public partial class ModelClient : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _client. + public ModelClient(string _client = default(string)) + { + this._Client = _client; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _Client + /// + [DataMember(Name = "client", EmitDefaultValue = false)] + public string _Client { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ModelClient {\n"); + sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ModelClient).AreEqual; + } + + /// + /// Returns true if ModelClient instances are equal + /// + /// Instance of ModelClient to be compared + /// Boolean + public bool Equals(ModelClient input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Client != null) + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs new file mode 100644 index 000000000000..0dc21bb656f0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs @@ -0,0 +1,182 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model name same as property name + /// + [DataContract(Name = "Name")] + public partial class Name : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Name() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// property. + public Name(int name = default(int), string property = default(string)) + { + this._Name = name; + this.Property = property; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public int _Name { get; set; } + + /// + /// Gets or Sets SnakeCase + /// + [DataMember(Name = "snake_case", EmitDefaultValue = false)] + public int SnakeCase { get; private set; } + + /// + /// Returns false as SnakeCase should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeSnakeCase() + { + return false; + } + /// + /// Gets or Sets Property + /// + [DataMember(Name = "property", EmitDefaultValue = false)] + public string Property { get; set; } + + /// + /// Gets or Sets _123Number + /// + [DataMember(Name = "123Number", EmitDefaultValue = false)] + public int _123Number { get; private set; } + + /// + /// Returns false as _123Number should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize_123Number() + { + return false; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Name {\n"); + sb.Append(" _Name: ").Append(_Name).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" _123Number: ").Append(_123Number).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Name).AreEqual; + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); + if (this.Property != null) + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 000000000000..57555c376785 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,265 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// NullableClass + /// + [DataContract(Name = "NullableClass")] + public partial class NullableClass : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// integerProp. + /// numberProp. + /// booleanProp. + /// stringProp. + /// dateProp. + /// datetimeProp. + /// arrayNullableProp. + /// arrayAndItemsNullableProp. + /// arrayItemsNullable. + /// objectNullableProp. + /// objectAndItemsNullableProp. + /// objectItemsNullable. + public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ArrayItemsNullable = arrayItemsNullable; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.ObjectItemsNullable = objectItemsNullable; + } + + /// + /// Gets or Sets IntegerProp + /// + [DataMember(Name = "integer_prop", EmitDefaultValue = true)] + public int? IntegerProp { get; set; } + + /// + /// Gets or Sets NumberProp + /// + [DataMember(Name = "number_prop", EmitDefaultValue = true)] + public decimal? NumberProp { get; set; } + + /// + /// Gets or Sets BooleanProp + /// + [DataMember(Name = "boolean_prop", EmitDefaultValue = true)] + public bool? BooleanProp { get; set; } + + /// + /// Gets or Sets StringProp + /// + [DataMember(Name = "string_prop", EmitDefaultValue = true)] + public string StringProp { get; set; } + + /// + /// Gets or Sets DateProp + /// + [DataMember(Name = "date_prop", EmitDefaultValue = true)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime? DateProp { get; set; } + + /// + /// Gets or Sets DatetimeProp + /// + [DataMember(Name = "datetime_prop", EmitDefaultValue = true)] + public DateTime? DatetimeProp { get; set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [DataMember(Name = "array_nullable_prop", EmitDefaultValue = true)] + public List ArrayNullableProp { get; set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [DataMember(Name = "array_and_items_nullable_prop", EmitDefaultValue = true)] + public List ArrayAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [DataMember(Name = "array_items_nullable", EmitDefaultValue = false)] + public List ArrayItemsNullable { get; set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [DataMember(Name = "object_nullable_prop", EmitDefaultValue = true)] + public Dictionary ObjectNullableProp { get; set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [DataMember(Name = "object_and_items_nullable_prop", EmitDefaultValue = true)] + public Dictionary ObjectAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [DataMember(Name = "object_items_nullable", EmitDefaultValue = false)] + public Dictionary ObjectItemsNullable { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NullableClass {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as NullableClass).AreEqual; + } + + /// + /// Returns true if NullableClass instances are equal + /// + /// Instance of NullableClass to be compared + /// Boolean + public bool Equals(NullableClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.IntegerProp != null) + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } + if (this.NumberProp != null) + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } + if (this.BooleanProp != null) + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } + if (this.StringProp != null) + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } + if (this.DateProp != null) + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } + if (this.DatetimeProp != null) + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } + if (this.ArrayNullableProp != null) + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } + if (this.ArrayAndItemsNullableProp != null) + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } + if (this.ArrayItemsNullable != null) + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } + if (this.ObjectNullableProp != null) + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } + if (this.ObjectAndItemsNullableProp != null) + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } + if (this.ObjectItemsNullable != null) + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs new file mode 100644 index 000000000000..5dd73a56ef76 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs @@ -0,0 +1,301 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + /// + [JsonConverter(typeof(NullableShapeJsonConverter))] + [DataContract(Name = "NullableShape")] + public partial class NullableShape : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + public NullableShape() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public NullableShape(Quadrilateral actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public NullableShape(Triangle actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NullableShape {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, NullableShape.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of NullableShape + /// + /// JSON string + /// An instance of NullableShape + public static NullableShape FromJson(string jsonString) + { + NullableShape newNullableShape = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newNullableShape; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.SerializerSettings)); + } + else + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.SerializerSettings)); + } + else + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newNullableShape; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as NullableShape).AreEqual; + } + + /// + /// Returns true if NullableShape instances are equal + /// + /// Instance of NullableShape to be compared + /// Boolean + public bool Equals(NullableShape input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for NullableShape + /// + public class NullableShapeJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(NullableShape).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return NullableShape.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs new file mode 100644 index 000000000000..97f869b0ebc1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// NumberOnly + /// + [DataContract(Name = "NumberOnly")] + public partial class NumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber. + public NumberOnly(decimal justNumber = default(decimal)) + { + this.JustNumber = justNumber; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets JustNumber + /// + [DataMember(Name = "JustNumber", EmitDefaultValue = false)] + public decimal JustNumber { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as NumberOnly).AreEqual; + } + + /// + /// Returns true if NumberOnly instances are equal + /// + /// Instance of NumberOnly to be compared + /// Boolean + public bool Equals(NumberOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs new file mode 100644 index 000000000000..86ea32998f8c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -0,0 +1,171 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ObjectWithDeprecatedFields + /// + [DataContract(Name = "ObjectWithDeprecatedFields")] + public partial class ObjectWithDeprecatedFields : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// id. + /// deprecatedRef. + /// bars. + public ObjectWithDeprecatedFields(string uuid = default(string), decimal id = default(decimal), DeprecatedObject deprecatedRef = default(DeprecatedObject), List bars = default(List)) + { + this.Uuid = uuid; + this.Id = id; + this.DeprecatedRef = deprecatedRef; + this.Bars = bars; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public string Uuid { get; set; } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + [Obsolete] + public decimal Id { get; set; } + + /// + /// Gets or Sets DeprecatedRef + /// + [DataMember(Name = "deprecatedRef", EmitDefaultValue = false)] + [Obsolete] + public DeprecatedObject DeprecatedRef { get; set; } + + /// + /// Gets or Sets Bars + /// + [DataMember(Name = "bars", EmitDefaultValue = false)] + [Obsolete] + public List Bars { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ObjectWithDeprecatedFields {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" DeprecatedRef: ").Append(DeprecatedRef).Append("\n"); + sb.Append(" Bars: ").Append(Bars).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ObjectWithDeprecatedFields).AreEqual; + } + + /// + /// Returns true if ObjectWithDeprecatedFields instances are equal + /// + /// Instance of ObjectWithDeprecatedFields to be compared + /// Boolean + public bool Equals(ObjectWithDeprecatedFields input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.DeprecatedRef != null) + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } + if (this.Bars != null) + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs new file mode 100644 index 000000000000..5c52482e79b9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs @@ -0,0 +1,210 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Order + /// + [DataContract(Name = "Order")] + public partial class Order : IEquatable, IValidatableObject + { + /// + /// Order Status + /// + /// Order Status + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// petId. + /// quantity. + /// shipDate. + /// Order Status. + /// complete (default to false). + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) + { + this.Id = id; + this.PetId = petId; + this.Quantity = quantity; + this.ShipDate = shipDate; + this.Status = status; + this.Complete = complete; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name = "petId", EmitDefaultValue = false)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name = "quantity", EmitDefaultValue = false)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name = "shipDate", EmitDefaultValue = false)] + public DateTime ShipDate { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name = "complete", EmitDefaultValue = true)] + public bool Complete { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Order).AreEqual; + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); + if (this.ShipDate != null) + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs new file mode 100644 index 000000000000..3209f6d6244e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -0,0 +1,152 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// OuterComposite + /// + [DataContract(Name = "OuterComposite")] + public partial class OuterComposite : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// myNumber. + /// myString. + /// myBoolean. + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) + { + this.MyNumber = myNumber; + this.MyString = myString; + this.MyBoolean = myBoolean; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name = "my_number", EmitDefaultValue = false)] + public decimal MyNumber { get; set; } + + /// + /// Gets or Sets MyString + /// + [DataMember(Name = "my_string", EmitDefaultValue = false)] + public string MyString { get; set; } + + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name = "my_boolean", EmitDefaultValue = true)] + public bool MyBoolean { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as OuterComposite).AreEqual; + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); + if (this.MyString != null) + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnum.cs new file mode 100644 index 000000000000..2aa496a2e074 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OuterEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 000000000000..dd79c7010d6b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumDefaultValue + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 000000000000..44dc91c700ad --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumInteger + /// + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 000000000000..b927507cf97a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ParentPet.cs new file mode 100644 index 000000000000..ac986b555efd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ParentPet.cs @@ -0,0 +1,146 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ParentPet + /// + [DataContract(Name = "ParentPet")] + [JsonConverter(typeof(JsonSubtypes), "PetType")] + [JsonSubtypes.KnownSubType(typeof(ChildCat), "ChildCat")] + public partial class ParentPet : GrandparentAnimal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ParentPet() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// petType (required) (default to "ParentPet"). + public ParentPet(string petType = "ParentPet") : base(petType) + { + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ParentPet {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ParentPet).AreEqual; + } + + /// + /// Returns true if ParentPet instances are equal + /// + /// Instance of ParentPet to be compared + /// Boolean + public bool Equals(ParentPet input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs new file mode 100644 index 000000000000..31fd118f4f68 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs @@ -0,0 +1,235 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Pet + /// + [DataContract(Name = "Pet")] + public partial class Pet : IEquatable, IValidatableObject + { + /// + /// pet status in the store + /// + /// pet status in the store + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Available for value: available + /// + [EnumMember(Value = "available")] + Available = 1, + + /// + /// Enum Pending for value: pending + /// + [EnumMember(Value = "pending")] + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + [EnumMember(Value = "sold")] + Sold = 3 + + } + + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Pet() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// category. + /// name (required). + /// photoUrls (required). + /// tags. + /// pet status in the store. + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + { + // to ensure "name" is required (not null) + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; + // to ensure "photoUrls" is required (not null) + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; + this.Id = id; + this.Category = category; + this.Tags = tags; + this.Status = status; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = false)] + public List Tags { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Pet).AreEqual; + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Category != null) + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.PhotoUrls != null) + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } + if (this.Tags != null) + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs new file mode 100644 index 000000000000..b82c0899c27d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs @@ -0,0 +1,292 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Pig + /// + [JsonConverter(typeof(PigJsonConverter))] + [DataContract(Name = "Pig")] + public partial class Pig : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of BasquePig. + public Pig(BasquePig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of DanishPig. + public Pig(DanishPig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(BasquePig)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(DanishPig)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: BasquePig, DanishPig"); + } + } + } + + /// + /// Get the actual instance of `BasquePig`. If the actual instance is not `BasquePig`, + /// the InvalidClassException will be thrown + /// + /// An instance of BasquePig + public BasquePig GetBasquePig() + { + return (BasquePig)this.ActualInstance; + } + + /// + /// Get the actual instance of `DanishPig`. If the actual instance is not `DanishPig`, + /// the InvalidClassException will be thrown + /// + /// An instance of DanishPig + public DanishPig GetDanishPig() + { + return (DanishPig)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pig {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Pig.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Pig + /// + /// JSON string + /// An instance of Pig + public static Pig FromJson(string jsonString) + { + Pig newPig = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newPig; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(BasquePig).GetProperty("AdditionalProperties") == null) + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.SerializerSettings)); + } + else + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("BasquePig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BasquePig: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(DanishPig).GetProperty("AdditionalProperties") == null) + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.SerializerSettings)); + } + else + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("DanishPig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into DanishPig: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newPig; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Pig).AreEqual; + } + + /// + /// Returns true if Pig instances are equal + /// + /// Instance of Pig to be compared + /// Boolean + public bool Equals(Pig input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Pig + /// + public class PigJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Pig).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Pig.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs new file mode 100644 index 000000000000..a1a850f169e4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -0,0 +1,292 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Quadrilateral + /// + [JsonConverter(typeof(QuadrilateralJsonConverter))] + [DataContract(Name = "Quadrilateral")] + public partial class Quadrilateral : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ComplexQuadrilateral. + public Quadrilateral(ComplexQuadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of SimpleQuadrilateral. + public Quadrilateral(SimpleQuadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(ComplexQuadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(SimpleQuadrilateral)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: ComplexQuadrilateral, SimpleQuadrilateral"); + } + } + } + + /// + /// Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of ComplexQuadrilateral + public ComplexQuadrilateral GetComplexQuadrilateral() + { + return (ComplexQuadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of SimpleQuadrilateral + public SimpleQuadrilateral GetSimpleQuadrilateral() + { + return (SimpleQuadrilateral)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Quadrilateral {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Quadrilateral.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Quadrilateral + /// + /// JSON string + /// An instance of Quadrilateral + public static Quadrilateral FromJson(string jsonString) + { + Quadrilateral newQuadrilateral = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newQuadrilateral; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ComplexQuadrilateral).GetProperty("AdditionalProperties") == null) + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.SerializerSettings)); + } + else + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("ComplexQuadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into ComplexQuadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(SimpleQuadrilateral).GetProperty("AdditionalProperties") == null) + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.SerializerSettings)); + } + else + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("SimpleQuadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into SimpleQuadrilateral: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newQuadrilateral; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Quadrilateral).AreEqual; + } + + /// + /// Returns true if Quadrilateral instances are equal + /// + /// Instance of Quadrilateral to be compared + /// Boolean + public bool Equals(Quadrilateral input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Quadrilateral + /// + public class QuadrilateralJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Quadrilateral).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Quadrilateral.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs new file mode 100644 index 000000000000..4d7c39c4364d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// QuadrilateralInterface + /// + [DataContract(Name = "QuadrilateralInterface")] + public partial class QuadrilateralInterface : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected QuadrilateralInterface() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType (required). + public QuadrilateralInterface(string quadrilateralType = default(string)) + { + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class QuadrilateralInterface {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as QuadrilateralInterface).AreEqual; + } + + /// + /// Returns true if QuadrilateralInterface instances are equal + /// + /// Instance of QuadrilateralInterface to be compared + /// Boolean + public bool Equals(QuadrilateralInterface input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs new file mode 100644 index 000000000000..ad59ca832864 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -0,0 +1,151 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ReadOnlyFirst + /// + [DataContract(Name = "ReadOnlyFirst")] + public partial class ReadOnlyFirst : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// baz. + public ReadOnlyFirst(string baz = default(string)) + { + this.Baz = baz; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; private set; } + + /// + /// Returns false as Bar should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBar() + { + return false; + } + /// + /// Gets or Sets Baz + /// + [DataMember(Name = "baz", EmitDefaultValue = false)] + public string Baz { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ReadOnlyFirst).AreEqual; + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.Baz != null) + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs new file mode 100644 index 000000000000..e702e0157030 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract(Name = "Return")] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _return. + public Return(int _return = default(int)) + { + this._Return = _return; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name = "return", EmitDefaultValue = false)] + public int _Return { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Return).AreEqual; + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this._Return.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs new file mode 100644 index 000000000000..236839471475 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ScaleneTriangle + /// + [DataContract(Name = "ScaleneTriangle")] + public partial class ScaleneTriangle : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ScaleneTriangle() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } + this.TriangleType = triangleType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ScaleneTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ScaleneTriangle).AreEqual; + } + + /// + /// Returns true if ScaleneTriangle instances are equal + /// + /// Instance of ScaleneTriangle to be compared + /// Boolean + public bool Equals(ScaleneTriangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs new file mode 100644 index 000000000000..dd74fa4b7184 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs @@ -0,0 +1,292 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Shape + /// + [JsonConverter(typeof(ShapeJsonConverter))] + [DataContract(Name = "Shape")] + public partial class Shape : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public Shape(Quadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public Shape(Triangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Shape {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Shape.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Shape + /// + /// JSON string + /// An instance of Shape + public static Shape FromJson(string jsonString) + { + Shape newShape = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newShape; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.SerializerSettings)); + } + else + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.SerializerSettings)); + } + else + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newShape; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Shape).AreEqual; + } + + /// + /// Returns true if Shape instances are equal + /// + /// Instance of Shape to be compared + /// Boolean + public bool Equals(Shape input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Shape + /// + public class ShapeJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Shape).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Shape.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs new file mode 100644 index 000000000000..92774561aaa5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ShapeInterface + /// + [DataContract(Name = "ShapeInterface")] + public partial class ShapeInterface : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ShapeInterface() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + public ShapeInterface(string shapeType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } + this.ShapeType = shapeType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ShapeInterface {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ShapeInterface).AreEqual; + } + + /// + /// Returns true if ShapeInterface instances are equal + /// + /// Instance of ShapeInterface to be compared + /// Boolean + public bool Equals(ShapeInterface input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs new file mode 100644 index 000000000000..c6b87c89751a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -0,0 +1,301 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + /// + [JsonConverter(typeof(ShapeOrNullJsonConverter))] + [DataContract(Name = "ShapeOrNull")] + public partial class ShapeOrNull : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + public ShapeOrNull() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public ShapeOrNull(Quadrilateral actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public ShapeOrNull(Triangle actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ShapeOrNull {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, ShapeOrNull.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of ShapeOrNull + /// + /// JSON string + /// An instance of ShapeOrNull + public static ShapeOrNull FromJson(string jsonString) + { + ShapeOrNull newShapeOrNull = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newShapeOrNull; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.SerializerSettings)); + } + else + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.SerializerSettings)); + } + else + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newShapeOrNull; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ShapeOrNull).AreEqual; + } + + /// + /// Returns true if ShapeOrNull instances are equal + /// + /// Instance of ShapeOrNull to be compared + /// Boolean + public bool Equals(ShapeOrNull input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for ShapeOrNull + /// + public class ShapeOrNullJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(ShapeOrNull).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return ShapeOrNull.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs new file mode 100644 index 000000000000..fc9b37ce01fb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// SimpleQuadrilateral + /// + [DataContract(Name = "SimpleQuadrilateral")] + public partial class SimpleQuadrilateral : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SimpleQuadrilateral() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// quadrilateralType (required). + public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SimpleQuadrilateral {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as SimpleQuadrilateral).AreEqual; + } + + /// + /// Returns true if SimpleQuadrilateral instances are equal + /// + /// Instance of SimpleQuadrilateral to be compared + /// Boolean + public bool Equals(SimpleQuadrilateral input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs new file mode 100644 index 000000000000..7800467822ea --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// SpecialModelName + /// + [DataContract(Name = "_special_model.name_")] + public partial class SpecialModelName : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// specialPropertyName. + /// specialModelName. + public SpecialModelName(long specialPropertyName = default(long), string specialModelName = default(string)) + { + this.SpecialPropertyName = specialPropertyName; + this._SpecialModelName = specialModelName; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SpecialPropertyName + /// + [DataMember(Name = "$special[property.name]", EmitDefaultValue = false)] + public long SpecialPropertyName { get; set; } + + /// + /// Gets or Sets _SpecialModelName + /// + [DataMember(Name = "_special_model.name_", EmitDefaultValue = false)] + public string _SpecialModelName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SpecialModelName {\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); + sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as SpecialModelName).AreEqual; + } + + /// + /// Returns true if SpecialModelName instances are equal + /// + /// Instance of SpecialModelName to be compared + /// Boolean + public bool Equals(SpecialModelName input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); + if (this._SpecialModelName != null) + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs new file mode 100644 index 000000000000..3df2c02e2cef --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Tag + /// + [DataContract(Name = "Tag")] + public partial class Tag : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Tag(long id = default(long), string name = default(string)) + { + this.Id = id; + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Tag).AreEqual; + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs new file mode 100644 index 000000000000..c8cf49ef7f66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs @@ -0,0 +1,338 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Triangle + /// + [JsonConverter(typeof(TriangleJsonConverter))] + [DataContract(Name = "Triangle")] + public partial class Triangle : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of EquilateralTriangle. + public Triangle(EquilateralTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of IsoscelesTriangle. + public Triangle(IsoscelesTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ScaleneTriangle. + public Triangle(ScaleneTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(EquilateralTriangle)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(IsoscelesTriangle)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(ScaleneTriangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + } + } + } + + /// + /// Get the actual instance of `EquilateralTriangle`. If the actual instance is not `EquilateralTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of EquilateralTriangle + public EquilateralTriangle GetEquilateralTriangle() + { + return (EquilateralTriangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `IsoscelesTriangle`. If the actual instance is not `IsoscelesTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of IsoscelesTriangle + public IsoscelesTriangle GetIsoscelesTriangle() + { + return (IsoscelesTriangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `ScaleneTriangle`. If the actual instance is not `ScaleneTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of ScaleneTriangle + public ScaleneTriangle GetScaleneTriangle() + { + return (ScaleneTriangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Triangle {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Triangle.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Triangle + /// + /// JSON string + /// An instance of Triangle + public static Triangle FromJson(string jsonString) + { + Triangle newTriangle = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newTriangle; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(EquilateralTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("EquilateralTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into EquilateralTriangle: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(IsoscelesTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("IsoscelesTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into IsoscelesTriangle: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ScaleneTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("ScaleneTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into ScaleneTriangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newTriangle; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Triangle).AreEqual; + } + + /// + /// Returns true if Triangle instances are equal + /// + /// Instance of Triangle to be compared + /// Boolean + public bool Equals(Triangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Triangle + /// + public class TriangleJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Triangle).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Triangle.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs new file mode 100644 index 000000000000..7f7abb5bc85b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TriangleInterface + /// + [DataContract(Name = "TriangleInterface")] + public partial class TriangleInterface : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TriangleInterface() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// triangleType (required). + public TriangleInterface(string triangleType = default(string)) + { + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } + this.TriangleType = triangleType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TriangleInterface {\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TriangleInterface).AreEqual; + } + + /// + /// Returns true if TriangleInterface instances are equal + /// + /// Instance of TriangleInterface to be compared + /// Boolean + public bool Equals(TriangleInterface input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs new file mode 100644 index 000000000000..5f2a3020c3dd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs @@ -0,0 +1,274 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// User + /// + [DataContract(Name = "User")] + public partial class User : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// username. + /// firstName. + /// lastName. + /// email. + /// password. + /// phone. + /// User Status. + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int), Object objectWithNoDeclaredProps = default(Object), Object objectWithNoDeclaredPropsNullable = default(Object), Object anyTypeProp = default(Object), Object anyTypePropNullable = default(Object)) + { + this.Id = id; + this.Username = username; + this.FirstName = firstName; + this.LastName = lastName; + this.Email = email; + this.Password = password; + this.Phone = phone; + this.UserStatus = userStatus; + this.ObjectWithNoDeclaredProps = objectWithNoDeclaredProps; + this.ObjectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + this.AnyTypeProp = anyTypeProp; + this.AnyTypePropNullable = anyTypePropNullable; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", EmitDefaultValue = false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name = "firstName", EmitDefaultValue = false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name = "lastName", EmitDefaultValue = false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name = "email", EmitDefaultValue = false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name = "phone", EmitDefaultValue = false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name = "userStatus", EmitDefaultValue = false)] + public int UserStatus { get; set; } + + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + [DataMember(Name = "objectWithNoDeclaredProps", EmitDefaultValue = false)] + public Object ObjectWithNoDeclaredProps { get; set; } + + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + [DataMember(Name = "objectWithNoDeclaredPropsNullable", EmitDefaultValue = true)] + public Object ObjectWithNoDeclaredPropsNullable { get; set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + [DataMember(Name = "anyTypeProp", EmitDefaultValue = true)] + public Object AnyTypeProp { get; set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + [DataMember(Name = "anyTypePropNullable", EmitDefaultValue = true)] + public Object AnyTypePropNullable { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); + sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); + sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); + sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as User).AreEqual; + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Username != null) + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.Email != null) + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } + if (this.Phone != null) + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); + if (this.ObjectWithNoDeclaredProps != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } + if (this.ObjectWithNoDeclaredPropsNullable != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } + if (this.AnyTypeProp != null) + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } + if (this.AnyTypePropNullable != null) + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs new file mode 100644 index 000000000000..c30b6dbfabed --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Whale + /// + [DataContract(Name = "whale")] + public partial class Whale : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Whale() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// hasBaleen. + /// hasTeeth. + /// className (required). + public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } + this.ClassName = className; + this.HasBaleen = hasBaleen; + this.HasTeeth = hasTeeth; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets HasBaleen + /// + [DataMember(Name = "hasBaleen", EmitDefaultValue = true)] + public bool HasBaleen { get; set; } + + /// + /// Gets or Sets HasTeeth + /// + [DataMember(Name = "hasTeeth", EmitDefaultValue = true)] + public bool HasTeeth { get; set; } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Whale {\n"); + sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); + sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Whale).AreEqual; + } + + /// + /// Returns true if Whale instances are equal + /// + /// Instance of Whale to be compared + /// Boolean + public bool Equals(Whale input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs new file mode 100644 index 000000000000..4fb60ed8ddf2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -0,0 +1,181 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Zebra + /// + [DataContract(Name = "zebra")] + public partial class Zebra : Dictionary, IEquatable, IValidatableObject + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum Plains for value: plains + /// + [EnumMember(Value = "plains")] + Plains = 1, + + /// + /// Enum Mountain for value: mountain + /// + [EnumMember(Value = "mountain")] + Mountain = 2, + + /// + /// Enum Grevys for value: grevys + /// + [EnumMember(Value = "grevys")] + Grevys = 3 + + } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Zebra() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// type. + /// className (required). + public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } + this.ClassName = className; + this.Type = type; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Zebra {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Zebra).AreEqual; + } + + /// + /// Returns true if Zebra instances are equal + /// + /// Instance of Zebra to be compared + /// Boolean + public bool Equals(Zebra input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 000000000000..3cd45cef2bfa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net6.0 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.gitignore b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.gitignore new file mode 100644 index 000000000000..1ee53850b84c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator-ignore b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES new file mode 100644 index 000000000000..2f141a0eb477 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES @@ -0,0 +1,193 @@ +.gitignore +Org.OpenAPITools.sln +README.md +appveyor.yml +docs/apis/AnotherFakeApi.md +docs/apis/DefaultApi.md +docs/apis/FakeApi.md +docs/apis/FakeClassnameTags123Api.md +docs/apis/PetApi.md +docs/apis/StoreApi.md +docs/apis/UserApi.md +docs/models/AdditionalPropertiesClass.md +docs/models/Animal.md +docs/models/ApiResponse.md +docs/models/Apple.md +docs/models/AppleReq.md +docs/models/ArrayOfArrayOfNumberOnly.md +docs/models/ArrayOfNumberOnly.md +docs/models/ArrayTest.md +docs/models/Banana.md +docs/models/BananaReq.md +docs/models/BasquePig.md +docs/models/Capitalization.md +docs/models/Cat.md +docs/models/CatAllOf.md +docs/models/Category.md +docs/models/ChildCat.md +docs/models/ChildCatAllOf.md +docs/models/ClassModel.md +docs/models/ComplexQuadrilateral.md +docs/models/DanishPig.md +docs/models/DeprecatedObject.md +docs/models/Dog.md +docs/models/DogAllOf.md +docs/models/Drawing.md +docs/models/EnumArrays.md +docs/models/EnumClass.md +docs/models/EnumTest.md +docs/models/EquilateralTriangle.md +docs/models/File.md +docs/models/FileSchemaTestClass.md +docs/models/Foo.md +docs/models/FormatTest.md +docs/models/Fruit.md +docs/models/FruitReq.md +docs/models/GmFruit.md +docs/models/GrandparentAnimal.md +docs/models/HasOnlyReadOnly.md +docs/models/HealthCheckResult.md +docs/models/InlineResponseDefault.md +docs/models/IsoscelesTriangle.md +docs/models/List.md +docs/models/Mammal.md +docs/models/MapTest.md +docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/Model200Response.md +docs/models/ModelClient.md +docs/models/Name.md +docs/models/NullableClass.md +docs/models/NullableShape.md +docs/models/NumberOnly.md +docs/models/ObjectWithDeprecatedFields.md +docs/models/Order.md +docs/models/OuterComposite.md +docs/models/OuterEnum.md +docs/models/OuterEnumDefaultValue.md +docs/models/OuterEnumInteger.md +docs/models/OuterEnumIntegerDefaultValue.md +docs/models/ParentPet.md +docs/models/Pet.md +docs/models/Pig.md +docs/models/Quadrilateral.md +docs/models/QuadrilateralInterface.md +docs/models/ReadOnlyFirst.md +docs/models/Return.md +docs/models/ScaleneTriangle.md +docs/models/Shape.md +docs/models/ShapeInterface.md +docs/models/ShapeOrNull.md +docs/models/SimpleQuadrilateral.md +docs/models/SpecialModelName.md +docs/models/Tag.md +docs/models/Triangle.md +docs/models/TriangleInterface.md +docs/models/User.md +docs/models/Whale.md +docs/models/Zebra.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiKeyToken.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/BasicToken.cs +src/Org.OpenAPITools/Client/BearerToken.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningToken.cs +src/Org.OpenAPITools/Client/IApi.cs +src/Org.OpenAPITools/Client/OAuthToken.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/AppleReq.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/BananaReq.cs +src/Org.OpenAPITools/Model/BasquePig.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ChildCat.cs +src/Org.OpenAPITools/Model/ChildCatAllOf.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +src/Org.OpenAPITools/Model/DanishPig.cs +src/Org.OpenAPITools/Model/DeprecatedObject.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/Drawing.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/EquilateralTriangle.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/Foo.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Model/FruitReq.cs +src/Org.OpenAPITools/Model/GmFruit.cs +src/Org.OpenAPITools/Model/GrandparentAnimal.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/HealthCheckResult.cs +src/Org.OpenAPITools/Model/InlineResponseDefault.cs +src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/Mammal.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NullableClass.cs +src/Org.OpenAPITools/Model/NullableShape.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumInteger.cs +src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +src/Org.OpenAPITools/Model/ParentPet.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/Pig.cs +src/Org.OpenAPITools/Model/Quadrilateral.cs +src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/ScaleneTriangle.cs +src/Org.OpenAPITools/Model/Shape.cs +src/Org.OpenAPITools/Model/ShapeInterface.cs +src/Org.OpenAPITools/Model/ShapeOrNull.cs +src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/Triangle.cs +src/Org.OpenAPITools/Model/TriangleInterface.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/Whale.cs +src/Org.OpenAPITools/Model/Zebra.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/VERSION new file mode 100644 index 000000000000..0984c4c1ad21 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/Org.OpenAPITools.sln b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/Org.OpenAPITools.sln new file mode 100644 index 000000000000..61278f3ea0b5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/README.md new file mode 100644 index 000000000000..58766deeff22 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/README.md @@ -0,0 +1,259 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=netstandard2.0', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + ApiResponse foo = await api.Call123TestSpecialTagsWithHttpInfoAsync("todo"); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + // the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [Polly](https://www.nuget.org/packages/Polly/) - 7.2.2 or later +- [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Authentication schemes defined for the API: + + +### 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 + + +### bearer_test + + +- **Type**: Bearer Authentication + + +### http_basic_test + + +- **Type**: HTTP basic authentication + + +### http_signature_test + + + + +### 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 + +## Build +- SDK version: 1.0.0 +- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen + +## Api Information +- appName: OpenAPI Petstore +- appVersion: 1.0.0 +- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true +- withXml: + +## [OpenApi Generator Parameteres](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: netstandard2.0 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/appveyor.yml b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/appveyor.yml new file mode 100644 index 000000000000..f76f63cee506 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/AnotherFakeApi.md new file mode 100644 index 000000000000..93f82cb5bdb1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/AnotherFakeApi.md @@ -0,0 +1,80 @@ +# Org.OpenAPITools.Api.AnotherFakeApi + +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 modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Call123TestSpecialTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md new file mode 100644 index 000000000000..345af7fa914f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md @@ -0,0 +1,73 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FooGet**](DefaultApi.md#fooget) | **GET** /foo | + + + +# **FooGet** +> InlineResponseDefault FooGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FooGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + InlineResponseDefault result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md new file mode 100644 index 000000000000..54d29ffb72a4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md @@ -0,0 +1,1126 @@ +# Org.OpenAPITools.Api.FakeApi + +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 +[**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 | +[**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums +[**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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeHealthGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) [[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 (bool? body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = true; // bool? | Input boolean as post body (optional) + + try + { + bool result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) [[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 outerComposite = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + +[[Back to top]](#) [[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** +> decimal FakeOuterNumberSerialize (decimal? body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = 8.14D; // decimal? | Input number as post body (optional) + + try + { + decimal result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **decimal?**| Input number as post body | [optional] + +### Return type + +**decimal** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) [[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 (string body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = "body_example"; // string | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetArrayOfEnums** +> List<OuterEnum> GetArrayOfEnums () + +Array of Enums + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetArrayOfEnumsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Array of Enums + List result = apiInstance.GetArrayOfEnums(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + +[[Back to top]](#) [[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** +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithFileSchemaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + + try + { + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[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** +> void TestBodyWithQueryParams (string query, User user) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var query = "query_example"; // string | + var user = new User(); // User | + + try + { + apiInstance.TestBodyWithQueryParams(query, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[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 modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClientModelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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** +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: http_basic_test + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(config); + var number = 8.14D; // decimal | None + var _double = 1.2D; // double | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None + var integer = 56; // int? | None (optional) + var int32 = 56; // int? | None (optional) + var int64 = 789L; // long? | None (optional) + var _float = 3.4F; // float? | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **decimal**| None | + **_double** | **double**| None | + **patternWithoutDelimiter** | **string**| None | + **_byte** | **byte[]**| None | + **integer** | **int?**| None | [optional] + **int32** | **int?**| None | [optional] + **int64** | **long?**| None | [optional] + **_float** | **float?**| None | [optional] + **_string** | **string**| None | [optional] + **binary** | **System.IO.Stream****System.IO.Stream**| None | [optional] + **date** | **DateTime?**| None | [optional] + **dateTime** | **DateTime?**| None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] + **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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[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** +> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) + var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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] + **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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +[[Back to top]](#) [[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** +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestGroupParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure Bearer token for authorization: bearer_test + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new FakeApi(config); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters + var stringGroup = 56; // int? | String in group parameters (optional) + var booleanGroup = true; // bool? | Boolean in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) + + try + { + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | + **stringGroup** | **int?**| String in group parameters | [optional] + **booleanGroup** | **bool?**| Boolean in group parameters | [optional] + **int64Group** | **long?**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + +[[Back to top]](#) [[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** +> void TestInlineAdditionalProperties (Dictionary requestBody) + +test inline additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Dictionary<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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeClassnameTags123Api.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..0708e362fb24 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeClassnameTags123Api.md @@ -0,0 +1,85 @@ +# Org.OpenAPITools.Api.FakeClassnameTags123Api + +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 modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClassnameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/PetApi.md new file mode 100644 index 000000000000..b61d64188309 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/PetApi.md @@ -0,0 +1,689 @@ +# Org.OpenAPITools.Api.PetApi + +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** +> void AddPet (Pet pet) + +Add a new pet to the store + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[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** +> void DeletePet (long petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[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<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[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** +> List<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<string>**](string.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[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 (long petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[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** +> void UpdatePet (Pet pet) + +Update an existing pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[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** +> void UpdatePetWithForm (long petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[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 (long petId, string additionalMetadata = null, System.IO.Stream file = null) + +uploads an image + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet to update | + **additionalMetadata** | **string**| Additional data to pass to server | [optional] + **file** | **System.IO.Stream****System.IO.Stream**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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 (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) + +uploads an image (required) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet to update | + **requiredFile** | **System.IO.Stream****System.IO.Stream**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/StoreApi.md new file mode 100644 index 000000000000..a1e45f5d7926 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/StoreApi.md @@ -0,0 +1,298 @@ +# Org.OpenAPITools.Api.StoreApi + +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** +> void DeleteOrder (string 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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[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** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Dictionary** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[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 (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789L; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **long**| 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[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 order) + +Place an order for a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/UserApi.md new file mode 100644 index 000000000000..70ff20fa8965 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/UserApi.md @@ -0,0 +1,573 @@ +# Org.OpenAPITools.Api.UserApi + +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** +> void CreateUser (User user) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[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 (string username) + +Get user by user name + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[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 (string username, string password) + +Logs user into the system + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[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** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[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** +> void UpdateUser (string username, User user) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | name that need to be deleted + var user = new User(); // User | Updated user object + + try + { + // Updated user + apiInstance.UpdateUser(username, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/AdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..1f9194500099 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/AdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**Anytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype3** | **Dictionary<string, Object>** | | [optional] +**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**MapWithUndeclaredPropertiesString** | **Dictionary<string, string>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Animal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Animal.md new file mode 100644 index 000000000000..1a1760bd8697 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Animal.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ApiResponse.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ApiResponse.md new file mode 100644 index 000000000000..bc808ceeae39 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ApiResponse.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ApiResponse + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Apple.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Apple.md new file mode 100644 index 000000000000..d40b527b3e04 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Apple.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/AppleReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/AppleReq.md new file mode 100644 index 000000000000..325521123f12 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/AppleReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.AppleReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..a23ba59e609c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayOfNumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..10b8413439b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayTest.md new file mode 100644 index 000000000000..32365e6d4d04 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ArrayTest.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **List<string>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Banana.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Banana.md new file mode 100644 index 000000000000..d32e90cf2985 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/BananaReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/BananaReq.md new file mode 100644 index 000000000000..c8372b73c5f7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/BananaReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.BananaReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/BasquePig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/BasquePig.md new file mode 100644 index 000000000000..db4f7a362268 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/BasquePig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BasquePig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Capitalization.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Capitalization.md new file mode 100644 index 000000000000..fde98a967ef8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Capitalization.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | **string** | | [optional] +**CapitalCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**ATT_NAME** | **string** | Name of the pet | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Cat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Cat.md new file mode 100644 index 000000000000..310a5e6575ec --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Cat.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/CatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/CatAllOf.md new file mode 100644 index 000000000000..3b4d9832501e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/CatAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Category.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Category.md new file mode 100644 index 000000000000..6eb0a2e13eaa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Category.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [default to "default-name"] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCat.md new file mode 100644 index 000000000000..88fe8f7a7fdd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCat.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [default to PetTypeEnum.ChildCat] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCatAllOf.md new file mode 100644 index 000000000000..9e853764bc66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCatAllOf.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ClassModel.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ClassModel.md new file mode 100644 index 000000000000..bb35816c9148 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ClassModel.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ClassModel +Model for testing model with \"_class\" property + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ComplexQuadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ComplexQuadrilateral.md new file mode 100644 index 000000000000..14da4bba22ed --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ComplexQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ComplexQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DanishPig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DanishPig.md new file mode 100644 index 000000000000..4d6ec1400a7e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DanishPig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DanishPig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DeprecatedObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DeprecatedObject.md new file mode 100644 index 000000000000..e90c59555a0d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DeprecatedObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DeprecatedObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Dog.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Dog.md new file mode 100644 index 000000000000..70cdc80e83e0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Dog.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DogAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DogAllOf.md new file mode 100644 index 000000000000..31618dfb2197 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/DogAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DogAllOf + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Drawing.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Drawing.md new file mode 100644 index 000000000000..18117e6c938c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Drawing.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Drawing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MainShape** | [**Shape**](Shape.md) | | [optional] +**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**Shapes** | [**List<Shape>**](Shape.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumArrays.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumArrays.md new file mode 100644 index 000000000000..c40bb19edd5e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumArrays.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EnumArrays + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumClass.md new file mode 100644 index 000000000000..d259f0f46968 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumClass.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumTest.md new file mode 100644 index 000000000000..d2b72b5368fb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumTest.md @@ -0,0 +1,18 @@ +# Org.OpenAPITools.Model.EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | **string** | | [optional] +**EnumStringRequired** | **string** | | +**EnumInteger** | **int** | | [optional] +**EnumIntegerOnly** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EquilateralTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EquilateralTriangle.md new file mode 100644 index 000000000000..8360b5c16a5b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EquilateralTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EquilateralTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/File.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/File.md new file mode 100644 index 000000000000..58b9c2fc3698 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/File.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.File +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FileSchemaTestClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FileSchemaTestClass.md new file mode 100644 index 000000000000..a47efad77d8a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Foo.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Foo.md new file mode 100644 index 000000000000..b9e7d261736f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Foo.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Foo + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md new file mode 100644 index 000000000000..b0d2f47b2eb6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md @@ -0,0 +1,25 @@ +# Org.OpenAPITools.Model.FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] +**Decimal** | **decimal** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | +**Binary** | **System.IO.Stream** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] +**Password** | **string** | | +**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Fruit.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Fruit.md new file mode 100644 index 000000000000..cb095b74f324 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Fruit.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] +**LengthCm** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FruitReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FruitReq.md new file mode 100644 index 000000000000..5afd947f4a63 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FruitReq.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.FruitReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [optional] +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/GmFruit.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/GmFruit.md new file mode 100644 index 000000000000..049f6f5c1574 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/GmFruit.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.GmFruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] +**LengthCm** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/GrandparentAnimal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/GrandparentAnimal.md new file mode 100644 index 000000000000..eca96162b6f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/GrandparentAnimal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GrandparentAnimal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/HasOnlyReadOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/HasOnlyReadOnly.md new file mode 100644 index 000000000000..060a614a6981 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Foo** | **string** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/HealthCheckResult.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/HealthCheckResult.md new file mode 100644 index 000000000000..682cfc50e3a4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/HealthCheckResult.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HealthCheckResult +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/InlineResponseDefault.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/InlineResponseDefault.md new file mode 100644 index 000000000000..0c1b0d5bb022 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/InlineResponseDefault.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.InlineResponseDefault + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/IsoscelesTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/IsoscelesTriangle.md new file mode 100644 index 000000000000..07c62ac93382 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/IsoscelesTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.IsoscelesTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/List.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/List.md new file mode 100644 index 000000000000..417d332b3afd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/List.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Mammal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Mammal.md new file mode 100644 index 000000000000..79d95fce63a3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Mammal.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Mammal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [optional] +**ClassName** | **string** | | +**Type** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MapTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MapTest.md new file mode 100644 index 000000000000..03bcebd3d9b2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MapTest.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | **Dictionary<string, string>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..031d2b960653 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Model200Response.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Model200Response.md new file mode 100644 index 000000000000..8bc8049f46f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Model200Response.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Model200Response +Model for testing model name starting with number + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ModelClient.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ModelClient.md new file mode 100644 index 000000000000..9e0e83645f30 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ModelClient.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ModelClient + +## 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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Name.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Name.md new file mode 100644 index 000000000000..1fbf5dd5e8b6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Name.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Name +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] [readonly] +**Property** | **string** | | [optional] +**_123Number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NullableClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NullableClass.md new file mode 100644 index 000000000000..d4a19d1856bc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NullableClass.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | **int?** | | [optional] +**NumberProp** | **decimal?** | | [optional] +**BooleanProp** | **bool?** | | [optional] +**StringProp** | **string** | | [optional] +**DateProp** | **DateTime?** | | [optional] +**DatetimeProp** | **DateTime?** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NullableShape.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NullableShape.md new file mode 100644 index 000000000000..570ef48f98fc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NullableShape.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.NullableShape +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NumberOnly.md new file mode 100644 index 000000000000..1b83cce764d3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/NumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ObjectWithDeprecatedFields.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..b737f7d757af --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ObjectWithDeprecatedFields.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.ObjectWithDeprecatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **string** | | [optional] +**Id** | **decimal** | | [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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Order.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Order.md new file mode 100644 index 000000000000..ca5d8992a513 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Order.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] +**Status** | **string** | Order Status | [optional] +**Complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterComposite.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterComposite.md new file mode 100644 index 000000000000..abf676810fb6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterComposite.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | **decimal** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnum.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnum.md new file mode 100644 index 000000000000..36844bc4b175 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumDefaultValue.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..351383f0aeae --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumInteger.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumInteger.md new file mode 100644 index 000000000000..1013b5b19565 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..55e314e3102d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ParentPet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ParentPet.md new file mode 100644 index 000000000000..bdf570056372 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ParentPet.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ParentPet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pet.md new file mode 100644 index 000000000000..6a9d41feb0d6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pet.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **string** | | +**PhotoUrls** | **List<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/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pig.md new file mode 100644 index 000000000000..fd7bb9359ac4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Pig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Quadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Quadrilateral.md new file mode 100644 index 000000000000..bb7507997a2f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Quadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Quadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/QuadrilateralInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/QuadrilateralInterface.md new file mode 100644 index 000000000000..756ba09c6ddf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/QuadrilateralInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.QuadrilateralInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ReadOnlyFirst.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ReadOnlyFirst.md new file mode 100644 index 000000000000..afaf2ee4fb6c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Baz** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Return.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Return.md new file mode 100644 index 000000000000..a1dadccc421d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Return.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Return +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ScaleneTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ScaleneTriangle.md new file mode 100644 index 000000000000..d3f15354bccc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ScaleneTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ScaleneTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Shape.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Shape.md new file mode 100644 index 000000000000..5627c30bbfc7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Shape.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Shape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ShapeInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ShapeInterface.md new file mode 100644 index 000000000000..882d31868305 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ShapeInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ShapeInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ShapeOrNull.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ShapeOrNull.md new file mode 100644 index 000000000000..a348f4f8bff5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ShapeOrNull.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ShapeOrNull +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/SimpleQuadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/SimpleQuadrilateral.md new file mode 100644 index 000000000000..a36c9957a609 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/SimpleQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SimpleQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/SpecialModelName.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/SpecialModelName.md new file mode 100644 index 000000000000..fa146367bdea --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/SpecialModelName.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | **long** | | [optional] +**_SpecialModelName** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Tag.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Tag.md new file mode 100644 index 000000000000..2b2d9674d619 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Tag.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Triangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Triangle.md new file mode 100644 index 000000000000..74232c3ced98 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Triangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Triangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TriangleInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TriangleInterface.md new file mode 100644 index 000000000000..4127c08b14f3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TriangleInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TriangleInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/User.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/User.md new file mode 100644 index 000000000000..a0f0d2238998 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/User.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Username** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Email** | **string** | | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] +**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**AnyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**AnyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Whale.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Whale.md new file mode 100644 index 000000000000..afbc08409d22 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Whale.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Whale + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [optional] +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Zebra.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Zebra.md new file mode 100644 index 000000000000..4c5a820bac04 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Zebra.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Zebra + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | | [optional] +**ClassName** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/scripts/git_push.ps1 new file mode 100644 index 000000000000..0a2d4e52280a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your prefered git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/scripts/git_push.sh b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/scripts/git_push.sh new file mode 100644 index 000000000000..882104922184 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 000000000000..fea7e39428f6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing AnotherFakeApi + /// + public sealed class AnotherFakeApiTests : ApiTestsBase + { + private readonly IAnotherFakeApi _instance; + + public AnotherFakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test Call123TestSpecialTags + /// + [Fact (Skip = "not implemented")] + public async Task Call123TestSpecialTagsAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.Call123TestSpecialTagsAsync(modelClient); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 000000000000..88d6fc1f4880 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + ApiKeyToken apiKeyToken = new ApiKeyToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken(context.Configuration[""], context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + }); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 000000000000..062cf4363669 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test FooGet + /// + [Fact (Skip = "not implemented")] + public async Task FooGetAsyncTest() + { + var response = await _instance.FooGetAsync(); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 000000000000..4eee3d2b6eb4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,230 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, options) => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, options) => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var anotherFakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs new file mode 100644 index 000000000000..a730ebd21acf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeApi + /// + public sealed class FakeApiTests : ApiTestsBase + { + private readonly IFakeApi _instance; + + public FakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test FakeHealthGet + /// + [Fact (Skip = "not implemented")] + public async Task FakeHealthGetAsyncTest() + { + var response = await _instance.FakeHealthGetAsync(); + Assert.IsType(response); + } + + /// + /// Test FakeOuterBooleanSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterBooleanSerializeAsyncTest() + { + bool? body = default; + var response = await _instance.FakeOuterBooleanSerializeAsync(body); + Assert.IsType(response); + } + + /// + /// Test FakeOuterCompositeSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterCompositeSerializeAsyncTest() + { + OuterComposite outerComposite = default; + var response = await _instance.FakeOuterCompositeSerializeAsync(outerComposite); + Assert.IsType(response); + } + + /// + /// Test FakeOuterNumberSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterNumberSerializeAsyncTest() + { + decimal? body = default; + var response = await _instance.FakeOuterNumberSerializeAsync(body); + Assert.IsType(response); + } + + /// + /// Test FakeOuterStringSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterStringSerializeAsyncTest() + { + string body = default; + var response = await _instance.FakeOuterStringSerializeAsync(body); + Assert.IsType(response); + } + + /// + /// Test GetArrayOfEnums + /// + [Fact (Skip = "not implemented")] + public async Task GetArrayOfEnumsAsyncTest() + { + var response = await _instance.GetArrayOfEnumsAsync(); + Assert.IsType>(response); + } + + /// + /// Test TestBodyWithFileSchema + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithFileSchemaAsyncTest() + { + FileSchemaTestClass fileSchemaTestClass = default; + await _instance.TestBodyWithFileSchemaAsync(fileSchemaTestClass); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithQueryParamsAsyncTest() + { + string query = default; + User user = default; + await _instance.TestBodyWithQueryParamsAsync(query, user); + } + + /// + /// Test TestClientModel + /// + [Fact (Skip = "not implemented")] + public async Task TestClientModelAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClientModelAsync(modelClient); + Assert.IsType(response); + } + + /// + /// Test TestEndpointParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEndpointParametersAsyncTest() + { + decimal number = default; + double _double = default; + string patternWithoutDelimiter = default; + byte[] _byte = default; + int? integer = default; + int? int32 = default; + long? int64 = default; + float? _float = default; + string _string = default; + System.IO.Stream binary = default; + DateTime? date = default; + DateTime? dateTime = default; + string password = default; + string callback = default; + await _instance.TestEndpointParametersAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + + /// + /// Test TestEnumParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEnumParametersAsyncTest() + { + List enumHeaderStringArray = default; + string enumHeaderString = default; + List enumQueryStringArray = default; + string enumQueryString = default; + int? enumQueryInteger = default; + double? enumQueryDouble = default; + List enumFormStringArray = default; + string enumFormString = default; + await _instance.TestEnumParametersAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /// + /// Test TestGroupParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestGroupParametersAsyncTest() + { + int requiredStringGroup = default; + bool requiredBooleanGroup = default; + long requiredInt64Group = default; + int? stringGroup = default; + bool? booleanGroup = default; + long? int64Group = default; + await _instance.TestGroupParametersAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /// + /// Test TestInlineAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineAdditionalPropertiesAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestInlineAdditionalPropertiesAsync(requestBody); + } + + /// + /// Test TestJsonFormData + /// + [Fact (Skip = "not implemented")] + public async Task TestJsonFormDataAsyncTest() + { + string param = default; + string param2 = default; + await _instance.TestJsonFormDataAsync(param, param2); + } + + /// + /// Test TestQueryParameterCollectionFormat + /// + [Fact (Skip = "not implemented")] + public async Task TestQueryParameterCollectionFormatAsyncTest() + { + List pipe = default; + List ioutil = default; + List http = default; + List url = default; + List context = default; + await _instance.TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 000000000000..0e8d44fe985a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + public sealed class FakeClassnameTags123ApiTests : ApiTestsBase + { + private readonly IFakeClassnameTags123Api _instance; + + public FakeClassnameTags123ApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test TestClassname + /// + [Fact (Skip = "not implemented")] + public async Task TestClassnameAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClassnameAsync(modelClient); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/PetApiTests.cs new file mode 100644 index 000000000000..92922eda1b7f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + public sealed class PetApiTests : ApiTestsBase + { + private readonly IPetApi _instance; + + public PetApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test AddPet + /// + [Fact (Skip = "not implemented")] + public async Task AddPetAsyncTest() + { + Pet pet = default; + await _instance.AddPetAsync(pet); + } + + /// + /// Test DeletePet + /// + [Fact (Skip = "not implemented")] + public async Task DeletePetAsyncTest() + { + long petId = default; + string apiKey = default; + await _instance.DeletePetAsync(petId, apiKey); + } + + /// + /// Test FindPetsByStatus + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByStatusAsyncTest() + { + List status = default; + var response = await _instance.FindPetsByStatusAsync(status); + Assert.IsType>(response); + } + + /// + /// Test FindPetsByTags + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByTagsAsyncTest() + { + List tags = default; + var response = await _instance.FindPetsByTagsAsync(tags); + Assert.IsType>(response); + } + + /// + /// Test GetPetById + /// + [Fact (Skip = "not implemented")] + public async Task GetPetByIdAsyncTest() + { + long petId = default; + var response = await _instance.GetPetByIdAsync(petId); + Assert.IsType(response); + } + + /// + /// Test UpdatePet + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetAsyncTest() + { + Pet pet = default; + await _instance.UpdatePetAsync(pet); + } + + /// + /// Test UpdatePetWithForm + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetWithFormAsyncTest() + { + long petId = default; + string name = default; + string status = default; + await _instance.UpdatePetWithFormAsync(petId, name, status); + } + + /// + /// Test UploadFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileAsyncTest() + { + long petId = default; + string additionalMetadata = default; + System.IO.Stream file = default; + var response = await _instance.UploadFileAsync(petId, additionalMetadata, file); + Assert.IsType(response); + } + + /// + /// Test UploadFileWithRequiredFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileWithRequiredFileAsyncTest() + { + long petId = default; + System.IO.Stream requiredFile = default; + string additionalMetadata = default; + var response = await _instance.UploadFileWithRequiredFileAsync(petId, requiredFile, additionalMetadata); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs new file mode 100644 index 000000000000..98748893e324 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + public sealed class StoreApiTests : ApiTestsBase + { + private readonly IStoreApi _instance; + + public StoreApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test DeleteOrder + /// + [Fact (Skip = "not implemented")] + public async Task DeleteOrderAsyncTest() + { + string orderId = default; + await _instance.DeleteOrderAsync(orderId); + } + + /// + /// Test GetInventory + /// + [Fact (Skip = "not implemented")] + public async Task GetInventoryAsyncTest() + { + var response = await _instance.GetInventoryAsync(); + Assert.IsType>(response); + } + + /// + /// Test GetOrderById + /// + [Fact (Skip = "not implemented")] + public async Task GetOrderByIdAsyncTest() + { + long orderId = default; + var response = await _instance.GetOrderByIdAsync(orderId); + Assert.IsType(response); + } + + /// + /// Test PlaceOrder + /// + [Fact (Skip = "not implemented")] + public async Task PlaceOrderAsyncTest() + { + Order order = default; + var response = await _instance.PlaceOrderAsync(order); + Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/UserApiTests.cs new file mode 100644 index 000000000000..0df256733af7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -0,0 +1,137 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + public sealed class UserApiTests : ApiTestsBase + { + private readonly IUserApi _instance; + + public UserApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + + /// + /// Test CreateUser + /// + [Fact (Skip = "not implemented")] + public async Task CreateUserAsyncTest() + { + User user = default; + await _instance.CreateUserAsync(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithArrayInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithArrayInputAsync(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithListInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithListInputAsync(user); + } + + /// + /// Test DeleteUser + /// + [Fact (Skip = "not implemented")] + public async Task DeleteUserAsyncTest() + { + string username = default; + await _instance.DeleteUserAsync(username); + } + + /// + /// Test GetUserByName + /// + [Fact (Skip = "not implemented")] + public async Task GetUserByNameAsyncTest() + { + string username = default; + var response = await _instance.GetUserByNameAsync(username); + Assert.IsType(response); + } + + /// + /// Test LoginUser + /// + [Fact (Skip = "not implemented")] + public async Task LoginUserAsyncTest() + { + string username = default; + string password = default; + var response = await _instance.LoginUserAsync(username, password); + Assert.IsType(response); + } + + /// + /// Test LogoutUser + /// + [Fact (Skip = "not implemented")] + public async Task LogoutUserAsyncTest() + { + await _instance.LogoutUserAsync(); + } + + /// + /// Test UpdateUser + /// + [Fact (Skip = "not implemented")] + public async Task UpdateUserAsyncTest() + { + string username = default; + User user = default; + await _instance.UpdateUserAsync(username, user); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs new file mode 100644 index 000000000000..9ab029ed0979 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -0,0 +1,126 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing AdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AdditionalPropertiesClass + //private AdditionalPropertiesClass instance; + + public AdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of AdditionalPropertiesClass + //instance = new AdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AdditionalPropertiesClass + /// + [Fact] + public void AdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" AdditionalPropertiesClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MapProperty' + /// + [Fact] + public void MapPropertyTest() + { + // TODO unit test for the property 'MapProperty' + } + /// + /// Test the property 'MapOfMapProperty' + /// + [Fact] + public void MapOfMapPropertyTest() + { + // TODO unit test for the property 'MapOfMapProperty' + } + /// + /// Test the property 'Anytype1' + /// + [Fact] + public void Anytype1Test() + { + // TODO unit test for the property 'Anytype1' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype1' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype1Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype1' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype2' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype2Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype2' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype3' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype3Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype3' + } + /// + /// Test the property 'EmptyMap' + /// + [Fact] + public void EmptyMapTest() + { + // TODO unit test for the property 'EmptyMap' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesString' + /// + [Fact] + public void MapWithUndeclaredPropertiesStringTest() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs new file mode 100644 index 000000000000..291231a91bef --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Animal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Animal + //private Animal instance; + + public AnimalTests() + { + // TODO uncomment below to create an instance of Animal + //instance = new Animal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Animal + /// + [Fact] + public void AnimalInstanceTest() + { + // TODO uncomment below to test "IsType" Animal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Dog from type Animal + /// + [Fact] + public void DogDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Dog from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Dog().ToJson())); + } + /// + /// Test deserialize a Cat from type Animal + /// + [Fact] + public void CatDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Cat from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Cat().ToJson())); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs new file mode 100644 index 000000000000..2a2e098e6082 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Fact] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs new file mode 100644 index 000000000000..f945f6593685 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing AppleReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AppleReq + //private AppleReq instance; + + public AppleReqTests() + { + // TODO uncomment below to create an instance of AppleReq + //instance = new AppleReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AppleReq + /// + [Fact] + public void AppleReqInstanceTest() + { + // TODO uncomment below to test "IsType" AppleReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 000000000000..468d60184ada --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 000000000000..0b259d7d3916 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly + //private ArrayOfArrayOfNumberOnly instance; + + public ArrayOfArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly + //instance = new ArrayOfArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Fact] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfArrayOfNumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Fact] + public void ArrayArrayNumberTest() + { + // TODO unit test for the property 'ArrayArrayNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs new file mode 100644 index 000000000000..27f312ad25f5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfNumberOnly + //private ArrayOfNumberOnly instance; + + public ArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfNumberOnly + //instance = new ArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfNumberOnly + /// + [Fact] + public void ArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfNumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayNumber' + /// + [Fact] + public void ArrayNumberTest() + { + // TODO unit test for the property 'ArrayNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs new file mode 100644 index 000000000000..a433e8c87cf7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayTest + //private ArrayTest instance; + + public ArrayTestTests() + { + // TODO uncomment below to create an instance of ArrayTest + //instance = new ArrayTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayTest + /// + [Fact] + public void ArrayTestInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayOfString' + /// + [Fact] + public void ArrayOfStringTest() + { + // TODO unit test for the property 'ArrayOfString' + } + /// + /// Test the property 'ArrayArrayOfInteger' + /// + [Fact] + public void ArrayArrayOfIntegerTest() + { + // TODO unit test for the property 'ArrayArrayOfInteger' + } + /// + /// Test the property 'ArrayArrayOfModel' + /// + [Fact] + public void ArrayArrayOfModelTest() + { + // TODO unit test for the property 'ArrayArrayOfModel' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs new file mode 100644 index 000000000000..8a6eeb82eeea --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing BananaReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BananaReq + //private BananaReq instance; + + public BananaReqTests() + { + // TODO uncomment below to create an instance of BananaReq + //instance = new BananaReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BananaReq + /// + [Fact] + public void BananaReqInstanceTest() + { + // TODO uncomment below to test "IsType" BananaReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 000000000000..8d8cc376b038 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs new file mode 100644 index 000000000000..3cdccaa75959 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing BasquePig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BasquePigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BasquePig + //private BasquePig instance; + + public BasquePigTests() + { + // TODO uncomment below to create an instance of BasquePig + //instance = new BasquePig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BasquePig + /// + [Fact] + public void BasquePigInstanceTest() + { + // TODO uncomment below to test "IsType" BasquePig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs new file mode 100644 index 000000000000..185c83666fc7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Capitalization + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CapitalizationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Capitalization + //private Capitalization instance; + + public CapitalizationTests() + { + // TODO uncomment below to create an instance of Capitalization + //instance = new Capitalization(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Capitalization + /// + [Fact] + public void CapitalizationInstanceTest() + { + // TODO uncomment below to test "IsType" Capitalization + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SmallCamel' + /// + [Fact] + public void SmallCamelTest() + { + // TODO unit test for the property 'SmallCamel' + } + /// + /// Test the property 'CapitalCamel' + /// + [Fact] + public void CapitalCamelTest() + { + // TODO unit test for the property 'CapitalCamel' + } + /// + /// Test the property 'SmallSnake' + /// + [Fact] + public void SmallSnakeTest() + { + // TODO unit test for the property 'SmallSnake' + } + /// + /// Test the property 'CapitalSnake' + /// + [Fact] + public void CapitalSnakeTest() + { + // TODO unit test for the property 'CapitalSnake' + } + /// + /// Test the property 'SCAETHFlowPoints' + /// + [Fact] + public void SCAETHFlowPointsTest() + { + // TODO unit test for the property 'SCAETHFlowPoints' + } + /// + /// Test the property 'ATT_NAME' + /// + [Fact] + public void ATT_NAMETest() + { + // TODO unit test for the property 'ATT_NAME' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs new file mode 100644 index 000000000000..fb51c28489cb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing CatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CatAllOf + //private CatAllOf instance; + + public CatAllOfTests() + { + // TODO uncomment below to create an instance of CatAllOf + //instance = new CatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of CatAllOf + /// + [Fact] + public void CatAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" CatAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatTests.cs new file mode 100644 index 000000000000..701ba7602823 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Cat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Cat + //private Cat instance; + + public CatTests() + { + // TODO uncomment below to create an instance of Cat + //instance = new Cat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Cat + /// + [Fact] + public void CatInstanceTest() + { + // TODO uncomment below to test "IsType" Cat + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs new file mode 100644 index 000000000000..6ce48e601e47 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Category + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CategoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + public CategoryTests() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Category + /// + [Fact] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs new file mode 100644 index 000000000000..49a539324904 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ChildCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCatAllOf + //private ChildCatAllOf instance; + + public ChildCatAllOfTests() + { + // TODO uncomment below to create an instance of ChildCatAllOf + //instance = new ChildCatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCatAllOf + /// + [Fact] + public void ChildCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCatAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs new file mode 100644 index 000000000000..68566fd8d560 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ChildCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCat + //private ChildCat instance; + + public ChildCatTests() + { + // TODO uncomment below to create an instance of ChildCat + //instance = new ChildCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCat + /// + [Fact] + public void ChildCatInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCat + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs new file mode 100644 index 000000000000..d29472e83aaf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ClassModel + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ClassModelTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ClassModel + //private ClassModel instance; + + public ClassModelTests() + { + // TODO uncomment below to create an instance of ClassModel + //instance = new ClassModel(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ClassModel + /// + [Fact] + public void ClassModelInstanceTest() + { + // TODO uncomment below to test "IsType" ClassModel + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs new file mode 100644 index 000000000000..b3529280c8d6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ComplexQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ComplexQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ComplexQuadrilateral + //private ComplexQuadrilateral instance; + + public ComplexQuadrilateralTests() + { + // TODO uncomment below to create an instance of ComplexQuadrilateral + //instance = new ComplexQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ComplexQuadrilateral + /// + [Fact] + public void ComplexQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" ComplexQuadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs new file mode 100644 index 000000000000..572d9bffa790 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DanishPig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DanishPigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DanishPig + //private DanishPig instance; + + public DanishPigTests() + { + // TODO uncomment below to create an instance of DanishPig + //instance = new DanishPig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DanishPig + /// + [Fact] + public void DanishPigInstanceTest() + { + // TODO uncomment below to test "IsType" DanishPig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs new file mode 100644 index 000000000000..1da5f4011c95 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DeprecatedObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DeprecatedObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DeprecatedObject + //private DeprecatedObject instance; + + public DeprecatedObjectTests() + { + // TODO uncomment below to create an instance of DeprecatedObject + //instance = new DeprecatedObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DeprecatedObject + /// + [Fact] + public void DeprecatedObjectInstanceTest() + { + // TODO uncomment below to test "IsType" DeprecatedObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs new file mode 100644 index 000000000000..b22a44420963 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DogAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DogAllOf + //private DogAllOf instance; + + public DogAllOfTests() + { + // TODO uncomment below to create an instance of DogAllOf + //instance = new DogAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DogAllOf + /// + [Fact] + public void DogAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" DogAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogTests.cs new file mode 100644 index 000000000000..992f93a51fd5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Dog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Dog + //private Dog instance; + + public DogTests() + { + // TODO uncomment below to create an instance of Dog + //instance = new Dog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Dog + /// + [Fact] + public void DogInstanceTest() + { + // TODO uncomment below to test "IsType" Dog + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs new file mode 100644 index 000000000000..0709ad9eeb3b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Drawing + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DrawingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Drawing + //private Drawing instance; + + public DrawingTests() + { + // TODO uncomment below to create an instance of Drawing + //instance = new Drawing(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Drawing + /// + [Fact] + public void DrawingInstanceTest() + { + // TODO uncomment below to test "IsType" Drawing + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MainShape' + /// + [Fact] + public void MainShapeTest() + { + // TODO unit test for the property 'MainShape' + } + /// + /// Test the property 'ShapeOrNull' + /// + [Fact] + public void ShapeOrNullTest() + { + // TODO unit test for the property 'ShapeOrNull' + } + /// + /// Test the property 'NullableShape' + /// + [Fact] + public void NullableShapeTest() + { + // TODO unit test for the property 'NullableShape' + } + /// + /// Test the property 'Shapes' + /// + [Fact] + public void ShapesTest() + { + // TODO unit test for the property 'Shapes' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs new file mode 100644 index 000000000000..5779ca294775 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumArrays + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArrays + //private EnumArrays instance; + + public EnumArraysTests() + { + // TODO uncomment below to create an instance of EnumArrays + //instance = new EnumArrays(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArrays + /// + [Fact] + public void EnumArraysInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArrays + //Assert.IsType(instance); + } + + + /// + /// Test the property 'JustSymbol' + /// + [Fact] + public void JustSymbolTest() + { + // TODO unit test for the property 'JustSymbol' + } + /// + /// Test the property 'ArrayEnum' + /// + [Fact] + public void ArrayEnumTest() + { + // TODO unit test for the property 'ArrayEnum' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs new file mode 100644 index 000000000000..a17738c5cbc5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumClass + //private EnumClass instance; + + public EnumClassTests() + { + // TODO uncomment below to create an instance of EnumClass + //instance = new EnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumClass + /// + [Fact] + public void EnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" EnumClass + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs new file mode 100644 index 000000000000..4f81b845d493 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTest + //private EnumTest instance; + + public EnumTestTests() + { + // TODO uncomment below to create an instance of EnumTest + //instance = new EnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTest + /// + [Fact] + public void EnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EnumString' + /// + [Fact] + public void EnumStringTest() + { + // TODO unit test for the property 'EnumString' + } + /// + /// Test the property 'EnumStringRequired' + /// + [Fact] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + /// + /// Test the property 'EnumInteger' + /// + [Fact] + public void EnumIntegerTest() + { + // TODO unit test for the property 'EnumInteger' + } + /// + /// Test the property 'EnumIntegerOnly' + /// + [Fact] + public void EnumIntegerOnlyTest() + { + // TODO unit test for the property 'EnumIntegerOnly' + } + /// + /// Test the property 'EnumNumber' + /// + [Fact] + public void EnumNumberTest() + { + // TODO unit test for the property 'EnumNumber' + } + /// + /// Test the property 'OuterEnum' + /// + [Fact] + public void OuterEnumTest() + { + // TODO unit test for the property 'OuterEnum' + } + /// + /// Test the property 'OuterEnumInteger' + /// + [Fact] + public void OuterEnumIntegerTest() + { + // TODO unit test for the property 'OuterEnumInteger' + } + /// + /// Test the property 'OuterEnumDefaultValue' + /// + [Fact] + public void OuterEnumDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumDefaultValue' + } + /// + /// Test the property 'OuterEnumIntegerDefaultValue' + /// + [Fact] + public void OuterEnumIntegerDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumIntegerDefaultValue' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs new file mode 100644 index 000000000000..4663cb667de6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EquilateralTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EquilateralTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EquilateralTriangle + //private EquilateralTriangle instance; + + public EquilateralTriangleTests() + { + // TODO uncomment below to create an instance of EquilateralTriangle + //instance = new EquilateralTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EquilateralTriangle + /// + [Fact] + public void EquilateralTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" EquilateralTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs new file mode 100644 index 000000000000..9f45b4fe89d5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FileSchemaTestClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileSchemaTestClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FileSchemaTestClass + //private FileSchemaTestClass instance; + + public FileSchemaTestClassTests() + { + // TODO uncomment below to create an instance of FileSchemaTestClass + //instance = new FileSchemaTestClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FileSchemaTestClass + /// + [Fact] + public void FileSchemaTestClassInstanceTest() + { + // TODO uncomment below to test "IsType" FileSchemaTestClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + /// + /// Test the property 'Files' + /// + [Fact] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileTests.cs new file mode 100644 index 000000000000..761bb72a844f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing File + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileTests : IDisposable + { + // TODO uncomment below to declare an instance variable for File + //private File instance; + + public FileTests() + { + // TODO uncomment below to create an instance of File + //instance = new File(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of File + /// + [Fact] + public void FileInstanceTest() + { + // TODO uncomment below to test "IsType" File + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SourceURI' + /// + [Fact] + public void SourceURITest() + { + // TODO unit test for the property 'SourceURI' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooTests.cs new file mode 100644 index 000000000000..0b6ed52edbd4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Foo + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Foo + //private Foo instance; + + public FooTests() + { + // TODO uncomment below to create an instance of Foo + //instance = new Foo(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Foo + /// + [Fact] + public void FooInstanceTest() + { + // TODO uncomment below to test "IsType" Foo + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs new file mode 100644 index 000000000000..97332800e9af --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -0,0 +1,190 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FormatTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FormatTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FormatTest + //private FormatTest instance; + + public FormatTestTests() + { + // TODO uncomment below to create an instance of FormatTest + //instance = new FormatTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FormatTest + /// + [Fact] + public void FormatTestInstanceTest() + { + // TODO uncomment below to test "IsType" FormatTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Integer' + /// + [Fact] + public void IntegerTest() + { + // TODO unit test for the property 'Integer' + } + /// + /// Test the property 'Int32' + /// + [Fact] + public void Int32Test() + { + // TODO unit test for the property 'Int32' + } + /// + /// Test the property 'Int64' + /// + [Fact] + public void Int64Test() + { + // TODO unit test for the property 'Int64' + } + /// + /// Test the property 'Number' + /// + [Fact] + public void NumberTest() + { + // TODO unit test for the property 'Number' + } + /// + /// Test the property 'Float' + /// + [Fact] + public void FloatTest() + { + // TODO unit test for the property 'Float' + } + /// + /// Test the property 'Double' + /// + [Fact] + public void DoubleTest() + { + // TODO unit test for the property 'Double' + } + /// + /// Test the property 'Decimal' + /// + [Fact] + public void DecimalTest() + { + // TODO unit test for the property 'Decimal' + } + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + /// + /// Test the property 'Byte' + /// + [Fact] + public void ByteTest() + { + // TODO unit test for the property 'Byte' + } + /// + /// Test the property 'Binary' + /// + [Fact] + public void BinaryTest() + { + // TODO unit test for the property 'Binary' + } + /// + /// Test the property 'Date' + /// + [Fact] + public void DateTest() + { + // TODO unit test for the property 'Date' + } + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'PatternWithDigits' + /// + [Fact] + public void PatternWithDigitsTest() + { + // TODO unit test for the property 'PatternWithDigits' + } + /// + /// Test the property 'PatternWithDigitsAndDelimiter' + /// + [Fact] + public void PatternWithDigitsAndDelimiterTest() + { + // TODO unit test for the property 'PatternWithDigitsAndDelimiter' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs new file mode 100644 index 000000000000..5ea9e3ffc1d5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FruitReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FruitReq + //private FruitReq instance; + + public FruitReqTests() + { + // TODO uncomment below to create an instance of FruitReq + //instance = new FruitReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FruitReq + /// + [Fact] + public void FruitReqInstanceTest() + { + // TODO uncomment below to test "IsType" FruitReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 000000000000..91e069bb42fa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs new file mode 100644 index 000000000000..08fb0e07a1c8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GmFruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GmFruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GmFruit + //private GmFruit instance; + + public GmFruitTests() + { + // TODO uncomment below to create an instance of GmFruit + //instance = new GmFruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GmFruit + /// + [Fact] + public void GmFruitInstanceTest() + { + // TODO uncomment below to test "IsType" GmFruit + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs new file mode 100644 index 000000000000..75f4fd8b0e52 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -0,0 +1,88 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GrandparentAnimal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GrandparentAnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GrandparentAnimal + //private GrandparentAnimal instance; + + public GrandparentAnimalTests() + { + // TODO uncomment below to create an instance of GrandparentAnimal + //instance = new GrandparentAnimal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GrandparentAnimal + /// + [Fact] + public void GrandparentAnimalInstanceTest() + { + // TODO uncomment below to test "IsType" GrandparentAnimal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ParentPet from type GrandparentAnimal + /// + [Fact] + public void ParentPetDeserializeFromGrandparentAnimalTest() + { + // TODO uncomment below to test deserialize a ParentPet from type GrandparentAnimal + //Assert.IsType(JsonConvert.DeserializeObject(new ParentPet().ToJson())); + } + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs new file mode 100644 index 000000000000..651a9f0ce30c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing HasOnlyReadOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HasOnlyReadOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HasOnlyReadOnly + //private HasOnlyReadOnly instance; + + public HasOnlyReadOnlyTests() + { + // TODO uncomment below to create an instance of HasOnlyReadOnly + //instance = new HasOnlyReadOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HasOnlyReadOnly + /// + [Fact] + public void HasOnlyReadOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" HasOnlyReadOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Foo' + /// + [Fact] + public void FooTest() + { + // TODO unit test for the property 'Foo' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs new file mode 100644 index 000000000000..857190a3334d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing HealthCheckResult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HealthCheckResultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HealthCheckResult + //private HealthCheckResult instance; + + public HealthCheckResultTests() + { + // TODO uncomment below to create an instance of HealthCheckResult + //instance = new HealthCheckResult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HealthCheckResult + /// + [Fact] + public void HealthCheckResultInstanceTest() + { + // TODO uncomment below to test "IsType" HealthCheckResult + //Assert.IsType(instance); + } + + + /// + /// Test the property 'NullableMessage' + /// + [Fact] + public void NullableMessageTest() + { + // TODO unit test for the property 'NullableMessage' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs new file mode 100644 index 000000000000..7731f80c16db --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/InlineResponseDefaultTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing InlineResponseDefault + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class InlineResponseDefaultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for InlineResponseDefault + //private InlineResponseDefault instance; + + public InlineResponseDefaultTests() + { + // TODO uncomment below to create an instance of InlineResponseDefault + //instance = new InlineResponseDefault(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of InlineResponseDefault + /// + [Fact] + public void InlineResponseDefaultInstanceTest() + { + // TODO uncomment below to test "IsType" InlineResponseDefault + //Assert.IsType(instance); + } + + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs new file mode 100644 index 000000000000..755c417cc54f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing IsoscelesTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class IsoscelesTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for IsoscelesTriangle + //private IsoscelesTriangle instance; + + public IsoscelesTriangleTests() + { + // TODO uncomment below to create an instance of IsoscelesTriangle + //instance = new IsoscelesTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of IsoscelesTriangle + /// + [Fact] + public void IsoscelesTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" IsoscelesTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ListTests.cs new file mode 100644 index 000000000000..2ed828d05208 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing List + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for List + //private List instance; + + public ListTests() + { + // TODO uncomment below to create an instance of List + //instance = new List(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of List + /// + [Fact] + public void ListInstanceTest() + { + // TODO uncomment below to test "IsType" List + //Assert.IsType(instance); + } + + + /// + /// Test the property '_123List' + /// + [Fact] + public void _123ListTest() + { + // TODO unit test for the property '_123List' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs new file mode 100644 index 000000000000..7b46cbf06450 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Mammal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MammalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Mammal + //private Mammal instance; + + public MammalTests() + { + // TODO uncomment below to create an instance of Mammal + //instance = new Mammal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Mammal + /// + [Fact] + public void MammalInstanceTest() + { + // TODO uncomment below to test "IsType" Mammal + //Assert.IsType(instance); + } + + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs new file mode 100644 index 000000000000..20036e1c905e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MapTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTest + //private MapTest instance; + + public MapTestTests() + { + // TODO uncomment below to create an instance of MapTest + //instance = new MapTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTest + /// + [Fact] + public void MapTestInstanceTest() + { + // TODO uncomment below to test "IsType" MapTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MapMapOfString' + /// + [Fact] + public void MapMapOfStringTest() + { + // TODO unit test for the property 'MapMapOfString' + } + /// + /// Test the property 'MapOfEnumString' + /// + [Fact] + public void MapOfEnumStringTest() + { + // TODO unit test for the property 'MapOfEnumString' + } + /// + /// Test the property 'DirectMap' + /// + [Fact] + public void DirectMapTest() + { + // TODO unit test for the property 'DirectMap' + } + /// + /// Test the property 'IndirectMap' + /// + [Fact] + public void IndirectMapTest() + { + // TODO unit test for the property 'IndirectMap' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs new file mode 100644 index 000000000000..f56cd715f45f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixedPropertiesAndAdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedPropertiesAndAdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass + //private MixedPropertiesAndAdditionalPropertiesClass instance; + + public MixedPropertiesAndAdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass + //instance = new MixedPropertiesAndAdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass + /// + [Fact] + public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" MixedPropertiesAndAdditionalPropertiesClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Map' + /// + [Fact] + public void MapTest() + { + // TODO unit test for the property 'Map' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs new file mode 100644 index 000000000000..e25478618f20 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Model200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class Model200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Model200Response + //private Model200Response instance; + + public Model200ResponseTests() + { + // TODO uncomment below to create an instance of Model200Response + //instance = new Model200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Model200Response + /// + [Fact] + public void Model200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" Model200Response + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs new file mode 100644 index 000000000000..24a9e2631586 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ModelClient + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ModelClientTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ModelClient + //private ModelClient instance; + + public ModelClientTests() + { + // TODO uncomment below to create an instance of ModelClient + //instance = new ModelClient(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ModelClient + /// + [Fact] + public void ModelClientInstanceTest() + { + // TODO uncomment below to test "IsType" ModelClient + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Client' + /// + [Fact] + public void _ClientTest() + { + // TODO unit test for the property '_Client' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NameTests.cs new file mode 100644 index 000000000000..c390049e66dc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Name + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Name + //private Name instance; + + public NameTests() + { + // TODO uncomment below to create an instance of Name + //instance = new Name(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Name + /// + [Fact] + public void NameInstanceTest() + { + // TODO uncomment below to test "IsType" Name + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Name' + /// + [Fact] + public void _NameTest() + { + // TODO unit test for the property '_Name' + } + /// + /// Test the property 'SnakeCase' + /// + [Fact] + public void SnakeCaseTest() + { + // TODO unit test for the property 'SnakeCase' + } + /// + /// Test the property 'Property' + /// + [Fact] + public void PropertyTest() + { + // TODO unit test for the property 'Property' + } + /// + /// Test the property '_123Number' + /// + [Fact] + public void _123NumberTest() + { + // TODO unit test for the property '_123Number' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs new file mode 100644 index 000000000000..8f00505612a9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NullableClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableClass + //private NullableClass instance; + + public NullableClassTests() + { + // TODO uncomment below to create an instance of NullableClass + //instance = new NullableClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableClass + /// + [Fact] + public void NullableClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'IntegerProp' + /// + [Fact] + public void IntegerPropTest() + { + // TODO unit test for the property 'IntegerProp' + } + /// + /// Test the property 'NumberProp' + /// + [Fact] + public void NumberPropTest() + { + // TODO unit test for the property 'NumberProp' + } + /// + /// Test the property 'BooleanProp' + /// + [Fact] + public void BooleanPropTest() + { + // TODO unit test for the property 'BooleanProp' + } + /// + /// Test the property 'StringProp' + /// + [Fact] + public void StringPropTest() + { + // TODO unit test for the property 'StringProp' + } + /// + /// Test the property 'DateProp' + /// + [Fact] + public void DatePropTest() + { + // TODO unit test for the property 'DateProp' + } + /// + /// Test the property 'DatetimeProp' + /// + [Fact] + public void DatetimePropTest() + { + // TODO unit test for the property 'DatetimeProp' + } + /// + /// Test the property 'ArrayNullableProp' + /// + [Fact] + public void ArrayNullablePropTest() + { + // TODO unit test for the property 'ArrayNullableProp' + } + /// + /// Test the property 'ArrayAndItemsNullableProp' + /// + [Fact] + public void ArrayAndItemsNullablePropTest() + { + // TODO unit test for the property 'ArrayAndItemsNullableProp' + } + /// + /// Test the property 'ArrayItemsNullable' + /// + [Fact] + public void ArrayItemsNullableTest() + { + // TODO unit test for the property 'ArrayItemsNullable' + } + /// + /// Test the property 'ObjectNullableProp' + /// + [Fact] + public void ObjectNullablePropTest() + { + // TODO unit test for the property 'ObjectNullableProp' + } + /// + /// Test the property 'ObjectAndItemsNullableProp' + /// + [Fact] + public void ObjectAndItemsNullablePropTest() + { + // TODO unit test for the property 'ObjectAndItemsNullableProp' + } + /// + /// Test the property 'ObjectItemsNullable' + /// + [Fact] + public void ObjectItemsNullableTest() + { + // TODO unit test for the property 'ObjectItemsNullable' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs new file mode 100644 index 000000000000..5662f91d6e64 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NullableShape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableShape + //private NullableShape instance; + + public NullableShapeTests() + { + // TODO uncomment below to create an instance of NullableShape + //instance = new NullableShape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableShape + /// + [Fact] + public void NullableShapeInstanceTest() + { + // TODO uncomment below to test "IsType" NullableShape + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs new file mode 100644 index 000000000000..3a06cb020b2a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NumberOnly + //private NumberOnly instance; + + public NumberOnlyTests() + { + // TODO uncomment below to create an instance of NumberOnly + //instance = new NumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NumberOnly + /// + [Fact] + public void NumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" NumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'JustNumber' + /// + [Fact] + public void JustNumberTest() + { + // TODO unit test for the property 'JustNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs new file mode 100644 index 000000000000..82f93fab48c5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ObjectWithDeprecatedFields + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ObjectWithDeprecatedFieldsTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ObjectWithDeprecatedFields + //private ObjectWithDeprecatedFields instance; + + public ObjectWithDeprecatedFieldsTests() + { + // TODO uncomment below to create an instance of ObjectWithDeprecatedFields + //instance = new ObjectWithDeprecatedFields(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ObjectWithDeprecatedFields + /// + [Fact] + public void ObjectWithDeprecatedFieldsInstanceTest() + { + // TODO uncomment below to test "IsType" ObjectWithDeprecatedFields + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'DeprecatedRef' + /// + [Fact] + public void DeprecatedRefTest() + { + // TODO unit test for the property 'DeprecatedRef' + } + /// + /// Test the property 'Bars' + /// + [Fact] + public void BarsTest() + { + // TODO unit test for the property 'Bars' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs new file mode 100644 index 000000000000..cf5c561c5476 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Fact] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'PetId' + /// + [Fact] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + /// + /// Test the property 'Quantity' + /// + [Fact] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + /// + /// Test the property 'ShipDate' + /// + [Fact] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + /// + /// Test the property 'Complete' + /// + [Fact] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs new file mode 100644 index 000000000000..2efda0db59c4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterComposite + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterCompositeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + public OuterCompositeTests() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterComposite + /// + [Fact] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsType" OuterComposite + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MyNumber' + /// + [Fact] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + /// + /// Test the property 'MyString' + /// + [Fact] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + /// + /// Test the property 'MyBoolean' + /// + [Fact] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs new file mode 100644 index 000000000000..986fff774c46 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumDefaultValue + //private OuterEnumDefaultValue instance; + + public OuterEnumDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumDefaultValue + //instance = new OuterEnumDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumDefaultValue + /// + [Fact] + public void OuterEnumDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumDefaultValue + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs new file mode 100644 index 000000000000..015d5dab945e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumIntegerDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumIntegerDefaultValue + //private OuterEnumIntegerDefaultValue instance; + + public OuterEnumIntegerDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumIntegerDefaultValue + //instance = new OuterEnumIntegerDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumIntegerDefaultValue + /// + [Fact] + public void OuterEnumIntegerDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumIntegerDefaultValue + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs new file mode 100644 index 000000000000..385e899110a4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumInteger + //private OuterEnumInteger instance; + + public OuterEnumIntegerTests() + { + // TODO uncomment below to create an instance of OuterEnumInteger + //instance = new OuterEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumInteger + /// + [Fact] + public void OuterEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumInteger + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs new file mode 100644 index 000000000000..f47304767b9e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnum + //private OuterEnum instance; + + public OuterEnumTests() + { + // TODO uncomment below to create an instance of OuterEnum + //instance = new OuterEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnum + /// + [Fact] + public void OuterEnumInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnum + //Assert.IsType(instance); + } + + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs new file mode 100644 index 000000000000..1e17568ed331 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ParentPet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ParentPetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ParentPet + //private ParentPet instance; + + public ParentPetTests() + { + // TODO uncomment below to create an instance of ParentPet + //instance = new ParentPet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ParentPet + /// + [Fact] + public void ParentPetInstanceTest() + { + // TODO uncomment below to test "IsType" ParentPet + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PetTests.cs new file mode 100644 index 000000000000..154e66f8dfc0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + public PetTests() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pet + /// + [Fact] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsType" Pet + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PhotoUrls' + /// + [Fact] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PigTests.cs new file mode 100644 index 000000000000..55cf2189046b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Pig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pig + //private Pig instance; + + public PigTests() + { + // TODO uncomment below to create an instance of Pig + //instance = new Pig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pig + /// + [Fact] + public void PigInstanceTest() + { + // TODO uncomment below to test "IsType" Pig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs new file mode 100644 index 000000000000..6eef9f4c816d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing QuadrilateralInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for QuadrilateralInterface + //private QuadrilateralInterface instance; + + public QuadrilateralInterfaceTests() + { + // TODO uncomment below to create an instance of QuadrilateralInterface + //instance = new QuadrilateralInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of QuadrilateralInterface + /// + [Fact] + public void QuadrilateralInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" QuadrilateralInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs new file mode 100644 index 000000000000..26826681a478 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Quadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Quadrilateral + //private Quadrilateral instance; + + public QuadrilateralTests() + { + // TODO uncomment below to create an instance of Quadrilateral + //instance = new Quadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Quadrilateral + /// + [Fact] + public void QuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" Quadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs new file mode 100644 index 000000000000..dc3d0fad54cd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ReadOnlyFirst + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReadOnlyFirstTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ReadOnlyFirst + //private ReadOnlyFirst instance; + + public ReadOnlyFirstTests() + { + // TODO uncomment below to create an instance of ReadOnlyFirst + //instance = new ReadOnlyFirst(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ReadOnlyFirst + /// + [Fact] + public void ReadOnlyFirstInstanceTest() + { + // TODO uncomment below to test "IsType" ReadOnlyFirst + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Baz' + /// + [Fact] + public void BazTest() + { + // TODO unit test for the property 'Baz' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs new file mode 100644 index 000000000000..c8c1d6510d2f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReturnTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + public ReturnTests() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Return + /// + [Fact] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsType" Return + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Return' + /// + [Fact] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs new file mode 100644 index 000000000000..04cb9f1ab6b1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ScaleneTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ScaleneTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ScaleneTriangle + //private ScaleneTriangle instance; + + public ScaleneTriangleTests() + { + // TODO uncomment below to create an instance of ScaleneTriangle + //instance = new ScaleneTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ScaleneTriangle + /// + [Fact] + public void ScaleneTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" ScaleneTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs new file mode 100644 index 000000000000..7bd0bc86f963 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ShapeInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeInterface + //private ShapeInterface instance; + + public ShapeInterfaceTests() + { + // TODO uncomment below to create an instance of ShapeInterface + //instance = new ShapeInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeInterface + /// + [Fact] + public void ShapeInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs new file mode 100644 index 000000000000..d0af114157c9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ShapeOrNull + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeOrNullTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeOrNull + //private ShapeOrNull instance; + + public ShapeOrNullTests() + { + // TODO uncomment below to create an instance of ShapeOrNull + //instance = new ShapeOrNull(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeOrNull + /// + [Fact] + public void ShapeOrNullInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeOrNull + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs new file mode 100644 index 000000000000..b01bd531f857 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Shape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Shape + //private Shape instance; + + public ShapeTests() + { + // TODO uncomment below to create an instance of Shape + //instance = new Shape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Shape + /// + [Fact] + public void ShapeInstanceTest() + { + // TODO uncomment below to test "IsType" Shape + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs new file mode 100644 index 000000000000..6648e9809281 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SimpleQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SimpleQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SimpleQuadrilateral + //private SimpleQuadrilateral instance; + + public SimpleQuadrilateralTests() + { + // TODO uncomment below to create an instance of SimpleQuadrilateral + //instance = new SimpleQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SimpleQuadrilateral + /// + [Fact] + public void SimpleQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" SimpleQuadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 000000000000..0f0e1ff12a9e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SpecialModelName + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialModelNameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SpecialModelName + //private SpecialModelName instance; + + public SpecialModelNameTests() + { + // TODO uncomment below to create an instance of SpecialModelName + //instance = new SpecialModelName(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SpecialModelName + /// + [Fact] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsType" SpecialModelName + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SpecialPropertyName' + /// + [Fact] + public void SpecialPropertyNameTest() + { + // TODO unit test for the property 'SpecialPropertyName' + } + /// + /// Test the property '_SpecialModelName' + /// + [Fact] + public void _SpecialModelNameTest() + { + // TODO unit test for the property '_SpecialModelName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TagTests.cs new file mode 100644 index 000000000000..6d56232d0a76 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Fact] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs new file mode 100644 index 000000000000..fba65470bee6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TriangleInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TriangleInterface + //private TriangleInterface instance; + + public TriangleInterfaceTests() + { + // TODO uncomment below to create an instance of TriangleInterface + //instance = new TriangleInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TriangleInterface + /// + [Fact] + public void TriangleInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" TriangleInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs new file mode 100644 index 000000000000..bdaab0b47965 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Triangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Triangle + //private Triangle instance; + + public TriangleTests() + { + // TODO uncomment below to create an instance of Triangle + //instance = new Triangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Triangle + /// + [Fact] + public void TriangleInstanceTest() + { + // TODO uncomment below to test "IsType" Triangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/UserTests.cs new file mode 100644 index 000000000000..a7b095e4c28e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Fact] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'Phone' + /// + [Fact] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + /// + /// Test the property 'UserStatus' + /// + [Fact] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + /// + /// Test the property 'ObjectWithNoDeclaredProps' + /// + [Fact] + public void ObjectWithNoDeclaredPropsTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredProps' + } + /// + /// Test the property 'ObjectWithNoDeclaredPropsNullable' + /// + [Fact] + public void ObjectWithNoDeclaredPropsNullableTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' + } + /// + /// Test the property 'AnyTypeProp' + /// + [Fact] + public void AnyTypePropTest() + { + // TODO unit test for the property 'AnyTypeProp' + } + /// + /// Test the property 'AnyTypePropNullable' + /// + [Fact] + public void AnyTypePropNullableTest() + { + // TODO unit test for the property 'AnyTypePropNullable' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs new file mode 100644 index 000000000000..09610791943c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Whale + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class WhaleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Whale + //private Whale instance; + + public WhaleTests() + { + // TODO uncomment below to create an instance of Whale + //instance = new Whale(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Whale + /// + [Fact] + public void WhaleInstanceTest() + { + // TODO uncomment below to test "IsType" Whale + //Assert.IsType(instance); + } + + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs new file mode 100644 index 000000000000..f44e92131400 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Zebra + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Zebra + //private Zebra instance; + + public ZebraTests() + { + // TODO uncomment below to create an instance of Zebra + //instance = new Zebra(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Zebra + /// + [Fact] + public void ZebraInstanceTest() + { + // TODO uncomment below to test "IsType" Zebra + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 000000000000..a68e9179c812 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,20 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + netcoreapp3.1 + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs new file mode 100644 index 000000000000..ddd804975cd2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -0,0 +1,247 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApi : IApi + { + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ModelClient>> + Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient> + Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class AnotherFakeApi : IAnotherFakeApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + + if ((modelClient as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("PATCH"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/another-fake/dummy")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 000000000000..0ad710171be3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,221 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApi : IApi + { + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<InlineResponseDefault>> + Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<InlineResponseDefault> + Task FooGetAsync(System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class DefaultApi : IDefaultApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/foo"; + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/foo")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs new file mode 100644 index 000000000000..b777bb7a18b4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -0,0 +1,2404 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApi : IApi + { + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<HealthCheckResult>> + Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<HealthCheckResult> + Task FakeHealthGetAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<bool>> + Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<bool> + Task FakeOuterBooleanSerializeAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<OuterComposite>> + Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<OuterComposite> + Task FakeOuterCompositeSerializeAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<decimal>> + Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<decimal> + Task FakeOuterNumberSerializeAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<string>> + Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<string> + Task FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<OuterEnum>>> + Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<OuterEnum>> + Task> GetArrayOfEnumsAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestBodyWithQueryParamsWithHttpInfoAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ModelClient>> + Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient> + Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestEndpointParametersWithHttpInfoAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestEndpointParametersAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestEnumParametersWithHttpInfoAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestEnumParametersAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestGroupParametersWithHttpInfoAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestGroupParametersAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeApi : IFakeApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/health")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + + if ((body as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/boolean")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeOrDefaultAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + + if ((outerComposite as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(outerComposite, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/composite")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + + if ((body as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/number")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + + if ((body as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "*/*" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/string")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task> GetArrayOfEnumsAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task> GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = null; + try + { + result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/array-of-enums")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (fileSchemaTestClass == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + + if ((fileSchemaTestClass as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(fileSchemaTestClass, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("PUT"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-file-schema")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestBodyWithQueryParamsWithHttpInfoAsync(query, user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsOrDefaultAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestBodyWithQueryParamsWithHttpInfoAsync(query, user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestBodyWithQueryParamsWithHttpInfoAsync(string query, User user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (query == null) + throw new ArgumentNullException(nameof(query)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["query"] = Uri.EscapeDataString(query.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("PUT"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-query-params")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + if ((modelClient as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("PATCH"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestEndpointParametersWithHttpInfoAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersOrDefaultAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestEndpointParametersWithHttpInfoAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestEndpointParametersWithHttpInfoAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (patternWithoutDelimiter == null) + throw new ArgumentNullException(nameof(patternWithoutDelimiter)); + + if (_byte == null) + throw new ArgumentNullException(nameof(_byte)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (integer != null) + formParams.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer))); + + if (int32 != null) + formParams.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32))); + + if (int64 != null) + formParams.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64))); + + formParams.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + + if (_float != null) + formParams.Add(new KeyValuePair("float", ClientUtils.ParameterToString(_float))); + + formParams.Add(new KeyValuePair("double", ClientUtils.ParameterToString(_double))); + + if (_string != null) + formParams.Add(new KeyValuePair("string", ClientUtils.ParameterToString(_string))); + + formParams.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + + formParams.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(_byte))); + + if (binary != null) + multipartContent.Add(new StreamContent(binary)); + + if (date != null) + formParams.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date))); + + if (dateTime != null) + formParams.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime))); + + if (password != null) + formParams.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password))); + + if (callback != null) + formParams.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback))); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(basicToken); + + basicToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersOrDefaultAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestEnumParametersWithHttpInfoAsync(List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + if (enumQueryStringArray != null) + parseQueryString["enum_query_string_array"] = Uri.EscapeDataString(enumQueryStringArray.ToString()); + + if (enumQueryString != null) + parseQueryString["enum_query_string"] = Uri.EscapeDataString(enumQueryString.ToString()); + + if (enumQueryInteger != null) + parseQueryString["enum_query_integer"] = Uri.EscapeDataString(enumQueryInteger.ToString()); + + if (enumQueryDouble != null) + parseQueryString["enum_query_double"] = Uri.EscapeDataString(enumQueryDouble.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + if (enumHeaderStringArray != null) + request.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray)); + + if (enumHeaderString != null) + request.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString)); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (enumFormStringArray != null) + formParams.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray))); + + if (enumFormString != null) + formParams.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString))); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestGroupParametersWithHttpInfoAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersOrDefaultAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestGroupParametersWithHttpInfoAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestGroupParametersWithHttpInfoAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["required_string_group"] = Uri.EscapeDataString(requiredStringGroup.ToString()); + parseQueryString["required_int64_group"] = Uri.EscapeDataString(requiredInt64Group.ToString()); + + if (stringGroup != null) + parseQueryString["string_group"] = Uri.EscapeDataString(stringGroup.ToString()); + + if (int64Group != null) + parseQueryString["int64_group"] = Uri.EscapeDataString(int64Group.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + request.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + + if (booleanGroup != null) + request.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(bearerToken); + + bearerToken.UseInHeader(request, ""); + + request.Method = new HttpMethod("DELETE"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + + if ((requestBody as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestBody, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/inline-additionalProperties")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (param == null) + throw new ArgumentNullException(nameof(param)); + + if (param2 == null) + throw new ArgumentNullException(nameof(param2)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + formParams.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + + formParams.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/jsonFormData")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (pipe == null) + throw new ArgumentNullException(nameof(pipe)); + + if (ioutil == null) + throw new ArgumentNullException(nameof(ioutil)); + + if (http == null) + throw new ArgumentNullException(nameof(http)); + + if (url == null) + throw new ArgumentNullException(nameof(url)); + + if (context == null) + throw new ArgumentNullException(nameof(context)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["pipe"] = Uri.EscapeDataString(pipe.ToString()); + parseQueryString["ioutil"] = Uri.EscapeDataString(ioutil.ToString()); + parseQueryString["http"] = Uri.EscapeDataString(http.ToString()); + parseQueryString["url"] = Uri.EscapeDataString(url.ToString()); + parseQueryString["context"] = Uri.EscapeDataString(context.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + request.RequestUri = uriBuilder.Uri; + + request.Method = new HttpMethod("PUT"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/test-query-parameters")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs new file mode 100644 index 000000000000..9181cf2a8f4b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,262 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123Api : IApi + { + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ModelClient>> + Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ModelClient> + Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + if ((modelClient as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings)); + + List tokens = new List(); + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey); + + apiKey.UseInQuery(request, uriBuilder, parseQueryString, "api_key_query"); + + uriBuilder.Query = parseQueryString.ToString(); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("PATCH"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake_classname_test")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs new file mode 100644 index 000000000000..a2296da32f7f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs @@ -0,0 +1,1572 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApi : IApi + { + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task AddPetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> DeletePetWithHttpInfoAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task DeletePetAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<Pet>>> + Task>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Pet>> + Task> FindPetsByStatusAsync(List status, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<Pet>>> + Task>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Pet>> + Task> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Pet>> + Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Pet> + Task GetPetByIdAsync(long petId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task UpdatePetWithFormAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ApiResponse>> + Task> UploadFileWithHttpInfoAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ApiResponse> + Task UploadFileAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<ApiResponse>> + Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<ApiResponse> + Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PetApi : IPetApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet"; + + if ((pet as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content.ReadAsStringAsync().ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetOrDefaultAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> DeletePetWithHttpInfoAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + if (apiKey != null) + request.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + request.Method = new HttpMethod("DELETE"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task> FindPetsByStatusAsync(List status, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task> FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = null; + try + { + result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (status == null) + throw new ArgumentNullException(nameof(status)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["status"] = Uri.EscapeDataString(status.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content.ReadAsStringAsync().ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByStatus")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task> FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = null; + try + { + result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (tags == null) + throw new ArgumentNullException(nameof(tags)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["tags"] = Uri.EscapeDataString(tags.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content.ReadAsStringAsync().ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByTags")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + List tokens = new List(); + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey); + + apiKey.UseInHeader(request, "api_key"); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet"; + + if ((pet as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content.ReadAsStringAsync().ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken); + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("PUT"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormOrDefaultAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (name != null) + formParams.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name))); + + if (status != null) + formParams.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status))); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UploadFileWithHttpInfoAsync(petId, additionalMetadata, file, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileOrDefaultAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UploadFileWithHttpInfoAsync(petId, additionalMetadata, file, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UploadFileWithHttpInfoAsync(long petId, string additionalMetadata = null, System.IO.Stream file = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (additionalMetadata != null) + formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + + if (file != null) + multipartContent.Add(new StreamContent(file)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}/uploadImage")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UploadFileWithRequiredFileWithHttpInfoAsync(petId, requiredFile, additionalMetadata, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileOrDefaultAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UploadFileWithRequiredFileWithHttpInfoAsync(petId, requiredFile, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (requiredFile == null) + throw new ArgumentNullException(nameof(requiredFile)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams)); + + if (additionalMetadata != null) + formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + + multipartContent.Add(new StreamContent(requiredFile)); + + List tokens = new List(); + + request.RequestUri = uriBuilder.Uri; + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/{petId}/uploadImageWithRequiredFile")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/StoreApi.cs new file mode 100644 index 000000000000..f6f88257047b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/StoreApi.cs @@ -0,0 +1,626 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApi : IApi + { + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Dictionary<string, int>>> + Task>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Dictionary<string, int>> + Task> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Order>> + Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Order> + Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<Order>> + Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<Order> + Task PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StoreApi : IStoreApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (orderId == null) + throw new ArgumentNullException(nameof(orderId)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + request.RequestUri = uriBuilder.Uri; + + request.Method = new HttpMethod("DELETE"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> result = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + + List tokens = new List(); + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey); + + apiKey.UseInHeader(request, "api_key"); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/inventory")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit(); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (order == null) + throw new ArgumentNullException(nameof(order)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + + if ((order as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(order, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs new file mode 100644 index 000000000000..a8a10871b53d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs @@ -0,0 +1,1181 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApi : IApi + { + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<User>> + Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<User> + Task GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<string>> + Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<string> + Task LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> UpdateUserWithHttpInfoAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<object> + Task UpdateUserAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null); + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class UserApi : IUserApi + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler ApiResponded; + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(ILogger logger, HttpClient httpClient, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + Logger = logger; + HttpClient = httpClient; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user"; + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithArray")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("POST"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithList")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + request.RequestUri = uriBuilder.Uri; + + request.Method = new HttpMethod("DELETE"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (result.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (password == null) + throw new ArgumentNullException(nameof(password)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["username"] = Uri.EscapeDataString(username.ToString()); + parseQueryString["password"] = Uri.EscapeDataString(password.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + + request.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/xml", + "application/json" + }; + + string accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/login")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + try + { + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + + request.RequestUri = uriBuilder.Uri; + + request.Method = new HttpMethod("GET"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/logout")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = await UpdateUserWithHttpInfoAsync(username, user, cancellationToken).ConfigureAwait(false); + + if (result.Content == null) + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + } + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserOrDefaultAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse result = null; + try + { + result = await UpdateUserWithHttpInfoAsync(username, user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> UpdateUserWithHttpInfoAsync(string username, User user, System.Threading.CancellationToken? cancellationToken = null) + { + try + { + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + if ((user as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings)); + + request.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType); + + request.Method = new HttpMethod("PUT"); + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject(apiResponse.RawContent, ClientUtils.JsonSerializerSettings); + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 000000000000..7d4a463a9657 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,52 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the reponse + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiKeyToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiKeyToken.cs new file mode 100644 index 000000000000..a364874a105c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiKeyToken.cs @@ -0,0 +1,59 @@ +// + + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + public ApiKeyToken(string value, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the cookie. + /// + /// + /// + public virtual void UseInCookie(System.Net.Http.HttpRequestMessage request, string cookieName) + { + request.Headers.Add("Cookie", $"{ cookieName }=_raw"); + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Add(headerName, _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + /// + public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString, string parameterName) + { + parseQueryString[parameterName] = Uri.EscapeDataString(_raw).ToString(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 000000000000..e5da60003214 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,47 @@ +using System; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health. + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The time the request was sent. + /// + public DateTime RequestedAt { get; } + /// + /// The time the response was received. + /// + public DateTime ReceivedAt { get; } + /// + /// The HttpStatusCode received. + /// + public HttpStatusCode HttpStatus { get; } + /// + /// The path requested. + /// + public string Path { get; } + /// + /// The elapsed time from request to response. + /// + public TimeSpan ToTimeSpan => this.ReceivedAt - this.RequestedAt; + + /// + /// The event args used to track server health. + /// + /// + /// + /// + /// + public ApiResponseEventArgs(DateTime requestedAt, DateTime receivedAt, HttpStatusCode httpStatus, string path) + { + RequestedAt = requestedAt; + ReceivedAt = receivedAt; + HttpStatus = httpStatus; + Path = path; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 000000000000..04e92f7b19eb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,104 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.Net; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + #region Properties + + /// + /// The deserialized content + /// + public T Content { get; set; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The raw data + /// + public string RawContent { get; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + #endregion Properties + + /// + /// Construct the reponse using an HttpResponseMessage + /// + /// + /// + public ApiResponse(System.Net.Http.HttpResponseMessage response, string rawContent) + { + StatusCode = response.StatusCode; + Headers = response.Headers; + IsSuccessStatusCode = response.IsSuccessStatusCode; + ReasonPhrase = response.ReasonPhrase; + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/BasicToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/BasicToken.cs new file mode 100644 index 000000000000..66cc12da4f66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/BasicToken.cs @@ -0,0 +1,44 @@ +// + + + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Org.OpenAPITools.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/BearerToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/BearerToken.cs new file mode 100644 index 000000000000..16f90e96c149 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/BearerToken.cs @@ -0,0 +1,39 @@ +// + + + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a token from a bearer token. + /// + public class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 000000000000..7a500bb08964 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,366 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; +using System.Net.Http; +using Org.OpenAPITools.Api; +using KellermanSoftware.CompareNetObjects; + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + compareLogic = new CompareLogic(); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Custom JSON serializer + /// + public static Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get; set; } = new Newtonsoft.Json.JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = Newtonsoft.Json.ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore, + ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver + { + NamingStrategy = new Newtonsoft.Json.Serialization.CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is System.Collections.ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// The base path of the API + /// + public const string BASE_ADDRESS = "http://petstore.swagger.io:80/v2"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v2"; + + /// + /// The host of the API + /// + public const string HOST = "petstore.swagger.io"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, config); + + AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + private static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circiut breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 000000000000..7581b3998404 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + where TAnotherFakeApi : class, IAnotherFakeApi + where TDefaultApi : class, IDefaultApi + where TFakeApi : class, IFakeApi + where TFakeClassnameTags123Api : class, IFakeClassnameTags123Api + where TPetApi : class, IPetApi + where TStoreApi : class, IStoreApi + where TUserApi : class, IUserApi + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients( + Action client = null, Action builder = null) + { + AddApiHttpClients(client, builder); + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(Client.ClientUtils.JsonSerializerSettings); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs new file mode 100644 index 000000000000..22d8834f4cb6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -0,0 +1,684 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace Org.OpenAPITools.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + #region + /// + /// Create an instance + /// + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + { + KeyId = keyId; + KeyFilePath = keyFilePath; + KeyPassPhrase = keyPassPhrase; + HttpSigningHeader = httpSigningHeader; + HashAlgorithm = hashAlgorithm; + SigningAlgorithm = signingAlgorithm; + SignatureValidityPeriod = signatureValidityPeriod; + } + #endregion + + #region Properties + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } = HashAlgorithmName.SHA256; + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validaty period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + #endregion + + #region enum + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + #endregion + + #region Methods + /// + /// Gets the Headers for HttpSigning + /// + /// + /// + /// + internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + if (request.RequestUri == null) + throw new NullReferenceException("The request URI was null"); + + const string HEADER_REQUEST_TARGET = "(request-target)"; + + // The time when the HTTP signature expires. The API server should reject HTTP requests that have expired. + const string HEADER_EXPIRES = "(expires)"; + + //The 'Date' header. + const string HEADER_DATE = "Date"; + + //The 'Host' header. + const string HEADER_HOST = "Host"; + + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + + var httpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + HttpSigningHeader.Add("(created)"); + + var dateTime = DateTime.Now; + string digest = String.Empty; + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + + foreach (var header in HttpSigningHeader) + if (header.Equals(HEADER_REQUEST_TARGET)) + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + httpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + HttpSignedRequestHeader.Add(HEADER_HOST, request.RequestUri.ToString()); + } + else if (header.Equals(HEADER_CREATED)) + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, digest); + httpSignatureHeader.Add(header.ToLower(), digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in request.Headers) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + httpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + + if (!isHeaderFound) + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + + var headersKeysString = String.Join(" ", httpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in httpSignatureHeader) + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + //Concatinate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + string headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + headerSignatureStr = GetRSASignature(signatureStringHash); + + else if (keyType == PrivateKeyType.ECDSA) + headerSignatureStr = GetECDSASignature(signatureStringHash); + + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (httpSignatureHeader.ContainsKey(HEADER_CREATED)) + authorizationHeaderValue += string.Format(",created={0}", httpSignatureHeader[HEADER_CREATED]); + + if (httpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + authorizationHeaderValue += string.Format(",expires={0}", httpSignatureHeader[HEADER_EXPIRES]); + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(string hashName, string stringToBeHashed) + { + var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + var stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (KeyPassPhrase == null) + throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); + + RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + + if (rsa == null) + return string.Empty; + else if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + if (!File.Exists(KeyFilePath)) + { + throw new Exception("key file path does not exist."); + } + + var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + var keyStr = File.ReadAllText(KeyFilePath); + var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); + var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); + var ecdsa = ECDsa.Create(); + +#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) + var byteCount = 0; + if (KeyPassPhrase != null) + { + IntPtr unmanagedString = IntPtr.Zero; + try + { + // convert secure string to byte array + unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(KeyPassPhrase); + + string ptrToStringUni = Marshal.PtrToStringUni(unmanagedString) ?? throw new NullReferenceException(); + + ecdsa.ImportEncryptedPkcs8PrivateKey(Encoding.UTF8.GetBytes(ptrToStringUni), keyBytes, out byteCount); + } + finally + { + if (unmanagedString != IntPtr.Zero) + Marshal.ZeroFreeBSTR(unmanagedString); + } + } + else + { + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); + } + var signedBytes = ecdsa.SignHash(dataToSign); + var derBytes = ConvertToECDSAANS1Format(signedBytes); + var signedString = System.Convert.ToBase64String(derBytes); + + return signedString; +#else + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); +#endif + + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + rBytes.Add(signedBytes[i]); + + for (int i = 32; i < 64; i++) + sBytes.Add(signedBytes[i]); + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r lenth, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile, SecureString keyPassPharse = null) + { + const String pempubheader = "-----BEGIN PUBLIC KEY-----"; + const String pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[] pemkey = null; + + if (!File.Exists(pemfile)) + throw new Exception("private key file does not exist."); + + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + isPrivateKeyFile = false; + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse); + + if (pemkey == null) + return null; + + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPharse = null) + { + const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; + String pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + return null; + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + String pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + return null; + + String saltline = str.ReadLine(); // TODO: what do we do here if ReadLine is null? + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + return null; + + String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + + if (!(str.ReadLine() == "")) + return null; + + //------ remaining b64 data is encrypted RSA key ---- + String encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 fromat + return null; + } + + // TODO: what do we do here if keyPassPharse is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPharse, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + return null; + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + + return rsakey; + } + } + + private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + binr.ReadByte(); //advance 1 byte + else if (twobytes == 0x8230) + binr.ReadInt16(); //advance 2 bytes + else + return null; + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + return null; + + bt = binr.ReadByte(); + if (bt != 0x00) + return null; + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + return 0; + + bt = binr.ReadByte(); + + if (bt == 0x81) + count = binr.ReadByte(); // data size in next byte + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + count = bt; // we already have the data size + + while (binr.ReadByte() == 0x00) + //remove high order zeros in data + count -= 1; + + binr.BaseStream.Seek(-1, SeekOrigin.Current); + + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = new MD5CryptoServiceProvider(); + byte[] result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + result = data00; //initialize + else + { + Array.Copy(result, hashtarget, result.Length); // TODO: what do we do if result is null here? + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result, 0, result.Length); // TODO: what do we do if result is null here? + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + throw new Exception("Key file path does not exist."); + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + keyType = PrivateKeyType.RSA; + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + keyType = PrivateKeyType.ECDSA; + + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + throw new Exception("Either the key is invalid or key is not supported"); + + return keyType; + } + #endregion + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HttpSigningToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HttpSigningToken.cs new file mode 100644 index 000000000000..7cc2dc394d7c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HttpSigningToken.cs @@ -0,0 +1,43 @@ +// + + + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an HttpSigningConfiguration + /// + public class HttpSignatureToken : TokenBase + { + private HttpSigningConfiguration _configuration; + + /// + /// Constructs an HttpSignatureToken object. + /// + /// + /// + public HttpSignatureToken(HttpSigningConfiguration configuration, TimeSpan? timeout = null) : base(timeout) + { + _configuration = configuration; + } + + /// + /// Places the token in the header. + /// + /// + /// + /// + public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken? cancellationToken = null) + { + var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); + + foreach (var signedHeader in signedHeaders) + request.Headers.Add(signedHeader.Key, signedHeader.Value); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/IApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/IApi.cs new file mode 100644 index 000000000000..bd74ad34fd3d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/IApi.cs @@ -0,0 +1,21 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Client +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + event ClientUtils.EventHandler ApiResponded; + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/OAuthToken.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/OAuthToken.cs new file mode 100644 index 000000000000..530e8211d821 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/OAuthToken.cs @@ -0,0 +1,39 @@ +// + + + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed with OAuth. + /// + public class OAuthToken : TokenBase + { + private string _raw; + + /// + /// Consturcts an OAuthToken object. + /// + /// + /// + public OAuthToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs new file mode 100644 index 000000000000..a5253e582013 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 000000000000..57dcc52ded37 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,80 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Collections.Concurrent; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal ConcurrentDictionary AvailableTokens = new ConcurrentDictionary(); + private SemaphoreSlim _semaphore; + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + _semaphore = new SemaphoreSlim(1, 1); + + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + for (int i = 0; i < _tokens.Length; i++) + { + _tokens[i].TokenBecameAvailable += ((sender) => + { + TTokenBase token = (TTokenBase)sender; + + AvailableTokens.TryAdd(token, token); + }); + } + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null) + { + await _semaphore.WaitAsync().ConfigureAwait(false); + + try + { + TTokenBase result = null; + + while (result == null) + { + TTokenBase tokenToRemove = AvailableTokens.FirstOrDefault().Value; + + if (tokenToRemove != null && AvailableTokens.TryRemove(tokenToRemove, out result)) + return result; + + await Task.Delay(40).ConfigureAwait(false); + + tokenToRemove = AvailableTokens.FirstOrDefault().Value; + } + + return result; + } + finally + { + _semaphore.Release(); + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 000000000000..7098850e99e2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,71 @@ +// + + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 000000000000..1be1b27f2a9f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,37 @@ +// + + + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 000000000000..cc3135247d17 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,44 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs new file mode 100644 index 000000000000..b3fc4c3c7a3a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Org.OpenAPITools.Model +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs new file mode 100644 index 000000000000..b3ddad35a07d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,224 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesClass + /// + [DataContract(Name = "AdditionalPropertiesClass")] + public partial class AdditionalPropertiesClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mapProperty. + /// mapOfMapProperty. + /// anytype1. + /// mapWithUndeclaredPropertiesAnytype1. + /// mapWithUndeclaredPropertiesAnytype2. + /// mapWithUndeclaredPropertiesAnytype3. + /// an object with no declared properties and no undeclared properties, hence it's an empty map.. + /// mapWithUndeclaredPropertiesString. + public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>), Object anytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype2 = default(Object), Dictionary mapWithUndeclaredPropertiesAnytype3 = default(Dictionary), Object emptyMap = default(Object), Dictionary mapWithUndeclaredPropertiesString = default(Dictionary)) + { + this.MapProperty = mapProperty; + this.MapOfMapProperty = mapOfMapProperty; + this.Anytype1 = anytype1; + this.MapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + this.MapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + this.MapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + this.EmptyMap = emptyMap; + this.MapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name = "map_property", EmitDefaultValue = false)] + public Dictionary MapProperty { get; set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name = "map_of_map_property", EmitDefaultValue = false)] + public Dictionary> MapOfMapProperty { get; set; } + + /// + /// Gets or Sets Anytype1 + /// + [DataMember(Name = "anytype_1", EmitDefaultValue = true)] + public Object Anytype1 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype1 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_1", EmitDefaultValue = false)] + public Object MapWithUndeclaredPropertiesAnytype1 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype2 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_2", EmitDefaultValue = false)] + public Object MapWithUndeclaredPropertiesAnytype2 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype3 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_3", EmitDefaultValue = false)] + public Dictionary MapWithUndeclaredPropertiesAnytype3 { get; set; } + + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + [DataMember(Name = "empty_map", EmitDefaultValue = false)] + public Object EmptyMap { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesString + /// + [DataMember(Name = "map_with_undeclared_properties_string", EmitDefaultValue = false)] + public Dictionary MapWithUndeclaredPropertiesString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype1: ").Append(MapWithUndeclaredPropertiesAnytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype2: ").Append(MapWithUndeclaredPropertiesAnytype2).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype3: ").Append(MapWithUndeclaredPropertiesAnytype3).Append("\n"); + sb.Append(" EmptyMap: ").Append(EmptyMap).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesString: ").Append(MapWithUndeclaredPropertiesString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as AdditionalPropertiesClass).AreEqual; + } + + /// + /// Returns true if AdditionalPropertiesClass instances are equal + /// + /// Instance of AdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(AdditionalPropertiesClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapProperty != null) + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } + if (this.MapOfMapProperty != null) + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } + if (this.Anytype1 != null) + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype1 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype2 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype3 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } + if (this.EmptyMap != null) + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesString != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs new file mode 100644 index 000000000000..e8ea00bb46a8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs @@ -0,0 +1,172 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Animal + /// + [DataContract(Name = "Animal")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] + public partial class Animal : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Animal() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + /// color (default to "red"). + public Animal(string className = default(string), string color = "red") + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } + this.ClassName = className; + // use default value if no "color" provided + this.Color = color ?? "red"; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name = "color", EmitDefaultValue = false)] + public string Color { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Animal).AreEqual; + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.Color != null) + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs new file mode 100644 index 000000000000..79873f4ddfed --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -0,0 +1,155 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ApiResponse + /// + [DataContract(Name = "ApiResponse")] + public partial class ApiResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// type. + /// message. + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) + { + this.Code = code; + this.Type = type; + this.Message = message; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name = "code", EmitDefaultValue = false)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ApiResponse).AreEqual; + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Code.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 000000000000..8b1f87d1aa9a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,159 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Apple + /// + [DataContract(Name = "apple")] + public partial class Apple : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// cultivar. + /// origin. + public Apple(string cultivar = default(string), string origin = default(string)) + { + this.Cultivar = cultivar; + this.Origin = origin; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Cultivar + /// + [DataMember(Name = "cultivar", EmitDefaultValue = false)] + public string Cultivar { get; set; } + + /// + /// Gets or Sets Origin + /// + [DataMember(Name = "origin", EmitDefaultValue = false)] + public string Origin { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Apple {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Origin: ").Append(Origin).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Apple).AreEqual; + } + + /// + /// Returns true if Apple instances are equal + /// + /// Instance of Apple to be compared + /// Boolean + public bool Equals(Apple input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cultivar != null) + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + if (this.Origin != null) + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // Cultivar (string) pattern + Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + if (false == regexCultivar.Match(this.Cultivar).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); + } + + // Origin (string) pattern + Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexOrigin.Match(this.Origin).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); + } + + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs new file mode 100644 index 000000000000..1d6d42dc9b3a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -0,0 +1,139 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// AppleReq + /// + [DataContract(Name = "appleReq")] + public partial class AppleReq : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AppleReq() { } + /// + /// Initializes a new instance of the class. + /// + /// cultivar (required). + /// mealy. + public AppleReq(string cultivar = default(string), bool mealy = default(bool)) + { + // to ensure "cultivar" is required (not null) + if (cultivar == null) { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } + this.Cultivar = cultivar; + this.Mealy = mealy; + } + + /// + /// Gets or Sets Cultivar + /// + [DataMember(Name = "cultivar", IsRequired = true, EmitDefaultValue = false)] + public string Cultivar { get; set; } + + /// + /// Gets or Sets Mealy + /// + [DataMember(Name = "mealy", EmitDefaultValue = true)] + public bool Mealy { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppleReq {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Mealy: ").Append(Mealy).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as AppleReq).AreEqual; + } + + /// + /// Returns true if AppleReq instances are equal + /// + /// Instance of AppleReq to be compared + /// Boolean + public bool Equals(AppleReq input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cultivar != null) + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 000000000000..30bf57ef0f52 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + [DataContract(Name = "ArrayOfArrayOfNumberOnly")] + public partial class ArrayOfArrayOfNumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber. + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + { + this.ArrayArrayNumber = arrayArrayNumber; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [DataMember(Name = "ArrayArrayNumber", EmitDefaultValue = false)] + public List> ArrayArrayNumber { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfArrayOfNumberOnly).AreEqual; + } + + /// + /// Returns true if ArrayOfArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfArrayOfNumberOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayArrayNumber != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs new file mode 100644 index 000000000000..8a215aad133b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayOfNumberOnly + /// + [DataContract(Name = "ArrayOfNumberOnly")] + public partial class ArrayOfNumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber. + public ArrayOfNumberOnly(List arrayNumber = default(List)) + { + this.ArrayNumber = arrayNumber; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ArrayNumber + /// + [DataMember(Name = "ArrayNumber", EmitDefaultValue = false)] + public List ArrayNumber { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfNumberOnly).AreEqual; + } + + /// + /// Returns true if ArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfNumberOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayNumber != null) + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs new file mode 100644 index 000000000000..1a879a1d9ca2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayTest + /// + [DataContract(Name = "ArrayTest")] + public partial class ArrayTest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayOfString. + /// arrayArrayOfInteger. + /// arrayArrayOfModel. + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + { + this.ArrayOfString = arrayOfString; + this.ArrayArrayOfInteger = arrayArrayOfInteger; + this.ArrayArrayOfModel = arrayArrayOfModel; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name = "array_of_string", EmitDefaultValue = false)] + public List ArrayOfString { get; set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name = "array_array_of_integer", EmitDefaultValue = false)] + public List> ArrayArrayOfInteger { get; set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name = "array_array_of_model", EmitDefaultValue = false)] + public List> ArrayArrayOfModel { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayTest).AreEqual; + } + + /// + /// Returns true if ArrayTest instances are equal + /// + /// Instance of ArrayTest to be compared + /// Boolean + public bool Equals(ArrayTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayOfString != null) + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } + if (this.ArrayArrayOfInteger != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } + if (this.ArrayArrayOfModel != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 000000000000..97939597ede8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Banana + /// + [DataContract(Name = "banana")] + public partial class Banana : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm. + public Banana(decimal lengthCm = default(decimal)) + { + this.LengthCm = lengthCm; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets LengthCm + /// + [DataMember(Name = "lengthCm", EmitDefaultValue = false)] + public decimal LengthCm { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Banana {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Banana).AreEqual; + } + + /// + /// Returns true if Banana instances are equal + /// + /// Instance of Banana to be compared + /// Boolean + public bool Equals(Banana input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs new file mode 100644 index 000000000000..fdd36929d13c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BananaReq + /// + [DataContract(Name = "bananaReq")] + public partial class BananaReq : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BananaReq() { } + /// + /// Initializes a new instance of the class. + /// + /// lengthCm (required). + /// sweet. + public BananaReq(decimal lengthCm = default(decimal), bool sweet = default(bool)) + { + this.LengthCm = lengthCm; + this.Sweet = sweet; + } + + /// + /// Gets or Sets LengthCm + /// + [DataMember(Name = "lengthCm", IsRequired = true, EmitDefaultValue = false)] + public decimal LengthCm { get; set; } + + /// + /// Gets or Sets Sweet + /// + [DataMember(Name = "sweet", EmitDefaultValue = true)] + public bool Sweet { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BananaReq {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" Sweet: ").Append(Sweet).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BananaReq).AreEqual; + } + + /// + /// Returns true if BananaReq instances are equal + /// + /// Instance of BananaReq to be compared + /// Boolean + public bool Equals(BananaReq input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs new file mode 100644 index 000000000000..ea4ff737c89a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BasquePig + /// + [DataContract(Name = "BasquePig")] + public partial class BasquePig : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BasquePig() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + public BasquePig(string className = default(string)) + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } + this.ClassName = className; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BasquePig {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BasquePig).AreEqual; + } + + /// + /// Returns true if BasquePig instances are equal + /// + /// Instance of BasquePig to be compared + /// Boolean + public bool Equals(BasquePig input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs new file mode 100644 index 000000000000..be68a50a116a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -0,0 +1,198 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Capitalization + /// + [DataContract(Name = "Capitalization")] + public partial class Capitalization : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// smallCamel. + /// capitalCamel. + /// smallSnake. + /// capitalSnake. + /// sCAETHFlowPoints. + /// Name of the pet . + public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + { + this.SmallCamel = smallCamel; + this.CapitalCamel = capitalCamel; + this.SmallSnake = smallSnake; + this.CapitalSnake = capitalSnake; + this.SCAETHFlowPoints = sCAETHFlowPoints; + this.ATT_NAME = aTTNAME; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SmallCamel + /// + [DataMember(Name = "smallCamel", EmitDefaultValue = false)] + public string SmallCamel { get; set; } + + /// + /// Gets or Sets CapitalCamel + /// + [DataMember(Name = "CapitalCamel", EmitDefaultValue = false)] + public string CapitalCamel { get; set; } + + /// + /// Gets or Sets SmallSnake + /// + [DataMember(Name = "small_Snake", EmitDefaultValue = false)] + public string SmallSnake { get; set; } + + /// + /// Gets or Sets CapitalSnake + /// + [DataMember(Name = "Capital_Snake", EmitDefaultValue = false)] + public string CapitalSnake { get; set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [DataMember(Name = "SCA_ETH_Flow_Points", EmitDefaultValue = false)] + public string SCAETHFlowPoints { get; set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [DataMember(Name = "ATT_NAME", EmitDefaultValue = false)] + public string ATT_NAME { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Capitalization {\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Capitalization).AreEqual; + } + + /// + /// Returns true if Capitalization instances are equal + /// + /// Instance of Capitalization to be compared + /// Boolean + public bool Equals(Capitalization input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SmallCamel != null) + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } + if (this.CapitalCamel != null) + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } + if (this.SmallSnake != null) + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } + if (this.CapitalSnake != null) + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } + if (this.SCAETHFlowPoints != null) + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } + if (this.ATT_NAME != null) + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs new file mode 100644 index 000000000000..2bc55707da95 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Cat + /// + [DataContract(Name = "Cat")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + public partial class Cat : Animal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Cat() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// declawed. + /// className (required) (default to "Cat"). + /// color (default to "red"). + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + { + this.Declawed = declawed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name = "declawed", EmitDefaultValue = true)] + public bool Declawed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Cat).AreEqual; + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs new file mode 100644 index 000000000000..3a960e9925e3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// CatAllOf + /// + [DataContract(Name = "Cat_allOf")] + public partial class CatAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public CatAllOf(bool declawed = default(bool)) + { + this.Declawed = declawed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name = "declawed", EmitDefaultValue = true)] + public bool Declawed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as CatAllOf).AreEqual; + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs new file mode 100644 index 000000000000..0cc23f5f6c23 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Category + /// + [DataContract(Name = "Category")] + public partial class Category : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Category() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name (required) (default to "default-name"). + public Category(long id = default(long), string name = "default-name") + { + // to ensure "name" is required (not null) + if (name == null) { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this.Name = name; + this.Id = id; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Category).AreEqual; + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCat.cs new file mode 100644 index 000000000000..7a15a5297df2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCat.cs @@ -0,0 +1,181 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ChildCat + /// + [DataContract(Name = "ChildCat")] + [JsonConverter(typeof(JsonSubtypes), "PetType")] + public partial class ChildCat : ParentPet, IEquatable, IValidatableObject + { + /// + /// Defines PetType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + [EnumMember(Value = "ChildCat")] + ChildCat = 1 + + } + + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)] + public PetTypeEnum PetType { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ChildCat() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// name. + /// petType (required) (default to PetTypeEnum.ChildCat). + public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base() + { + this.PetType = petType; + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ChildCat).AreEqual; + } + + /// + /// Returns true if ChildCat instances are equal + /// + /// Instance of ChildCat to be compared + /// Boolean + public bool Equals(ChildCat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs new file mode 100644 index 000000000000..a353ad7ffd71 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ChildCatAllOf + /// + [DataContract(Name = "ChildCat_allOf")] + public partial class ChildCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines PetType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + [EnumMember(Value = "ChildCat")] + ChildCat = 1 + + } + + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", EmitDefaultValue = false)] + public PetTypeEnum? PetType { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// name. + /// petType (default to PetTypeEnum.ChildCat). + public ChildCatAllOf(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) + { + this.Name = name; + this.PetType = petType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCatAllOf {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ChildCatAllOf).AreEqual; + } + + /// + /// Returns true if ChildCatAllOf instances are equal + /// + /// Instance of ChildCatAllOf to be compared + /// Boolean + public bool Equals(ChildCatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs new file mode 100644 index 000000000000..7177e9bf0b6c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model with \"_class\" property + /// + [DataContract(Name = "ClassModel")] + public partial class ClassModel : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _class. + public ClassModel(string _class = default(string)) + { + this.Class = _class; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Class + /// + [DataMember(Name = "_class", EmitDefaultValue = false)] + public string Class { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ClassModel {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ClassModel).AreEqual; + } + + /// + /// Returns true if ClassModel instances are equal + /// + /// Instance of ClassModel to be compared + /// Boolean + public bool Equals(ClassModel input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Class != null) + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs new file mode 100644 index 000000000000..807f0eb26bf8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ComplexQuadrilateral + /// + [DataContract(Name = "ComplexQuadrilateral")] + public partial class ComplexQuadrilateral : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ComplexQuadrilateral() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// quadrilateralType (required). + public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ComplexQuadrilateral {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ComplexQuadrilateral).AreEqual; + } + + /// + /// Returns true if ComplexQuadrilateral instances are equal + /// + /// Instance of ComplexQuadrilateral to be compared + /// Boolean + public bool Equals(ComplexQuadrilateral input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs new file mode 100644 index 000000000000..a27b1db39297 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DanishPig + /// + [DataContract(Name = "DanishPig")] + public partial class DanishPig : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DanishPig() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + public DanishPig(string className = default(string)) + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } + this.ClassName = className; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DanishPig {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DanishPig).AreEqual; + } + + /// + /// Returns true if DanishPig instances are equal + /// + /// Instance of DanishPig to be compared + /// Boolean + public bool Equals(DanishPig input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs new file mode 100644 index 000000000000..1928b236bf66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DeprecatedObject + /// + [DataContract(Name = "DeprecatedObject")] + public partial class DeprecatedObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public DeprecatedObject(string name = default(string)) + { + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DeprecatedObject {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DeprecatedObject).AreEqual; + } + + /// + /// Returns true if DeprecatedObject instances are equal + /// + /// Instance of DeprecatedObject to be compared + /// Boolean + public bool Equals(DeprecatedObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs new file mode 100644 index 000000000000..9cd520deaf82 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs @@ -0,0 +1,159 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Dog + /// + [DataContract(Name = "Dog")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + public partial class Dog : Animal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Dog() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// breed. + /// className (required) (default to "Dog"). + /// color (default to "red"). + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + { + this.Breed = breed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name = "breed", EmitDefaultValue = false)] + public string Breed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Dog).AreEqual; + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Breed != null) + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs new file mode 100644 index 000000000000..7b026acbf1e5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DogAllOf + /// + [DataContract(Name = "Dog_allOf")] + public partial class DogAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed. + public DogAllOf(string breed = default(string)) + { + this.Breed = breed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name = "breed", EmitDefaultValue = false)] + public string Breed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DogAllOf).AreEqual; + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Breed != null) + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs new file mode 100644 index 000000000000..d8cd2a70ef61 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Drawing + /// + [DataContract(Name = "Drawing")] + public partial class Drawing : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mainShape. + /// shapeOrNull. + /// nullableShape. + /// shapes. + public Drawing(Shape mainShape = default(Shape), ShapeOrNull shapeOrNull = default(ShapeOrNull), NullableShape nullableShape = default(NullableShape), List shapes = default(List)) : base() + { + this.MainShape = mainShape; + this.ShapeOrNull = shapeOrNull; + this.NullableShape = nullableShape; + this.Shapes = shapes; + } + + /// + /// Gets or Sets MainShape + /// + [DataMember(Name = "mainShape", EmitDefaultValue = false)] + public Shape MainShape { get; set; } + + /// + /// Gets or Sets ShapeOrNull + /// + [DataMember(Name = "shapeOrNull", EmitDefaultValue = false)] + public ShapeOrNull ShapeOrNull { get; set; } + + /// + /// Gets or Sets NullableShape + /// + [DataMember(Name = "nullableShape", EmitDefaultValue = true)] + public NullableShape NullableShape { get; set; } + + /// + /// Gets or Sets Shapes + /// + [DataMember(Name = "shapes", EmitDefaultValue = false)] + public List Shapes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Drawing {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" MainShape: ").Append(MainShape).Append("\n"); + sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n"); + sb.Append(" NullableShape: ").Append(NullableShape).Append("\n"); + sb.Append(" Shapes: ").Append(Shapes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Drawing).AreEqual; + } + + /// + /// Returns true if Drawing instances are equal + /// + /// Instance of Drawing to be compared + /// Boolean + public bool Equals(Drawing input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.MainShape != null) + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } + if (this.ShapeOrNull != null) + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } + if (this.NullableShape != null) + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } + if (this.Shapes != null) + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs new file mode 100644 index 000000000000..6d7830c0e8ba --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -0,0 +1,180 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// EnumArrays + /// + [DataContract(Name = "EnumArrays")] + public partial class EnumArrays : IEquatable, IValidatableObject + { + /// + /// Defines JustSymbol + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum JustSymbolEnum + { + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + [EnumMember(Value = ">=")] + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + [EnumMember(Value = "$")] + Dollar = 2 + + } + + + /// + /// Gets or Sets JustSymbol + /// + [DataMember(Name = "just_symbol", EmitDefaultValue = false)] + public JustSymbolEnum? JustSymbol { get; set; } + /// + /// Defines ArrayEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ArrayEnumEnum + { + /// + /// Enum Fish for value: fish + /// + [EnumMember(Value = "fish")] + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + [EnumMember(Value = "crab")] + Crab = 2 + + } + + + + /// + /// Gets or Sets ArrayEnum + /// + [DataMember(Name = "array_enum", EmitDefaultValue = false)] + public List ArrayEnum { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// justSymbol. + /// arrayEnum. + public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + { + this.JustSymbol = justSymbol; + this.ArrayEnum = arrayEnum; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnumArrays {\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumArrays).AreEqual; + } + + /// + /// Returns true if EnumArrays instances are equal + /// + /// Instance of EnumArrays to be compared + /// Boolean + public bool Equals(EnumArrays input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumClass.cs new file mode 100644 index 000000000000..48b3d7d0e7e0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumClass.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines EnumClass + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumClass + { + /// + /// Enum Abc for value: _abc + /// + [EnumMember(Value = "_abc")] + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + [EnumMember(Value = "-efg")] + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + [EnumMember(Value = "(xyz)")] + Xyz = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs new file mode 100644 index 000000000000..6f3d2272c5c3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -0,0 +1,323 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// EnumTest + /// + [DataContract(Name = "Enum_Test")] + public partial class EnumTest : IEquatable, IValidatableObject + { + /// + /// Defines EnumString + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + + } + + + /// + /// Gets or Sets EnumString + /// + [DataMember(Name = "enum_string", EmitDefaultValue = false)] + public EnumStringEnum? EnumString { get; set; } + /// + /// Defines EnumStringRequired + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringRequiredEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + + } + + + /// + /// Gets or Sets EnumStringRequired + /// + [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } + /// + /// Defines EnumInteger + /// + public enum EnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + + } + + + /// + /// Gets or Sets EnumInteger + /// + [DataMember(Name = "enum_integer", EmitDefaultValue = false)] + public EnumIntegerEnum? EnumInteger { get; set; } + /// + /// Defines EnumIntegerOnly + /// + public enum EnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + + } + + + /// + /// Gets or Sets EnumIntegerOnly + /// + [DataMember(Name = "enum_integer_only", EmitDefaultValue = false)] + public EnumIntegerOnlyEnum? EnumIntegerOnly { get; set; } + /// + /// Defines EnumNumber + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumNumberEnum + { + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + [EnumMember(Value = "1.1")] + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + [EnumMember(Value = "-1.2")] + NUMBER_MINUS_1_DOT_2 = 2 + + } + + + /// + /// Gets or Sets EnumNumber + /// + [DataMember(Name = "enum_number", EmitDefaultValue = false)] + public EnumNumberEnum? EnumNumber { get; set; } + + /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name = "outerEnum", EmitDefaultValue = true)] + public OuterEnum? OuterEnum { get; set; } + + /// + /// Gets or Sets OuterEnumInteger + /// + [DataMember(Name = "outerEnumInteger", EmitDefaultValue = false)] + public OuterEnumInteger? OuterEnumInteger { get; set; } + + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [DataMember(Name = "outerEnumDefaultValue", EmitDefaultValue = false)] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [DataMember(Name = "outerEnumIntegerDefaultValue", EmitDefaultValue = false)] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EnumTest() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// enumString. + /// enumStringRequired (required). + /// enumInteger. + /// enumIntegerOnly. + /// enumNumber. + /// outerEnum. + /// outerEnumInteger. + /// outerEnumDefaultValue. + /// outerEnumIntegerDefaultValue. + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumIntegerOnlyEnum? enumIntegerOnly = default(EnumIntegerOnlyEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?), OuterEnumInteger? outerEnumInteger = default(OuterEnumInteger?), OuterEnumDefaultValue? outerEnumDefaultValue = default(OuterEnumDefaultValue?), OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue?)) + { + this.EnumStringRequired = enumStringRequired; + this.EnumString = enumString; + this.EnumInteger = enumInteger; + this.EnumIntegerOnly = enumIntegerOnly; + this.EnumNumber = enumNumber; + this.OuterEnum = outerEnum; + this.OuterEnumInteger = outerEnumInteger; + this.OuterEnumDefaultValue = outerEnumDefaultValue; + this.OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnumTest {\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumTest).AreEqual; + } + + /// + /// Returns true if EnumTest instances are equal + /// + /// Instance of EnumTest to be compared + /// Boolean + public bool Equals(EnumTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs new file mode 100644 index 000000000000..a931c0d6327a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// EquilateralTriangle + /// + [DataContract(Name = "EquilateralTriangle")] + public partial class EquilateralTriangle : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EquilateralTriangle() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } + this.TriangleType = triangleType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EquilateralTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as EquilateralTriangle).AreEqual; + } + + /// + /// Returns true if EquilateralTriangle instances are equal + /// + /// Instance of EquilateralTriangle to be compared + /// Boolean + public bool Equals(EquilateralTriangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 000000000000..e77d15e06bce --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Must be named `File` for test. + /// + [DataContract(Name = "File")] + public partial class File : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization. + public File(string sourceURI = default(string)) + { + this.SourceURI = sourceURI; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Test capitalization + /// + /// Test capitalization + [DataMember(Name = "sourceURI", EmitDefaultValue = false)] + public string SourceURI { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as File).AreEqual; + } + + /// + /// Returns true if File instances are equal + /// + /// Instance of File to be compared + /// Boolean + public bool Equals(File input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SourceURI != null) + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 000000000000..6808978c49f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// FileSchemaTestClass + /// + [DataContract(Name = "FileSchemaTestClass")] + public partial class FileSchemaTestClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// file. + /// files. + public FileSchemaTestClass(File file = default(File), List files = default(List)) + { + this.File = file; + this.Files = files; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets File + /// + [DataMember(Name = "file", EmitDefaultValue = false)] + public File File { get; set; } + + /// + /// Gets or Sets Files + /// + [DataMember(Name = "files", EmitDefaultValue = false)] + public List Files { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as FileSchemaTestClass).AreEqual; + } + + /// + /// Returns true if FileSchemaTestClass instances are equal + /// + /// Instance of FileSchemaTestClass to be compared + /// Boolean + public bool Equals(FileSchemaTestClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.File != null) + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 000000000000..e64aac7b6317 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Foo + /// + [DataContract(Name = "Foo")] + public partial class Foo : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar"). + public Foo(string bar = "bar") + { + // use default value if no "bar" provided + this.Bar = bar ?? "bar"; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Foo {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Foo).AreEqual; + } + + /// + /// Returns true if Foo instances are equal + /// + /// Instance of Foo to be compared + /// Boolean + public bool Equals(Foo input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs new file mode 100644 index 000000000000..eb38d586bbb7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -0,0 +1,418 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// FormatTest + /// + [DataContract(Name = "format_test")] + public partial class FormatTest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FormatTest() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// integer. + /// int32. + /// int64. + /// number (required). + /// _float. + /// _double. + /// _decimal. + /// _string. + /// _byte (required). + /// binary. + /// date (required). + /// dateTime. + /// uuid. + /// password (required). + /// A string that is a 10 digit number. Can have leading zeros.. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. + public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + { + this.Number = number; + // to ensure "_byte" is required (not null) + if (_byte == null) { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this.Byte = _byte; + this.Date = date; + // to ensure "password" is required (not null) + if (password == null) { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } + this.Password = password; + this.Integer = integer; + this.Int32 = int32; + this.Int64 = int64; + this.Float = _float; + this.Double = _double; + this.Decimal = _decimal; + this.String = _string; + this.Binary = binary; + this.DateTime = dateTime; + this.Uuid = uuid; + this.PatternWithDigits = patternWithDigits; + this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Integer + /// + [DataMember(Name = "integer", EmitDefaultValue = false)] + public int Integer { get; set; } + + /// + /// Gets or Sets Int32 + /// + [DataMember(Name = "int32", EmitDefaultValue = false)] + public int Int32 { get; set; } + + /// + /// Gets or Sets Int64 + /// + [DataMember(Name = "int64", EmitDefaultValue = false)] + public long Int64 { get; set; } + + /// + /// Gets or Sets Number + /// + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)] + public decimal Number { get; set; } + + /// + /// Gets or Sets Float + /// + [DataMember(Name = "float", EmitDefaultValue = false)] + public float Float { get; set; } + + /// + /// Gets or Sets Double + /// + [DataMember(Name = "double", EmitDefaultValue = false)] + public double Double { get; set; } + + /// + /// Gets or Sets Decimal + /// + [DataMember(Name = "decimal", EmitDefaultValue = false)] + public decimal Decimal { get; set; } + + /// + /// Gets or Sets String + /// + [DataMember(Name = "string", EmitDefaultValue = false)] + public string String { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Binary + /// + [DataMember(Name = "binary", EmitDefaultValue = false)] + public System.IO.Stream Binary { get; set; } + + /// + /// Gets or Sets Date + /// + [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime Date { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name = "dateTime", EmitDefaultValue = false)] + public DateTime DateTime { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [DataMember(Name = "pattern_with_digits", EmitDefaultValue = false)] + public string PatternWithDigits { get; set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)] + public string PatternWithDigitsAndDelimiter { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FormatTest {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" Decimal: ").Append(Decimal).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as FormatTest).AreEqual; + } + + /// + /// Returns true if FormatTest instances are equal + /// + /// Instance of FormatTest to be compared + /// Boolean + public bool Equals(FormatTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); + if (this.String != null) + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } + if (this.Byte != null) + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } + if (this.Binary != null) + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } + if (this.Date != null) + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } + if (this.DateTime != null) + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } + if (this.PatternWithDigits != null) + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } + if (this.PatternWithDigitsAndDelimiter != null) + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // Integer (int) maximum + if (this.Integer > (int)100) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + } + + // Integer (int) minimum + if (this.Integer < (int)10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + } + + // Int32 (int) maximum + if (this.Int32 > (int)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + } + + // Int32 (int) minimum + if (this.Int32 < (int)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + } + + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Float (float) maximum + if (this.Float > (float)987.6) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + } + + // Float (float) minimum + if (this.Float < (float)54.3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + } + + // Double (double) maximum + if (this.Double > (double)123.4) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + } + + // Double (double) minimum + if (this.Double < (double)67.8) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + } + + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + + // PatternWithDigits (string) pattern + Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); + } + + // PatternWithDigitsAndDelimiter (string) pattern + Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); + } + + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 000000000000..726b1e8f72e7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,291 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Fruit + /// + [JsonConverter(typeof(FruitJsonConverter))] + [DataContract(Name = "fruit")] + public partial class Fruit : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Apple. + public Fruit(Apple actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Banana. + public Fruit(Banana actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Apple)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Banana)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana"); + } + } + } + + /// + /// Get the actual instance of `Apple`. If the actual instance is not `Apple`, + /// the InvalidClassException will be thrown + /// + /// An instance of Apple + public Apple GetApple() + { + return (Apple)this.ActualInstance; + } + + /// + /// Get the actual instance of `Banana`. If the actual instance is not `Banana`, + /// the InvalidClassException will be thrown + /// + /// An instance of Banana + public Banana GetBanana() + { + return (Banana)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Fruit {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Fruit.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Fruit + /// + /// JSON string + /// An instance of Fruit + public static Fruit FromJson(string jsonString) + { + Fruit newFruit = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newFruit; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Apple).GetProperty("AdditionalProperties") == null) + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.SerializerSettings)); + } + else + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Apple"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Banana).GetProperty("AdditionalProperties") == null) + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.SerializerSettings)); + } + else + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Banana"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newFruit; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Fruit).AreEqual; + } + + /// + /// Returns true if Fruit instances are equal + /// + /// Instance of Fruit to be compared + /// Boolean + public bool Equals(Fruit input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Fruit + /// + public class FruitJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Fruit).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Fruit.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs new file mode 100644 index 000000000000..548da490def0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs @@ -0,0 +1,300 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// FruitReq + /// + [JsonConverter(typeof(FruitReqJsonConverter))] + [DataContract(Name = "fruitReq")] + public partial class FruitReq : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + public FruitReq() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of AppleReq. + public FruitReq(AppleReq actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of BananaReq. + public FruitReq(BananaReq actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(AppleReq)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(BananaReq)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: AppleReq, BananaReq"); + } + } + } + + /// + /// Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`, + /// the InvalidClassException will be thrown + /// + /// An instance of AppleReq + public AppleReq GetAppleReq() + { + return (AppleReq)this.ActualInstance; + } + + /// + /// Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`, + /// the InvalidClassException will be thrown + /// + /// An instance of BananaReq + public BananaReq GetBananaReq() + { + return (BananaReq)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FruitReq {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, FruitReq.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of FruitReq + /// + /// JSON string + /// An instance of FruitReq + public static FruitReq FromJson(string jsonString) + { + FruitReq newFruitReq = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newFruitReq; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(AppleReq).GetProperty("AdditionalProperties") == null) + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.SerializerSettings)); + } + else + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("AppleReq"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into AppleReq: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(BananaReq).GetProperty("AdditionalProperties") == null) + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.SerializerSettings)); + } + else + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("BananaReq"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BananaReq: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newFruitReq; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as FruitReq).AreEqual; + } + + /// + /// Returns true if FruitReq instances are equal + /// + /// Instance of FruitReq to be compared + /// Boolean + public bool Equals(FruitReq input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for FruitReq + /// + public class FruitReqJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(FruitReq).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return FruitReq.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs new file mode 100644 index 000000000000..bd8f4435c92f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs @@ -0,0 +1,263 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// GmFruit + /// + [JsonConverter(typeof(GmFruitJsonConverter))] + [DataContract(Name = "gmFruit")] + public partial class GmFruit : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Apple. + public GmFruit(Apple actualInstance) + { + this.IsNullable = false; + this.SchemaType= "anyOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Banana. + public GmFruit(Banana actualInstance) + { + this.IsNullable = false; + this.SchemaType= "anyOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Apple)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Banana)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana"); + } + } + } + + /// + /// Get the actual instance of `Apple`. If the actual instance is not `Apple`, + /// the InvalidClassException will be thrown + /// + /// An instance of Apple + public Apple GetApple() + { + return (Apple)this.ActualInstance; + } + + /// + /// Get the actual instance of `Banana`. If the actual instance is not `Banana`, + /// the InvalidClassException will be thrown + /// + /// An instance of Banana + public Banana GetBanana() + { + return (Banana)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class GmFruit {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of GmFruit + /// + /// JSON string + /// An instance of GmFruit + public static GmFruit FromJson(string jsonString) + { + GmFruit newGmFruit = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newGmFruit; + } + + try + { + newGmFruit = new GmFruit(JsonConvert.DeserializeObject(jsonString, GmFruit.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newGmFruit; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString())); + } + + try + { + newGmFruit = new GmFruit(JsonConvert.DeserializeObject(jsonString, GmFruit.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newGmFruit; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as GmFruit).AreEqual; + } + + /// + /// Returns true if GmFruit instances are equal + /// + /// Instance of GmFruit to be compared + /// Boolean + public bool Equals(GmFruit input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for GmFruit + /// + public class GmFruitJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(GmFruit).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return GmFruit.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs new file mode 100644 index 000000000000..cee75f3f8157 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// GrandparentAnimal + /// + [DataContract(Name = "GrandparentAnimal")] + [JsonConverter(typeof(JsonSubtypes), "PetType")] + [JsonSubtypes.KnownSubType(typeof(ChildCat), "ChildCat")] + [JsonSubtypes.KnownSubType(typeof(ParentPet), "ParentPet")] + public partial class GrandparentAnimal : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected GrandparentAnimal() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// petType (required). + public GrandparentAnimal(string petType = default(string)) + { + // to ensure "petType" is required (not null) + if (petType == null) { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } + this.PetType = petType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)] + public string PetType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GrandparentAnimal {\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as GrandparentAnimal).AreEqual; + } + + /// + /// Returns true if GrandparentAnimal instances are equal + /// + /// Instance of GrandparentAnimal to be compared + /// Boolean + public bool Equals(GrandparentAnimal input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PetType != null) + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs new file mode 100644 index 000000000000..52099a7095e1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// HasOnlyReadOnly + /// + [DataContract(Name = "hasOnlyReadOnly")] + public partial class HasOnlyReadOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public HasOnlyReadOnly() + { + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; private set; } + + /// + /// Returns false as Bar should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBar() + { + return false; + } + /// + /// Gets or Sets Foo + /// + [DataMember(Name = "foo", EmitDefaultValue = false)] + public string Foo { get; private set; } + + /// + /// Returns false as Foo should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeFoo() + { + return false; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HasOnlyReadOnly).AreEqual; + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.Foo != null) + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 000000000000..e8cbb68e2e4c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + [DataContract(Name = "HealthCheckResult")] + public partial class HealthCheckResult : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage. + public HealthCheckResult(string nullableMessage = default(string)) + { + this.NullableMessage = nullableMessage; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets NullableMessage + /// + [DataMember(Name = "NullableMessage", EmitDefaultValue = true)] + public string NullableMessage { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HealthCheckResult).AreEqual; + } + + /// + /// Returns true if HealthCheckResult instances are equal + /// + /// Instance of HealthCheckResult to be compared + /// Boolean + public bool Equals(HealthCheckResult input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.NullableMessage != null) + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs new file mode 100644 index 000000000000..ae46f1f0098f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineResponseDefault + /// + [DataContract(Name = "inline_response_default")] + public partial class InlineResponseDefault : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _string. + public InlineResponseDefault(Foo _string = default(Foo)) + { + this.String = _string; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets String + /// + [DataMember(Name = "string", EmitDefaultValue = false)] + public Foo String { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class InlineResponseDefault {\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as InlineResponseDefault).AreEqual; + } + + /// + /// Returns true if InlineResponseDefault instances are equal + /// + /// Instance of InlineResponseDefault to be compared + /// Boolean + public bool Equals(InlineResponseDefault input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.String != null) + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs new file mode 100644 index 000000000000..50e7ce4aaa8d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -0,0 +1,146 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// IsoscelesTriangle + /// + [DataContract(Name = "IsoscelesTriangle")] + public partial class IsoscelesTriangle : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected IsoscelesTriangle() { } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } + this.TriangleType = triangleType; + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IsoscelesTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as IsoscelesTriangle).AreEqual; + } + + /// + /// Returns true if IsoscelesTriangle instances are equal + /// + /// Instance of IsoscelesTriangle to be compared + /// Boolean + public bool Equals(IsoscelesTriangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs new file mode 100644 index 000000000000..00814d110694 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// List + /// + [DataContract(Name = "List")] + public partial class List : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _123list. + public List(string _123list = default(string)) + { + this._123List = _123list; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _123List + /// + [DataMember(Name = "123-list", EmitDefaultValue = false)] + public string _123List { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class List {\n"); + sb.Append(" _123List: ").Append(_123List).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as List).AreEqual; + } + + /// + /// Returns true if List instances are equal + /// + /// Instance of List to be compared + /// Boolean + public bool Equals(List input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._123List != null) + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs new file mode 100644 index 000000000000..68ac31619921 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs @@ -0,0 +1,338 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Mammal + /// + [JsonConverter(typeof(MammalJsonConverter))] + [DataContract(Name = "mammal")] + public partial class Mammal : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Pig. + public Mammal(Pig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Whale. + public Mammal(Whale actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Zebra. + public Mammal(Zebra actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Pig)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Whale)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Zebra)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Pig, Whale, Zebra"); + } + } + } + + /// + /// Get the actual instance of `Pig`. If the actual instance is not `Pig`, + /// the InvalidClassException will be thrown + /// + /// An instance of Pig + public Pig GetPig() + { + return (Pig)this.ActualInstance; + } + + /// + /// Get the actual instance of `Whale`. If the actual instance is not `Whale`, + /// the InvalidClassException will be thrown + /// + /// An instance of Whale + public Whale GetWhale() + { + return (Whale)this.ActualInstance; + } + + /// + /// Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + /// the InvalidClassException will be thrown + /// + /// An instance of Zebra + public Zebra GetZebra() + { + return (Zebra)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Mammal {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Mammal.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Mammal + /// + /// JSON string + /// An instance of Mammal + public static Mammal FromJson(string jsonString) + { + Mammal newMammal = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newMammal; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Pig).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Pig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Pig: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Whale).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Whale"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Whale: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Zebra).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Zebra"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Zebra: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newMammal; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Mammal).AreEqual; + } + + /// + /// Returns true if Mammal instances are equal + /// + /// Instance of Mammal to be compared + /// Boolean + public bool Equals(Mammal input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Mammal + /// + public class MammalJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Mammal).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Mammal.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs new file mode 100644 index 000000000000..8b5a73e77365 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -0,0 +1,189 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MapTest + /// + [DataContract(Name = "MapTest")] + public partial class MapTest : IEquatable, IValidatableObject + { + /// + /// Defines Inner + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum InnerEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2 + + } + + + + /// + /// Gets or Sets MapOfEnumString + /// + [DataMember(Name = "map_of_enum_string", EmitDefaultValue = false)] + public Dictionary MapOfEnumString { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// mapMapOfString. + /// mapOfEnumString. + /// directMap. + /// indirectMap. + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + { + this.MapMapOfString = mapMapOfString; + this.MapOfEnumString = mapOfEnumString; + this.DirectMap = directMap; + this.IndirectMap = indirectMap; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets MapMapOfString + /// + [DataMember(Name = "map_map_of_string", EmitDefaultValue = false)] + public Dictionary> MapMapOfString { get; set; } + + /// + /// Gets or Sets DirectMap + /// + [DataMember(Name = "direct_map", EmitDefaultValue = false)] + public Dictionary DirectMap { get; set; } + + /// + /// Gets or Sets IndirectMap + /// + [DataMember(Name = "indirect_map", EmitDefaultValue = false)] + public Dictionary IndirectMap { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MapTest {\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MapTest).AreEqual; + } + + /// + /// Returns true if MapTest instances are equal + /// + /// Instance of MapTest to be compared + /// Boolean + public bool Equals(MapTest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapMapOfString != null) + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); + if (this.DirectMap != null) + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } + if (this.IndirectMap != null) + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 000000000000..3225727af37b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + [DataContract(Name = "MixedPropertiesAndAdditionalPropertiesClass")] + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// dateTime. + /// map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + { + this.Uuid = uuid; + this.DateTime = dateTime; + this.Map = map; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name = "dateTime", EmitDefaultValue = false)] + public DateTime DateTime { get; set; } + + /// + /// Gets or Sets Map + /// + [DataMember(Name = "map", EmitDefaultValue = false)] + public Dictionary Map { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MixedPropertiesAndAdditionalPropertiesClass).AreEqual; + } + + /// + /// Returns true if MixedPropertiesAndAdditionalPropertiesClass instances are equal + /// + /// Instance of MixedPropertiesAndAdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + if (this.DateTime != null) + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } + if (this.Map != null) + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs new file mode 100644 index 000000000000..79a49ef91d28 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model name starting with number + /// + [DataContract(Name = "200_response")] + public partial class Model200Response : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// _class. + public Model200Response(int name = default(int), string _class = default(string)) + { + this.Name = name; + this.Class = _class; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public int Name { get; set; } + + /// + /// Gets or Sets Class + /// + [DataMember(Name = "class", EmitDefaultValue = false)] + public string Class { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Model200Response {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Model200Response).AreEqual; + } + + /// + /// Returns true if Model200Response instances are equal + /// + /// Instance of Model200Response to be compared + /// Boolean + public bool Equals(Model200Response input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + if (this.Class != null) + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs new file mode 100644 index 000000000000..1995ec4b1692 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ModelClient + /// + [DataContract(Name = "_Client")] + public partial class ModelClient : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _client. + public ModelClient(string _client = default(string)) + { + this._Client = _client; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _Client + /// + [DataMember(Name = "client", EmitDefaultValue = false)] + public string _Client { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ModelClient {\n"); + sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ModelClient).AreEqual; + } + + /// + /// Returns true if ModelClient instances are equal + /// + /// Instance of ModelClient to be compared + /// Boolean + public bool Equals(ModelClient input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Client != null) + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs new file mode 100644 index 000000000000..0dc21bb656f0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs @@ -0,0 +1,182 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model name same as property name + /// + [DataContract(Name = "Name")] + public partial class Name : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Name() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// property. + public Name(int name = default(int), string property = default(string)) + { + this._Name = name; + this.Property = property; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public int _Name { get; set; } + + /// + /// Gets or Sets SnakeCase + /// + [DataMember(Name = "snake_case", EmitDefaultValue = false)] + public int SnakeCase { get; private set; } + + /// + /// Returns false as SnakeCase should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeSnakeCase() + { + return false; + } + /// + /// Gets or Sets Property + /// + [DataMember(Name = "property", EmitDefaultValue = false)] + public string Property { get; set; } + + /// + /// Gets or Sets _123Number + /// + [DataMember(Name = "123Number", EmitDefaultValue = false)] + public int _123Number { get; private set; } + + /// + /// Returns false as _123Number should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize_123Number() + { + return false; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Name {\n"); + sb.Append(" _Name: ").Append(_Name).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" _123Number: ").Append(_123Number).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Name).AreEqual; + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); + if (this.Property != null) + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 000000000000..57555c376785 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,265 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// NullableClass + /// + [DataContract(Name = "NullableClass")] + public partial class NullableClass : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// integerProp. + /// numberProp. + /// booleanProp. + /// stringProp. + /// dateProp. + /// datetimeProp. + /// arrayNullableProp. + /// arrayAndItemsNullableProp. + /// arrayItemsNullable. + /// objectNullableProp. + /// objectAndItemsNullableProp. + /// objectItemsNullable. + public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ArrayItemsNullable = arrayItemsNullable; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.ObjectItemsNullable = objectItemsNullable; + } + + /// + /// Gets or Sets IntegerProp + /// + [DataMember(Name = "integer_prop", EmitDefaultValue = true)] + public int? IntegerProp { get; set; } + + /// + /// Gets or Sets NumberProp + /// + [DataMember(Name = "number_prop", EmitDefaultValue = true)] + public decimal? NumberProp { get; set; } + + /// + /// Gets or Sets BooleanProp + /// + [DataMember(Name = "boolean_prop", EmitDefaultValue = true)] + public bool? BooleanProp { get; set; } + + /// + /// Gets or Sets StringProp + /// + [DataMember(Name = "string_prop", EmitDefaultValue = true)] + public string StringProp { get; set; } + + /// + /// Gets or Sets DateProp + /// + [DataMember(Name = "date_prop", EmitDefaultValue = true)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime? DateProp { get; set; } + + /// + /// Gets or Sets DatetimeProp + /// + [DataMember(Name = "datetime_prop", EmitDefaultValue = true)] + public DateTime? DatetimeProp { get; set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [DataMember(Name = "array_nullable_prop", EmitDefaultValue = true)] + public List ArrayNullableProp { get; set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [DataMember(Name = "array_and_items_nullable_prop", EmitDefaultValue = true)] + public List ArrayAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [DataMember(Name = "array_items_nullable", EmitDefaultValue = false)] + public List ArrayItemsNullable { get; set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [DataMember(Name = "object_nullable_prop", EmitDefaultValue = true)] + public Dictionary ObjectNullableProp { get; set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [DataMember(Name = "object_and_items_nullable_prop", EmitDefaultValue = true)] + public Dictionary ObjectAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [DataMember(Name = "object_items_nullable", EmitDefaultValue = false)] + public Dictionary ObjectItemsNullable { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NullableClass {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as NullableClass).AreEqual; + } + + /// + /// Returns true if NullableClass instances are equal + /// + /// Instance of NullableClass to be compared + /// Boolean + public bool Equals(NullableClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.IntegerProp != null) + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } + if (this.NumberProp != null) + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } + if (this.BooleanProp != null) + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } + if (this.StringProp != null) + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } + if (this.DateProp != null) + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } + if (this.DatetimeProp != null) + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } + if (this.ArrayNullableProp != null) + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } + if (this.ArrayAndItemsNullableProp != null) + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } + if (this.ArrayItemsNullable != null) + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } + if (this.ObjectNullableProp != null) + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } + if (this.ObjectAndItemsNullableProp != null) + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } + if (this.ObjectItemsNullable != null) + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs new file mode 100644 index 000000000000..5dd73a56ef76 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs @@ -0,0 +1,301 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + /// + [JsonConverter(typeof(NullableShapeJsonConverter))] + [DataContract(Name = "NullableShape")] + public partial class NullableShape : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + public NullableShape() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public NullableShape(Quadrilateral actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public NullableShape(Triangle actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NullableShape {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, NullableShape.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of NullableShape + /// + /// JSON string + /// An instance of NullableShape + public static NullableShape FromJson(string jsonString) + { + NullableShape newNullableShape = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newNullableShape; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.SerializerSettings)); + } + else + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.SerializerSettings)); + } + else + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newNullableShape; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as NullableShape).AreEqual; + } + + /// + /// Returns true if NullableShape instances are equal + /// + /// Instance of NullableShape to be compared + /// Boolean + public bool Equals(NullableShape input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for NullableShape + /// + public class NullableShapeJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(NullableShape).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return NullableShape.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs new file mode 100644 index 000000000000..97f869b0ebc1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// NumberOnly + /// + [DataContract(Name = "NumberOnly")] + public partial class NumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber. + public NumberOnly(decimal justNumber = default(decimal)) + { + this.JustNumber = justNumber; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets JustNumber + /// + [DataMember(Name = "JustNumber", EmitDefaultValue = false)] + public decimal JustNumber { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as NumberOnly).AreEqual; + } + + /// + /// Returns true if NumberOnly instances are equal + /// + /// Instance of NumberOnly to be compared + /// Boolean + public bool Equals(NumberOnly input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs new file mode 100644 index 000000000000..86ea32998f8c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -0,0 +1,171 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ObjectWithDeprecatedFields + /// + [DataContract(Name = "ObjectWithDeprecatedFields")] + public partial class ObjectWithDeprecatedFields : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// id. + /// deprecatedRef. + /// bars. + public ObjectWithDeprecatedFields(string uuid = default(string), decimal id = default(decimal), DeprecatedObject deprecatedRef = default(DeprecatedObject), List bars = default(List)) + { + this.Uuid = uuid; + this.Id = id; + this.DeprecatedRef = deprecatedRef; + this.Bars = bars; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public string Uuid { get; set; } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + [Obsolete] + public decimal Id { get; set; } + + /// + /// Gets or Sets DeprecatedRef + /// + [DataMember(Name = "deprecatedRef", EmitDefaultValue = false)] + [Obsolete] + public DeprecatedObject DeprecatedRef { get; set; } + + /// + /// Gets or Sets Bars + /// + [DataMember(Name = "bars", EmitDefaultValue = false)] + [Obsolete] + public List Bars { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ObjectWithDeprecatedFields {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" DeprecatedRef: ").Append(DeprecatedRef).Append("\n"); + sb.Append(" Bars: ").Append(Bars).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ObjectWithDeprecatedFields).AreEqual; + } + + /// + /// Returns true if ObjectWithDeprecatedFields instances are equal + /// + /// Instance of ObjectWithDeprecatedFields to be compared + /// Boolean + public bool Equals(ObjectWithDeprecatedFields input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.DeprecatedRef != null) + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } + if (this.Bars != null) + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs new file mode 100644 index 000000000000..5c52482e79b9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs @@ -0,0 +1,210 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Order + /// + [DataContract(Name = "Order")] + public partial class Order : IEquatable, IValidatableObject + { + /// + /// Order Status + /// + /// Order Status + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// petId. + /// quantity. + /// shipDate. + /// Order Status. + /// complete (default to false). + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) + { + this.Id = id; + this.PetId = petId; + this.Quantity = quantity; + this.ShipDate = shipDate; + this.Status = status; + this.Complete = complete; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name = "petId", EmitDefaultValue = false)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name = "quantity", EmitDefaultValue = false)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name = "shipDate", EmitDefaultValue = false)] + public DateTime ShipDate { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name = "complete", EmitDefaultValue = true)] + public bool Complete { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Order).AreEqual; + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); + if (this.ShipDate != null) + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs new file mode 100644 index 000000000000..3209f6d6244e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -0,0 +1,152 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// OuterComposite + /// + [DataContract(Name = "OuterComposite")] + public partial class OuterComposite : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// myNumber. + /// myString. + /// myBoolean. + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) + { + this.MyNumber = myNumber; + this.MyString = myString; + this.MyBoolean = myBoolean; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name = "my_number", EmitDefaultValue = false)] + public decimal MyNumber { get; set; } + + /// + /// Gets or Sets MyString + /// + [DataMember(Name = "my_string", EmitDefaultValue = false)] + public string MyString { get; set; } + + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name = "my_boolean", EmitDefaultValue = true)] + public bool MyBoolean { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as OuterComposite).AreEqual; + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); + if (this.MyString != null) + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnum.cs new file mode 100644 index 000000000000..2aa496a2e074 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OuterEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 000000000000..dd79c7010d6b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumDefaultValue + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 000000000000..44dc91c700ad --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumInteger + /// + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 000000000000..b927507cf97a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ParentPet.cs new file mode 100644 index 000000000000..ac986b555efd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ParentPet.cs @@ -0,0 +1,146 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ParentPet + /// + [DataContract(Name = "ParentPet")] + [JsonConverter(typeof(JsonSubtypes), "PetType")] + [JsonSubtypes.KnownSubType(typeof(ChildCat), "ChildCat")] + public partial class ParentPet : GrandparentAnimal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ParentPet() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// petType (required) (default to "ParentPet"). + public ParentPet(string petType = "ParentPet") : base(petType) + { + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ParentPet {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ParentPet).AreEqual; + } + + /// + /// Returns true if ParentPet instances are equal + /// + /// Instance of ParentPet to be compared + /// Boolean + public bool Equals(ParentPet input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs new file mode 100644 index 000000000000..31fd118f4f68 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs @@ -0,0 +1,235 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Pet + /// + [DataContract(Name = "Pet")] + public partial class Pet : IEquatable, IValidatableObject + { + /// + /// pet status in the store + /// + /// pet status in the store + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Available for value: available + /// + [EnumMember(Value = "available")] + Available = 1, + + /// + /// Enum Pending for value: pending + /// + [EnumMember(Value = "pending")] + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + [EnumMember(Value = "sold")] + Sold = 3 + + } + + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Pet() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// category. + /// name (required). + /// photoUrls (required). + /// tags. + /// pet status in the store. + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + { + // to ensure "name" is required (not null) + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; + // to ensure "photoUrls" is required (not null) + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; + this.Id = id; + this.Category = category; + this.Tags = tags; + this.Status = status; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = false)] + public List Tags { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Pet).AreEqual; + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Category != null) + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.PhotoUrls != null) + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } + if (this.Tags != null) + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs new file mode 100644 index 000000000000..b82c0899c27d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs @@ -0,0 +1,292 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Pig + /// + [JsonConverter(typeof(PigJsonConverter))] + [DataContract(Name = "Pig")] + public partial class Pig : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of BasquePig. + public Pig(BasquePig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of DanishPig. + public Pig(DanishPig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(BasquePig)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(DanishPig)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: BasquePig, DanishPig"); + } + } + } + + /// + /// Get the actual instance of `BasquePig`. If the actual instance is not `BasquePig`, + /// the InvalidClassException will be thrown + /// + /// An instance of BasquePig + public BasquePig GetBasquePig() + { + return (BasquePig)this.ActualInstance; + } + + /// + /// Get the actual instance of `DanishPig`. If the actual instance is not `DanishPig`, + /// the InvalidClassException will be thrown + /// + /// An instance of DanishPig + public DanishPig GetDanishPig() + { + return (DanishPig)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pig {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Pig.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Pig + /// + /// JSON string + /// An instance of Pig + public static Pig FromJson(string jsonString) + { + Pig newPig = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newPig; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(BasquePig).GetProperty("AdditionalProperties") == null) + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.SerializerSettings)); + } + else + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("BasquePig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BasquePig: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(DanishPig).GetProperty("AdditionalProperties") == null) + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.SerializerSettings)); + } + else + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("DanishPig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into DanishPig: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newPig; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Pig).AreEqual; + } + + /// + /// Returns true if Pig instances are equal + /// + /// Instance of Pig to be compared + /// Boolean + public bool Equals(Pig input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Pig + /// + public class PigJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Pig).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Pig.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs new file mode 100644 index 000000000000..a1a850f169e4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -0,0 +1,292 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Quadrilateral + /// + [JsonConverter(typeof(QuadrilateralJsonConverter))] + [DataContract(Name = "Quadrilateral")] + public partial class Quadrilateral : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ComplexQuadrilateral. + public Quadrilateral(ComplexQuadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of SimpleQuadrilateral. + public Quadrilateral(SimpleQuadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(ComplexQuadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(SimpleQuadrilateral)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: ComplexQuadrilateral, SimpleQuadrilateral"); + } + } + } + + /// + /// Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of ComplexQuadrilateral + public ComplexQuadrilateral GetComplexQuadrilateral() + { + return (ComplexQuadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of SimpleQuadrilateral + public SimpleQuadrilateral GetSimpleQuadrilateral() + { + return (SimpleQuadrilateral)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Quadrilateral {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Quadrilateral.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Quadrilateral + /// + /// JSON string + /// An instance of Quadrilateral + public static Quadrilateral FromJson(string jsonString) + { + Quadrilateral newQuadrilateral = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newQuadrilateral; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ComplexQuadrilateral).GetProperty("AdditionalProperties") == null) + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.SerializerSettings)); + } + else + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("ComplexQuadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into ComplexQuadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(SimpleQuadrilateral).GetProperty("AdditionalProperties") == null) + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.SerializerSettings)); + } + else + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("SimpleQuadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into SimpleQuadrilateral: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newQuadrilateral; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Quadrilateral).AreEqual; + } + + /// + /// Returns true if Quadrilateral instances are equal + /// + /// Instance of Quadrilateral to be compared + /// Boolean + public bool Equals(Quadrilateral input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Quadrilateral + /// + public class QuadrilateralJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Quadrilateral).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Quadrilateral.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs new file mode 100644 index 000000000000..4d7c39c4364d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// QuadrilateralInterface + /// + [DataContract(Name = "QuadrilateralInterface")] + public partial class QuadrilateralInterface : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected QuadrilateralInterface() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType (required). + public QuadrilateralInterface(string quadrilateralType = default(string)) + { + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class QuadrilateralInterface {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as QuadrilateralInterface).AreEqual; + } + + /// + /// Returns true if QuadrilateralInterface instances are equal + /// + /// Instance of QuadrilateralInterface to be compared + /// Boolean + public bool Equals(QuadrilateralInterface input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs new file mode 100644 index 000000000000..ad59ca832864 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -0,0 +1,151 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ReadOnlyFirst + /// + [DataContract(Name = "ReadOnlyFirst")] + public partial class ReadOnlyFirst : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// baz. + public ReadOnlyFirst(string baz = default(string)) + { + this.Baz = baz; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; private set; } + + /// + /// Returns false as Bar should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBar() + { + return false; + } + /// + /// Gets or Sets Baz + /// + [DataMember(Name = "baz", EmitDefaultValue = false)] + public string Baz { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ReadOnlyFirst).AreEqual; + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.Baz != null) + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs new file mode 100644 index 000000000000..e702e0157030 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract(Name = "Return")] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _return. + public Return(int _return = default(int)) + { + this._Return = _return; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name = "return", EmitDefaultValue = false)] + public int _Return { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Return).AreEqual; + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this._Return.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs new file mode 100644 index 000000000000..236839471475 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ScaleneTriangle + /// + [DataContract(Name = "ScaleneTriangle")] + public partial class ScaleneTriangle : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ScaleneTriangle() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } + this.TriangleType = triangleType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ScaleneTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ScaleneTriangle).AreEqual; + } + + /// + /// Returns true if ScaleneTriangle instances are equal + /// + /// Instance of ScaleneTriangle to be compared + /// Boolean + public bool Equals(ScaleneTriangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs new file mode 100644 index 000000000000..dd74fa4b7184 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs @@ -0,0 +1,292 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Shape + /// + [JsonConverter(typeof(ShapeJsonConverter))] + [DataContract(Name = "Shape")] + public partial class Shape : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public Shape(Quadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public Shape(Triangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Shape {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Shape.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Shape + /// + /// JSON string + /// An instance of Shape + public static Shape FromJson(string jsonString) + { + Shape newShape = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newShape; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.SerializerSettings)); + } + else + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.SerializerSettings)); + } + else + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newShape; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Shape).AreEqual; + } + + /// + /// Returns true if Shape instances are equal + /// + /// Instance of Shape to be compared + /// Boolean + public bool Equals(Shape input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Shape + /// + public class ShapeJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Shape).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Shape.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs new file mode 100644 index 000000000000..92774561aaa5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ShapeInterface + /// + [DataContract(Name = "ShapeInterface")] + public partial class ShapeInterface : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ShapeInterface() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + public ShapeInterface(string shapeType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } + this.ShapeType = shapeType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ShapeInterface {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ShapeInterface).AreEqual; + } + + /// + /// Returns true if ShapeInterface instances are equal + /// + /// Instance of ShapeInterface to be compared + /// Boolean + public bool Equals(ShapeInterface input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs new file mode 100644 index 000000000000..c6b87c89751a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -0,0 +1,301 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + /// + [JsonConverter(typeof(ShapeOrNullJsonConverter))] + [DataContract(Name = "ShapeOrNull")] + public partial class ShapeOrNull : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + public ShapeOrNull() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public ShapeOrNull(Quadrilateral actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public ShapeOrNull(Triangle actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ShapeOrNull {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, ShapeOrNull.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of ShapeOrNull + /// + /// JSON string + /// An instance of ShapeOrNull + public static ShapeOrNull FromJson(string jsonString) + { + ShapeOrNull newShapeOrNull = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newShapeOrNull; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.SerializerSettings)); + } + else + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.SerializerSettings)); + } + else + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newShapeOrNull; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ShapeOrNull).AreEqual; + } + + /// + /// Returns true if ShapeOrNull instances are equal + /// + /// Instance of ShapeOrNull to be compared + /// Boolean + public bool Equals(ShapeOrNull input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for ShapeOrNull + /// + public class ShapeOrNullJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(ShapeOrNull).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return ShapeOrNull.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs new file mode 100644 index 000000000000..fc9b37ce01fb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// SimpleQuadrilateral + /// + [DataContract(Name = "SimpleQuadrilateral")] + public partial class SimpleQuadrilateral : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SimpleQuadrilateral() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// quadrilateralType (required). + public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SimpleQuadrilateral {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as SimpleQuadrilateral).AreEqual; + } + + /// + /// Returns true if SimpleQuadrilateral instances are equal + /// + /// Instance of SimpleQuadrilateral to be compared + /// Boolean + public bool Equals(SimpleQuadrilateral input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs new file mode 100644 index 000000000000..7800467822ea --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// SpecialModelName + /// + [DataContract(Name = "_special_model.name_")] + public partial class SpecialModelName : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// specialPropertyName. + /// specialModelName. + public SpecialModelName(long specialPropertyName = default(long), string specialModelName = default(string)) + { + this.SpecialPropertyName = specialPropertyName; + this._SpecialModelName = specialModelName; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SpecialPropertyName + /// + [DataMember(Name = "$special[property.name]", EmitDefaultValue = false)] + public long SpecialPropertyName { get; set; } + + /// + /// Gets or Sets _SpecialModelName + /// + [DataMember(Name = "_special_model.name_", EmitDefaultValue = false)] + public string _SpecialModelName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SpecialModelName {\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); + sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as SpecialModelName).AreEqual; + } + + /// + /// Returns true if SpecialModelName instances are equal + /// + /// Instance of SpecialModelName to be compared + /// Boolean + public bool Equals(SpecialModelName input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); + if (this._SpecialModelName != null) + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs new file mode 100644 index 000000000000..3df2c02e2cef --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Tag + /// + [DataContract(Name = "Tag")] + public partial class Tag : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Tag(long id = default(long), string name = default(string)) + { + this.Id = id; + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Tag).AreEqual; + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs new file mode 100644 index 000000000000..c8cf49ef7f66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs @@ -0,0 +1,338 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Triangle + /// + [JsonConverter(typeof(TriangleJsonConverter))] + [DataContract(Name = "Triangle")] + public partial class Triangle : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of EquilateralTriangle. + public Triangle(EquilateralTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of IsoscelesTriangle. + public Triangle(IsoscelesTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ScaleneTriangle. + public Triangle(ScaleneTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(EquilateralTriangle)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(IsoscelesTriangle)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(ScaleneTriangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + } + } + } + + /// + /// Get the actual instance of `EquilateralTriangle`. If the actual instance is not `EquilateralTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of EquilateralTriangle + public EquilateralTriangle GetEquilateralTriangle() + { + return (EquilateralTriangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `IsoscelesTriangle`. If the actual instance is not `IsoscelesTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of IsoscelesTriangle + public IsoscelesTriangle GetIsoscelesTriangle() + { + return (IsoscelesTriangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `ScaleneTriangle`. If the actual instance is not `ScaleneTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of ScaleneTriangle + public ScaleneTriangle GetScaleneTriangle() + { + return (ScaleneTriangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Triangle {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Triangle.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Triangle + /// + /// JSON string + /// An instance of Triangle + public static Triangle FromJson(string jsonString) + { + Triangle newTriangle = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newTriangle; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(EquilateralTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("EquilateralTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into EquilateralTriangle: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(IsoscelesTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("IsoscelesTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into IsoscelesTriangle: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ScaleneTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("ScaleneTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into ScaleneTriangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newTriangle; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Triangle).AreEqual; + } + + /// + /// Returns true if Triangle instances are equal + /// + /// Instance of Triangle to be compared + /// Boolean + public bool Equals(Triangle input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for Triangle + /// + public class TriangleJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Triangle).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Triangle.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs new file mode 100644 index 000000000000..7f7abb5bc85b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TriangleInterface + /// + [DataContract(Name = "TriangleInterface")] + public partial class TriangleInterface : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TriangleInterface() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// triangleType (required). + public TriangleInterface(string triangleType = default(string)) + { + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } + this.TriangleType = triangleType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)] + public string TriangleType { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TriangleInterface {\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TriangleInterface).AreEqual; + } + + /// + /// Returns true if TriangleInterface instances are equal + /// + /// Instance of TriangleInterface to be compared + /// Boolean + public bool Equals(TriangleInterface input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs new file mode 100644 index 000000000000..5f2a3020c3dd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs @@ -0,0 +1,274 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// User + /// + [DataContract(Name = "User")] + public partial class User : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// username. + /// firstName. + /// lastName. + /// email. + /// password. + /// phone. + /// User Status. + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int), Object objectWithNoDeclaredProps = default(Object), Object objectWithNoDeclaredPropsNullable = default(Object), Object anyTypeProp = default(Object), Object anyTypePropNullable = default(Object)) + { + this.Id = id; + this.Username = username; + this.FirstName = firstName; + this.LastName = lastName; + this.Email = email; + this.Password = password; + this.Phone = phone; + this.UserStatus = userStatus; + this.ObjectWithNoDeclaredProps = objectWithNoDeclaredProps; + this.ObjectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + this.AnyTypeProp = anyTypeProp; + this.AnyTypePropNullable = anyTypePropNullable; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", EmitDefaultValue = false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name = "firstName", EmitDefaultValue = false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name = "lastName", EmitDefaultValue = false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name = "email", EmitDefaultValue = false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name = "phone", EmitDefaultValue = false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name = "userStatus", EmitDefaultValue = false)] + public int UserStatus { get; set; } + + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + [DataMember(Name = "objectWithNoDeclaredProps", EmitDefaultValue = false)] + public Object ObjectWithNoDeclaredProps { get; set; } + + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + [DataMember(Name = "objectWithNoDeclaredPropsNullable", EmitDefaultValue = true)] + public Object ObjectWithNoDeclaredPropsNullable { get; set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + [DataMember(Name = "anyTypeProp", EmitDefaultValue = true)] + public Object AnyTypeProp { get; set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + [DataMember(Name = "anyTypePropNullable", EmitDefaultValue = true)] + public Object AnyTypePropNullable { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); + sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); + sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); + sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as User).AreEqual; + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Username != null) + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.Email != null) + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } + if (this.Phone != null) + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); + if (this.ObjectWithNoDeclaredProps != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } + if (this.ObjectWithNoDeclaredPropsNullable != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } + if (this.AnyTypeProp != null) + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } + if (this.AnyTypePropNullable != null) + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs new file mode 100644 index 000000000000..c30b6dbfabed --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Whale + /// + [DataContract(Name = "whale")] + public partial class Whale : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Whale() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// hasBaleen. + /// hasTeeth. + /// className (required). + public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } + this.ClassName = className; + this.HasBaleen = hasBaleen; + this.HasTeeth = hasTeeth; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets HasBaleen + /// + [DataMember(Name = "hasBaleen", EmitDefaultValue = true)] + public bool HasBaleen { get; set; } + + /// + /// Gets or Sets HasTeeth + /// + [DataMember(Name = "hasTeeth", EmitDefaultValue = true)] + public bool HasTeeth { get; set; } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Whale {\n"); + sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); + sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Whale).AreEqual; + } + + /// + /// Returns true if Whale instances are equal + /// + /// Instance of Whale to be compared + /// Boolean + public bool Equals(Whale input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs new file mode 100644 index 000000000000..4fb60ed8ddf2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -0,0 +1,181 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Zebra + /// + [DataContract(Name = "zebra")] + public partial class Zebra : Dictionary, IEquatable, IValidatableObject + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum Plains for value: plains + /// + [EnumMember(Value = "plains")] + Plains = 1, + + /// + /// Enum Mountain for value: mountain + /// + [EnumMember(Value = "mountain")] + Mountain = 2, + + /// + /// Enum Grevys for value: grevys + /// + [EnumMember(Value = "grevys")] + Grevys = 3 + + } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Zebra() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// type. + /// className (required). + public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() + { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } + this.ClassName = className; + this.Type = type; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Zebra {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Zebra).AreEqual; + } + + /// + /// Returns true if Zebra instances are equal + /// + /// Instance of Zebra to be compared + /// Boolean + public bool Equals(Zebra input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 000000000000..03f1e6e536fb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + netstandard2.0 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + + + + + + + + + + + + + + From 9f5422d68810e92b6b0a526603dec3be1911a9e2 Mon Sep 17 00:00:00 2001 From: Ethan Keller Date: Sun, 6 Feb 2022 13:21:17 -0500 Subject: [PATCH 014/111] Add cycle detection (#7532) (#11500) * Add cycle detection (#7532) * Review feedback * Including ContextAwareNodes to detect cycles more accurately. * Add test * Add forest to test. * No longer need ContextAwareNode * Review feedback * Update samples --- .../languages/AbstractPythonCodegen.java | 17 ++++-- .../PythonExperimentalClientCodegen.java | 49 +++++++++++---- .../codegen/python/PythonClientTest.java | 17 ++++++ .../src/test/resources/3_0/issue_7532.yaml | 61 +++++++++++++++++++ ...issue_7532_tree_example_value_expected.txt | 15 +++++ .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../python-experimental/docs/FakeApi.md | 28 ++++----- .../python-experimental/docs/PetApi.md | 12 ++-- .../python-experimental/docs/UserApi.md | 4 +- 11 files changed, 166 insertions(+), 43 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/issue_7532.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index 1d406e00ac54..97344f4cbcb3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -33,6 +33,7 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -292,7 +293,11 @@ public String toExampleValue(Schema schema) { return toExampleValueRecursive(schema, new ArrayList<>(), 5); } - private String toExampleValueRecursive(Schema schema, List includedSchemas, int indentation) { + private String toExampleValueRecursive(Schema schema, List includedSchemas, int indentation) { + boolean cycleFound = includedSchemas.stream().filter(s->schema.equals(s)).count() > 1; + if (cycleFound) { + return ""; + } String indentationString = ""; for (int i = 0; i < indentation; i++) indentationString += " "; String example = null; @@ -347,7 +352,7 @@ private String toExampleValueRecursive(Schema schema, List includedSchem refSchema.setTitle(ref); } if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { - includedSchemas.add(schema.getTitle()); + includedSchemas.add(schema); } return toExampleValueRecursive(refSchema, includedSchemas, indentation); } @@ -412,13 +417,13 @@ private String toExampleValueRecursive(Schema schema, List includedSchem example = "True"; } else if (ModelUtils.isArraySchema(schema)) { if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { - includedSchemas.add(schema.getTitle()); + includedSchemas.add(schema); } ArraySchema arrayschema = (ArraySchema) schema; example = "[\n" + indentationString + toExampleValueRecursive(arrayschema.getItems(), includedSchemas, indentation + 1) + "\n" + indentationString + "]"; } else if (ModelUtils.isMapSchema(schema)) { if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { - includedSchemas.add(schema.getTitle()); + includedSchemas.add(schema); } Object additionalObject = schema.getAdditionalProperties(); if (additionalObject instanceof Schema) { @@ -464,13 +469,13 @@ private String toExampleValueRecursive(Schema schema, List includedSchem if (toExclude != null && reqs.contains(toExclude)) { reqs.remove(toExclude); } - for (String toRemove : includedSchemas) { + for (String toRemove : includedSchemas.stream().map(Schema::getTitle).collect(Collectors.toList())) { if (reqs.contains(toRemove)) { reqs.remove(toRemove); } } if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { - includedSchemas.add(schema.getTitle()); + includedSchemas.add(schema); } if (null != schema.getRequired()) for (Object toAdd : schema.getRequired()) { reqs.add((String) toAdd); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index 3eca491d66f5..3a893cb40cb3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.tags.Tag; +import org.apache.commons.lang3.tuple.Triple; import org.openapitools.codegen.api.TemplatePathLocator; import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; import org.openapitools.codegen.templating.*; @@ -51,6 +52,7 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import static org.openapitools.codegen.utils.OnceLogger.once; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -1352,7 +1354,7 @@ private String ensureQuotes(String in) { public String toExampleValue(Schema schema, Object objExample) { String modelName = getModelName(schema); - return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0); + return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); } private Boolean simpleStringSchema(Schema schema) { @@ -1398,9 +1400,17 @@ private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { * ModelName( line 0 * some_property='some_property_example' line 1 * ) line 2 + * @param includedSchemas are a list of schemas that we have moved through to get here. If the new schemas that we + * are looking at is in includedSchemas then we have hit a cycle. * @return the string example */ - private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine) { + private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine, List includedSchemas) { + boolean couldHaveCycle = includedSchemas.size() > 0 && potentiallySelfReferencingSchema(schema); + // If we have seen the ContextAwareSchemaNode more than once before, we must be in a cycle. + boolean cycleFound = false; + if (couldHaveCycle) { + cycleFound = includedSchemas.subList(0, includedSchemas.size()-1).stream().anyMatch(s -> schema.equals(s)); + } final String indentionConst = " "; String currentIndentation = ""; String closingIndentation = ""; @@ -1433,7 +1443,7 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o return fullPrefix + "None" + closeChars; } String refModelName = getModelName(schema); - return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine); + return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine, includedSchemas); } else if (ModelUtils.isNullType(schema) || isAnyTypeSchema(schema)) { // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, // though this tooling supports it. @@ -1531,8 +1541,13 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o ArraySchema arrayschema = (ArraySchema) schema; Schema itemSchema = arrayschema.getItems(); String itemModelName = getModelName(itemSchema); - example = fullPrefix + "[" + "\n" + toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1) + ",\n" + closingIndentation + "]" + closeChars; - return example; + includedSchemas.add(schema); + String itemExample = toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1, includedSchemas); + if (StringUtils.isEmpty(itemExample) || cycleFound) { + return fullPrefix + "[]"; + } else { + return fullPrefix + "[" + "\n" + itemExample + "\n" + closingIndentation + "]" + closeChars; + } } else if (ModelUtils.isMapSchema(schema)) { if (modelName == null) { fullPrefix += "dict("; @@ -1540,7 +1555,7 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o } Object addPropsObj = schema.getAdditionalProperties(); // TODO handle true case for additionalProperties - if (addPropsObj instanceof Schema) { + if (addPropsObj instanceof Schema && !cycleFound) { Schema addPropsSchema = (Schema) addPropsObj; String key = "key"; Object addPropsExample = getObjectExample(addPropsSchema); @@ -1553,7 +1568,8 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o addPropPrefix = ensureQuotes(key) + ": "; } String addPropsModelName = getModelName(addPropsSchema); - example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1) + ",\n" + closingIndentation + closeChars; + includedSchemas.add(schema); + example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1, includedSchemas) + ",\n" + closingIndentation + closeChars; } else { example = fullPrefix + closeChars; } @@ -1563,6 +1579,9 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o fullPrefix += "dict("; closeChars = ")"; } + if (cycleFound) { + return fullPrefix + closeChars; + } CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); if (disc != null) { MappedModel mm = getDiscriminatorMappedModel(disc); @@ -1576,8 +1595,11 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o return fullPrefix + closeChars; } } - return exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation); + return exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation, includedSchemas); } else if (ModelUtils.isComposedSchema(schema)) { + if (cycleFound) { + return fullPrefix + closeChars; + } // TODO add examples for composed schema models without discriminators CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); @@ -1590,7 +1612,7 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o CodegenProperty cp = new CodegenProperty(); cp.setName(disc.getPropertyName()); cp.setExample(discPropNameValue); - return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation); + return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); } else { return fullPrefix + closeChars; } @@ -1603,7 +1625,11 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o return example; } - private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation) { + private boolean potentiallySelfReferencingSchema(Schema schema) { + return null != schema.get$ref() || ModelUtils.isArraySchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isObjectSchema(schema) || ModelUtils.isComposedSchema(schema); + } + + private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation, List includedSchemas) { Map requiredAndOptionalProps = schema.getProperties(); if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) { return fullPrefix + closeChars; @@ -1623,7 +1649,8 @@ private String exampleForObjectModel(Schema schema, String fullPrefix, String cl propModelName = getModelName(propSchema); propExample = exampleFromStringOrArraySchema(propSchema, null, propName); } - example += toExampleValueRecursive(propModelName, propSchema, propExample, indentationLevel + 1, propName + "=", exampleLine + 1) + ",\n"; + includedSchemas.add(schema); + example += toExampleValueRecursive(propModelName, propSchema, propExample, indentationLevel + 1, propName + "=", exampleLine + 1, includedSchemas) + ",\n"; } // TODO handle additionalProperties also example += closingIndentation + closeChars; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java index bb470c5c3151..aa143e5b7f33 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java @@ -37,6 +37,7 @@ import org.openapitools.codegen.*; import org.openapitools.codegen.languages.PythonClientCodegen; +import org.openapitools.codegen.languages.PythonExperimentalClientCodegen; import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; @@ -487,4 +488,20 @@ public void testNoProxyPyClient() throws Exception { } } + @Test(description = "tests RecursiveExampleValueWithCycle") + public void testRecursiveExampleValueWithCycle() throws Exception { + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7532.yaml"); + final PythonExperimentalClientCodegen codegen = new PythonExperimentalClientCodegen(); + codegen.setOpenAPI(openAPI); + Schema schemaWithCycleInTreesProperty = openAPI.getComponents().getSchemas().get("Forest"); + String exampleValue = codegen.toExampleValue(schemaWithCycleInTreesProperty, null); + + String expectedValue = Resources.toString( + Resources.getResource("3_0/issue_7532_tree_example_value_expected.txt"), + StandardCharsets.UTF_8); + expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); + Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); + } + } diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_7532.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_7532.yaml new file mode 100644 index 000000000000..2f410e536aba --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_7532.yaml @@ -0,0 +1,61 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Test swagger file +paths: + /tree: + post: + description: Create + operationId: createTree + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tree' + description: The tree to create + required: true + tags: + - Test + responses: + '200': + description: Successfully created the tree + content: + '*/*': + schema: + $ref: '#/components/schemas/Tree' + '400': + description: Bad request +components: + schemas: + Tree: + type: object + required: + - id + - name + - children + properties: + id: + type: integer + name: + type: string + description: + type: string + children: + type: array + items: + $ref: '#/components/schemas/Tree' + parent: + $ref: '#/components/schemas/Tree' + forest: + $ref: '#/components/schemas/Forest' + additional: + type: object + additionalProperties: + $ref: '#/components/schemas/Tree' + Forest: + type: object + properties: + trees: + $ref: '#/components/schemas/Tree' + + diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt b/modules/openapi-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt new file mode 100644 index 000000000000..6c3772035ed0 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt @@ -0,0 +1,15 @@ +dict( + trees=Tree( + id=1, + name="name_example", + description="description_example", + children=[ + Tree() + ], + parent=Tree(), + forest=Forest(), + additional=dict( + "key": Tree(), + ), + ), + ) \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/VERSION index 0984c4c1ad21..5f68295fc196 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/VERSION @@ -1 +1 @@ -5.4.0-SNAPSHOT \ No newline at end of file +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/VERSION index 0984c4c1ad21..5f68295fc196 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.4.0-SNAPSHOT \ No newline at end of file +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/VERSION index 0984c4c1ad21..5f68295fc196 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.4.0-SNAPSHOT \ No newline at end of file +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index ddb0b6f2c8e7..69d80dcb49fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -57,7 +57,7 @@ with petstore_api.ApiClient(configuration) as api_client: # example passing only optional values body = AdditionalPropertiesWithArrayOfEnums( key=[ - EnumClass("-efg"), + EnumClass("-efg") ], ) try: @@ -144,7 +144,7 @@ with petstore_api.ApiClient(configuration) as api_client: # example passing only optional values body = AnimalFarm([ - Animal(), + Animal() ]) try: api_response = api_instance.array_model( @@ -227,7 +227,7 @@ with petstore_api.ApiClient(configuration) as api_client: # example passing only optional values body = ArrayOfEnums([ - StringEnum("placed"), + StringEnum("placed") ]) try: # Array of Enums @@ -317,9 +317,7 @@ with petstore_api.ApiClient(configuration) as api_client: source_uri="source_uri_example", ), files=[ - File( - source_uri="source_uri_example", - ), + File() ], ) try: @@ -974,7 +972,7 @@ with petstore_api.ApiClient(configuration) as api_client: # example passing only optional values query_params = { 'enum_query_string_array': [ - "$", + "$" ], 'enum_query_string': "-efg", 'enum_query_integer': 1, @@ -982,13 +980,13 @@ with petstore_api.ApiClient(configuration) as api_client: } header_params = { 'enum_header_string_array': [ - "$", + "$" ], 'enum_header_string': "-efg", } body = dict( enum_form_string_array=[ - "$", + "$" ], enum_form_string="-efg", ) @@ -2203,19 +2201,19 @@ with petstore_api.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set query_params = { 'pipe': [ - "pipe_example", + "pipe_example" ], 'ioutil': [ - "ioutil_example", + "ioutil_example" ], 'http': [ - "http_example", + "http_example" ], 'url': [ - "url_example", + "url_example" ], 'context': [ - "context_example", + "context_example" ], 'refParam': StringWithValidation("refParam_example"), } @@ -2671,7 +2669,7 @@ with petstore_api.ApiClient(configuration) as api_client: # example passing only optional values body = dict( files=[ - open('/path/to/file', 'rb'), + open('/path/to/file', 'rb') ], ) try: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index 9bcb83080704..c979cf2db2bf 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -119,13 +119,13 @@ with petstore_api.ApiClient(configuration) as api_client: ), name="doggie", photo_urls=[ - "photo_urls_example", + "photo_urls_example" ], tags=[ Tag( id=1, name="name_example", - ), + ) ], status="available", ) @@ -415,7 +415,7 @@ with petstore_api.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set query_params = { 'status': [ - "available", + "available" ], } try: @@ -593,7 +593,7 @@ with petstore_api.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set query_params = { 'tags': [ - "tags_example", + "tags_example" ], } try: @@ -898,13 +898,13 @@ with petstore_api.ApiClient(configuration) as api_client: ), name="doggie", photo_urls=[ - "photo_urls_example", + "photo_urls_example" ], tags=[ Tag( id=1, name="name_example", - ), + ) ], status="available", ) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md index 0e77fad4125c..5fc0764d75ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -140,7 +140,7 @@ with petstore_api.ApiClient(configuration) as api_client: object_with_no_declared_props_nullable=dict(), any_type_prop=None, any_type_prop_nullable=None, - ), + ) ] try: # Creates list of users with given input array @@ -229,7 +229,7 @@ with petstore_api.ApiClient(configuration) as api_client: object_with_no_declared_props_nullable=dict(), any_type_prop=None, any_type_prop_nullable=None, - ), + ) ] try: # Creates list of users with given input array From 9e1972bb1d3a4f1e3f47c87613f4050feada0146 Mon Sep 17 00:00:00 2001 From: Julian G <23147553+JulianGmp@users.noreply.github.com> Date: Mon, 7 Feb 2022 05:21:11 +0100 Subject: [PATCH 015/111] fix float literals in C++ Pistache codegen (#11483) --- .../codegen/languages/CppPistacheServerCodegen.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index 4ab177e21a35..886060e702ce 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -408,7 +408,15 @@ public String toDefaultValue(Schema p) { } else if (ModelUtils.isNumberSchema(p)) { if (ModelUtils.isFloatSchema(p)) { // float if (p.getDefault() != null) { - return p.getDefault().toString() + "f"; + // We have to ensure that our default value has a decimal point, + // because in C++ the 'f' suffix is not valid on integer literals + // i.e. 374.0f is a valid float but 374 isn't. + String defaultStr = p.getDefault().toString(); + if (defaultStr.indexOf('.') < 0) { + return defaultStr + ".0f"; + } else { + return defaultStr + "f"; + } } else { return "0.0f"; } From 8ecd619eb344e5ee9b2cceef40e22c1e71a11b2f Mon Sep 17 00:00:00 2001 From: devhl-labs Date: Mon, 7 Feb 2022 02:06:47 -0500 Subject: [PATCH 016/111] [csharp-nancyfx] Delete NancyFX (#11438) * removed all nancyfx references * didnt save one file * removed two more nancyfx files --- README.md | 3 +- docs/faq-generators.md | 2 +- docs/generators.md | 1 - docs/generators/README.md | 1 - docs/generators/csharp-nancyfx-deprecated.md | 209 -------- docs/migration-from-swagger-codegen.md | 1 - .../languages/CSharpNancyFXServerCodegen.java | 441 ----------------- .../org.openapitools.codegen.CodegenConfig | 1 - .../resources/csharp-nancyfx/Project.mustache | 79 --- .../csharp-nancyfx/Solution.mustache | 25 - .../resources/csharp-nancyfx/api.mustache | 78 --- .../main/resources/csharp-nancyfx/gitignore | 362 -------------- .../csharp-nancyfx/innerApiEnum.mustache | 10 - .../csharp-nancyfx/innerApiEnumName.mustache | 1 - .../csharp-nancyfx/innerModelEnum.mustache | 1 - .../innerParameterType.mustache | 1 - .../innerParameterValueOfArgs.mustache | 1 - .../localDateConverter.mustache | 55 --- .../resources/csharp-nancyfx/model.mustache | 15 - .../csharp-nancyfx/modelEnum.mustache | 15 - .../csharp-nancyfx/modelGeneric.mustache | 156 ------ .../csharp-nancyfx/modelMutable.mustache | 72 --- .../csharp-nancyfx/nullableDataType.mustache | 1 - .../resources/csharp-nancyfx/nuspec.mustache | 14 - .../csharp-nancyfx/packages.config.mustache | 10 - .../csharp-nancyfx/parameters.mustache | 450 ------------------ .../csharp-nancyfx/paramsList.mustache | 1 - website/i18n/en.json | 4 - 28 files changed, 2 insertions(+), 2008 deletions(-) delete mode 100644 docs/generators/csharp-nancyfx-deprecated.md delete mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/Solution.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/gitignore delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnumName.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/innerParameterType.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/innerParameterValueOfArgs.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/model.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/nullableDataType.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/packages.config.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/parameters.mustache delete mode 100644 modules/openapi-generator/src/main/resources/csharp-nancyfx/paramsList.mustache diff --git a/README.md b/README.md index adf3fa9c4058..c624cc075b4a 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient, Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) | -| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | +| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | | **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | | **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer**, **WSDL** | @@ -949,7 +949,6 @@ Here is a list of template creators: * C# ASP.NET Core 3.0: @A-Joshi * C# APS.NET Core 3.1: @phatcher * C# Azure functions: @Abrhm7786 - * C# NancyFX: @mstefaniuk * C++ (Qt5 QHttpEngine): @etherealjoy * C++ Pistache: @sebymiano * C++ Restbed: @stkrwork diff --git a/docs/faq-generators.md b/docs/faq-generators.md index 7f21a93860c9..370130dbe118 100644 --- a/docs/faq-generators.md +++ b/docs/faq-generators.md @@ -5,7 +5,7 @@ title: "FAQ: Generators" ### What are some server generator use cases? -We have around 40+ server generators, with more added regularly. Some of these include Spring in your choice of Java or Kotlin, the Finch and Scalatra frameworks using Scala, and C# generators for NancyFX and WebAPI (to name only a few). +We have around 40+ server generators, with more added regularly. Some of these include Spring in your choice of Java or Kotlin, the Finch and Scalatra frameworks using Scala, and C# generators for ASP.NET and Azure Functions (to name only a few). Besides generating the server code as a starting point to implement the API backend, here are some use cases of the server generators: diff --git a/docs/generators.md b/docs/generators.md index 595a9e804af6..4dda7bc557fa 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -82,7 +82,6 @@ The following generators are available: * [cpp-pistache-server](generators/cpp-pistache-server.md) * [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md) * [cpp-restbed-server](generators/cpp-restbed-server.md) -* [csharp-nancyfx-deprecated (deprecated)](generators/csharp-nancyfx-deprecated.md) * [csharp-netcore-functions (beta)](generators/csharp-netcore-functions.md) * [erlang-server](generators/erlang-server.md) * [fsharp-functions (beta)](generators/fsharp-functions.md) diff --git a/docs/generators/README.md b/docs/generators/README.md index 8f6ee8a7f15d..648de9673e73 100644 --- a/docs/generators/README.md +++ b/docs/generators/README.md @@ -67,7 +67,6 @@ The following generators are available: * [cpp-pistache-server](cpp-pistache-server.md) * [cpp-qt5-qhttpengine-server](cpp-qt5-qhttpengine-server.md) * [cpp-restbed-server](cpp-restbed-server.md) -* [csharp-nancyfx](csharp-nancyfx.md) * [erlang-server](erlang-server.md) * [fsharp-functions (beta)](fsharp-functions.md) * [fsharp-giraffe-server (beta)](fsharp-giraffe-server.md) diff --git a/docs/generators/csharp-nancyfx-deprecated.md b/docs/generators/csharp-nancyfx-deprecated.md deleted file mode 100644 index 519edc27307d..000000000000 --- a/docs/generators/csharp-nancyfx-deprecated.md +++ /dev/null @@ -1,209 +0,0 @@ ---- -title: Documentation for the csharp-nancyfx-deprecated Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | csharp-nancyfx-deprecated | pass this to the generate command after -g | -| generator stability | DEPRECATED | | -| generator type | SERVER | | -| generator language | C# | | -| generator default templating engine | mustache | | -| helpTxt | Generates a C# NancyFX Web API server (deprecated). | | - -## 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 | -| ------ | ----------- | ------ | ------- | -|asyncServer|Set to true to enable the generation of async routes/endpoints.| |false| -|immutable|Enabled by default. If disabled generates model classes with setters| |true| -|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| || -|optionalProjectFile|Generate {PackageName}.csproj.| |true| -|packageContext|Optionally overrides the PackageContext which determines the namespace (namespace=packageName.packageContext). If not set, packageContext will default to basePath.| |null| -|packageGuid|The GUID that will be associated with the C# project| |null| -|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| -|packageVersion|C# package version.| |1.0.0| -|returnICollection|Return ICollection<T> instead of the concrete type.| |false| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sourceFolder|source folder for generated code| |src| -|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| -|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| -|writeModulePath|Enabled by default. If disabled, module paths will not mirror api base path| |true| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | -|array|List| -|list|List| -|map|Dictionary| - - -## LANGUAGE PRIMITIVES - -
      -
    • Boolean
    • -
    • Collection
    • -
    • DateTime
    • -
    • DateTime?
    • -
    • DateTimeOffset
    • -
    • DateTimeOffset?
    • -
    • Decimal
    • -
    • Dictionary
    • -
    • Double
    • -
    • Float
    • -
    • Guid
    • -
    • Guid?
    • -
    • ICollection
    • -
    • Int32
    • -
    • Int64
    • -
    • List
    • -
    • LocalDate?
    • -
    • LocalTime?
    • -
    • Object
    • -
    • String
    • -
    • System.IO.Stream
    • -
    • ZonedDateTime?
    • -
    • bool
    • -
    • bool?
    • -
    • byte[]
    • -
    • decimal
    • -
    • decimal?
    • -
    • double
    • -
    • double?
    • -
    • float
    • -
    • float?
    • -
    • int
    • -
    • int?
    • -
    • long
    • -
    • long?
    • -
    • string
    • -
    - -## RESERVED WORDS - -
      -
    • async
    • -
    • await
    • -
    • dynamic
    • -
    • var
    • -
    • 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 -|Array|✓|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 - -### 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 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✗|OAS2,OAS3 diff --git a/docs/migration-from-swagger-codegen.md b/docs/migration-from-swagger-codegen.md index f4bd36b6d334..85232ebb91b6 100644 --- a/docs/migration-from-swagger-codegen.md +++ b/docs/migration-from-swagger-codegen.md @@ -130,7 +130,6 @@ All languages of `swagger-codegen` have been migrated to `openapi-generator`, bu | `lumen` | `php-lumen` | | `slim` | `php-slim` | | `ze-ph` | `php-mezzio-ph` | -| `nancyfx` | `csharp-nancyfx` | We provide a temporary mapping in code for these old values. You'll receive a warning with instructions to migrate to the new names. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java deleted file mode 100644 index 280d26f7a16f..000000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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.languages; - -import com.google.common.base.Predicate; -import com.google.common.collect.*; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.Schema; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.URLPathUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.net.URL; -import java.util.*; -import java.util.Map.Entry; - -import static com.google.common.base.Strings.isNullOrEmpty; -import static java.util.Arrays.asList; -import static java.util.UUID.randomUUID; -import static org.apache.commons.lang3.StringUtils.capitalize; -import static org.openapitools.codegen.CodegenConstants.*; -import static org.openapitools.codegen.CodegenType.SERVER; -import static org.openapitools.codegen.utils.StringUtils.camelize; - -public class CSharpNancyFXServerCodegen extends AbstractCSharpCodegen { - private final Logger LOGGER = LoggerFactory.getLogger(CSharpNancyFXServerCodegen.class); - - private static final String API_NAMESPACE = "Modules"; - private static final String MODEL_NAMESPACE = "Models"; - private static final String IMMUTABLE_OPTION = "immutable"; - private static final String USE_BASE_PATH = "writeModulePath"; - private static final String PACKAGE_CONTEXT = "packageContext"; - private static final String ASYNC_SERVER = "asyncServer"; - - private static final Map> propertyToOpenAPITypeMapping = - createPropertyToOpenAPITypeMapping(); - - private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; - - private final Map dependencies = new HashMap<>(); - private final Set parentModels = new HashSet<>(); - private final Multimap childrenByParent = ArrayListMultimap.create(); - private final BiMap modelNameMapping = HashBiMap.create(); - - /** - * If set to true, we will generate c# async endpoints and service interfaces - */ - private boolean asyncServer = false; - - public CSharpNancyFXServerCodegen() { - super(); - - modifyFeatureSet(features -> features - .excludeDocumentationFeatures(DocumentationFeature.Readme) - .securityFeatures(EnumSet.noneOf(SecurityFeature.class)) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .includeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.DEPRECATED) - .build(); - - outputFolder = "generated-code" + File.separator + getName(); - apiTemplateFiles.put("api.mustache", ".cs"); - - // Early versions use no prefix for interfaces. Defaulting to I- common practice would break existing users. - setInterfacePrefix(""); - - // contextually reserved words - setReservedWordsLowerCase( - asList("var", "async", "await", "dynamic", "yield") - ); - - cliOptions.clear(); - - // CLI options - addOption(PACKAGE_NAME, "C# package name (convention: Title.Case).", packageName); - addOption(PACKAGE_VERSION, "C# package version.", packageVersion); - addOption(SOURCE_FOLDER, SOURCE_FOLDER_DESC, sourceFolder); - addOption(INTERFACE_PREFIX, INTERFACE_PREFIX_DESC, interfacePrefix); - addOption(OPTIONAL_PROJECT_GUID, OPTIONAL_PROJECT_GUID_DESC, null); - addOption(PACKAGE_CONTEXT, "Optionally overrides the PackageContext which determines the namespace (namespace=packageName.packageContext). If not set, packageContext will default to basePath.", null); - - // CLI Switches - addSwitch(SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_BY_REQUIRED_FLAG_DESC, sortParamsByRequiredFlag); - addSwitch(OPTIONAL_PROJECT_FILE, OPTIONAL_PROJECT_FILE_DESC, optionalProjectFileFlag); - addSwitch(USE_DATETIME_OFFSET, USE_DATETIME_OFFSET_DESC, useDateTimeOffsetFlag); - addSwitch(USE_COLLECTION, USE_COLLECTION_DESC, useCollection); - addSwitch(RETURN_ICOLLECTION, RETURN_ICOLLECTION_DESC, returnICollection); - addSwitch(IMMUTABLE_OPTION, "Enabled by default. If disabled generates model classes with setters", true); - addSwitch(USE_BASE_PATH, "Enabled by default. If disabled, module paths will not mirror api base path", true); - addSwitch(ASYNC_SERVER, "Set to true to enable the generation of async routes/endpoints.", this.asyncServer); - typeMapping.putAll(nodaTimeTypesMappings()); - languageSpecificPrimitives.addAll(nodaTimePrimitiveTypes()); - } - - @Override - public CodegenType getTag() { - return SERVER; - } - - @Override - public String getName() { - return "csharp-nancyfx-deprecated"; - } - - @Override - public String getHelp() { - return "Generates a C# NancyFX Web API server (deprecated)."; - } - - @Override - public void processOpts() { - super.processOpts(); - - apiPackage = isNullOrEmpty(packageName) ? API_NAMESPACE : packageName + "." + API_NAMESPACE; - modelPackage = isNullOrEmpty(packageName) ? MODEL_NAMESPACE : packageName + "." + MODEL_NAMESPACE; - - supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); - supportingFiles.add(new SupportingFile("parameters.mustache", sourceFile("Utils"), "Parameters.cs")); - supportingFiles.add(new SupportingFile("localDateConverter.mustache", sourceFile("Utils"), "LocalDateConverter.cs")); - supportingFiles.add(new SupportingFile("packages.config.mustache", sourceFolder(), "packages.config")); - supportingFiles.add(new SupportingFile("nuspec.mustache", sourceFolder(), packageName + ".nuspec")); - - if (optionalProjectFileFlag) { - supportingFiles.add(new SupportingFile("Solution.mustache", "", packageName + ".sln")); - supportingFiles.add(new SupportingFile("Project.mustache", sourceFolder(), packageName + ".csproj")); - } - - if (additionalProperties.containsKey(OPTIONAL_PROJECT_GUID)) { - setPackageGuid((String) additionalProperties.get(OPTIONAL_PROJECT_GUID)); - } - - if (additionalProperties.containsKey(ASYNC_SERVER)) { - setAsyncServer(convertPropertyToBooleanAndWriteBack(ASYNC_SERVER)); - } else { - additionalProperties.put(ASYNC_SERVER, this.asyncServer); - } - - additionalProperties.put("packageGuid", packageGuid); - - setupModelTemplate(); - processImportedMappings(); - appendDependencies(); - } - - private void setupModelTemplate() { - final Object immutableOption = additionalProperties.get(IMMUTABLE_OPTION); - if (immutableOption != null && "false".equalsIgnoreCase(immutableOption.toString())) { - LOGGER.info("Using mutable model template"); - modelTemplateFiles.put("modelMutable.mustache", ".cs"); - } else { - LOGGER.info("Using immutable model template"); - modelTemplateFiles.put("model.mustache", ".cs"); - } - } - - private void processImportedMappings() { - for (final Entry entry : ImmutableSet.copyOf(importMapping.entrySet())) { - final String model = entry.getKey(); - final String[] namespaceInfo = entry.getValue().split("\\s"); - final String[] namespace = (namespaceInfo.length > 0 ? namespaceInfo[0].trim() : "").split(":"); - final String namespaceName = namespace.length > 0 ? namespace[0].trim() : null; - final String modelClass = namespace.length > 1 ? namespace[1].trim() : null; - final String assembly = namespaceInfo.length > 1 ? namespaceInfo[1].trim() : null; - final String assemblyVersion = namespaceInfo.length > 2 ? namespaceInfo[2].trim() : null; - final String assemblyFramework = namespaceInfo.length > 3 ? namespaceInfo[3].trim() : "net45"; - - if (isNullOrEmpty(model) || isNullOrEmpty(namespaceName)) { - LOGGER.warn(String.format(Locale.ROOT, "Could not import: '%s' - invalid namespace: '%s'", model, entry.getValue())); - importMapping.remove(model); - } else { - LOGGER.info(String.format(Locale.ROOT, "Importing: '%s' from '%s' namespace.", model, namespaceName)); - importMapping.put(model, namespaceName); - } - if (!isNullOrEmpty(modelClass)) { - LOGGER.info(String.format(Locale.ROOT, "Mapping: '%s' class to '%s'", model, modelClass)); - modelNameMapping.put(model, modelClass); - } - if (assembly != null && assemblyVersion != null) { - LOGGER.info(String.format(Locale.ROOT, "Adding dependency: '%s', version: '%s', framework: '%s'", - assembly, assemblyVersion, assemblyVersion)); - dependencies.put(assembly, new DependencyInfo(assemblyVersion, assemblyFramework)); - } - } - } - - private void appendDependencies() { - final List> listOfDependencies = new ArrayList<>(); - for (final Entry dependency : dependencies.entrySet()) { - final Map dependencyInfo = new HashMap<>(); - dependencyInfo.put("dependency", dependency.getKey()); - dependencyInfo.put("dependencyVersion", dependency.getValue().version); - dependencyInfo.put("dependencyFramework", dependency.getValue().framework); - listOfDependencies.add(dependencyInfo); - } - additionalProperties.put("dependencies", listOfDependencies); - } - - private String sourceFolder() { - return "src" + File.separator + packageName; - } - - private String sourceFile(final String fileName) { - return sourceFolder() + File.separator + fileName; - } - - public void setPackageGuid(String packageGuid) { - this.packageGuid = packageGuid; - } - - public void setAsyncServer(boolean asyncServer) { - this.asyncServer = asyncServer; - } - - @Override - public String apiFileFolder() { - return outputFolder + File.separator + sourceFolder() + File.separator + API_NAMESPACE; - } - - @Override - public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder() + File.separator + MODEL_NAMESPACE; - } - - @Override - protected void processOperation(final CodegenOperation operation) { - super.processOperation(operation); - if (!isNullOrEmpty(operation.path) && operation.path.contains("?")) { - operation.path = operation.path.replace("?", "/"); - } - if (!isNullOrEmpty(operation.httpMethod)) { - operation.httpMethod = capitalize(operation.httpMethod.toLowerCase(Locale.ROOT)); - } - } - - @Override - public Map postProcessAllModels(final Map models) { - final Map processed = super.postProcessAllModels(models); - postProcessParentModels(models); - return processed; - } - - private void postProcessParentModels(final Map models) { - LOGGER.debug("Processing parents: {}", parentModels); - for (final String parent : parentModels) { - final CodegenModel parentModel = ModelUtils.getModelByName(parent, models); - if (parentModel != null) { - parentModel.hasChildren = true; - final Collection childrenModels = childrenByParent.get(parent); - for (final CodegenModel child : childrenModels) { - processParentPropertiesInChildModel(parentModel, child); - } - } - } - } - - private void processParentPropertiesInChildModel(final CodegenModel parent, final CodegenModel child) { - final Map childPropertiesByName = new HashMap<>(child.vars.size()); - for (final CodegenProperty property : child.vars) { - childPropertiesByName.put(property.name, property); - } - CodegenProperty previousParentVar = null; - for (final CodegenProperty property : parent.vars) { - final CodegenProperty duplicatedByParent = childPropertiesByName.get(property.name); - if (duplicatedByParent != null) { - LOGGER.info(String.format(Locale.ROOT, "Property: '%s' in '%s' model is inherited from '%s'", - property.name, child.classname, parent.classname)); - duplicatedByParent.isInherited = true; - final CodegenProperty parentVar = duplicatedByParent.clone(); - child.parentVars.add(parentVar); - previousParentVar = parentVar; - } - } - } - - @Override - public void postProcessModelProperty(final CodegenModel model, final CodegenProperty property) { - super.postProcessModelProperty(model, property); - if (!isNullOrEmpty(model.parent)) { - parentModels.add(model.parent); - if (!childrenByParent.containsEntry(model.parent, model)) { - childrenByParent.put(model.parent, model); - } - } - } - - @Override - public String toEnumVarName(final String name, final String datatype) { - if (name.length() == 0) { - return "Empty"; - } - - final String enumName = camelize( - sanitizeName(name) - .replaceFirst("^_", "") - .replaceFirst("_$", "") - .replaceAll("-", "_")); - final String result; - if (enumName.matches("\\d.*")) { - result = "_" + enumName; - } else { - result = enumName; - } - LOGGER.debug(String.format(Locale.ROOT, "toEnumVarName('%s', %s) = '%s'", name, datatype, enumName)); - return result; - } - - @Override - public String toApiName(final String name) { - final String apiName; - if (isNullOrEmpty(name)) { - apiName = "Default"; - } else { - apiName = capitalize(name); - } - LOGGER.debug(String.format(Locale.ROOT, "toApiName('%s') = '%s'", name, apiName)); - return apiName; - } - - @Override - public String toApiFilename(final String name) { - return super.toApiFilename(name) + "Module"; - } - - @Override - public String toModelImport(final String name) { - final String result; - if (modelNameMapping.containsValue(name)) { - final String modelName = modelNameMapping.inverse().get(name); - result = importMapping.containsKey(modelName) ? - importMapping.get(modelName) : super.toModelImport(name); - } else if (importMapping.containsKey(name)) { - result = importMapping.get(name); - } else { - result = null; - } - LOGGER.debug(String.format(Locale.ROOT, "toModelImport('%s') = '%s'", name, result)); - return result; - } - - @Override - public String toModelName(final String name) { - final String modelName = super.toModelName(name); - final String mappedModelName = modelNameMapping.get(modelName); - return isNullOrEmpty(mappedModelName) ? modelName : mappedModelName; - } - - @Override - public void preprocessOpenAPI(final OpenAPI openAPI) { - URL url = URLPathUtils.getServerURL(openAPI, serverVariableOverrides()); - String path = URLPathUtils.getPath(url, "/"); - final String packageContextOption = (String) additionalProperties.get(PACKAGE_CONTEXT); - additionalProperties.put("packageContext", packageContextOption == null ? sanitizeName(path) : packageContextOption); - final Object basePathOption = additionalProperties.get(USE_BASE_PATH); - additionalProperties.put("baseContext", basePathOption == null ? path : "/"); - } - - @Override - public String toEnumName(final CodegenProperty property) { - return sanitizeName(camelize(property.name)) + "Enum"; - } - - @Override - public String getSchemaType(final Schema property) { - for (Entry> entry : propertyToOpenAPITypeMapping.entrySet()) { - if (entry.getValue().apply(property)) { - return entry.getKey(); - } - } - return super.getSchemaType(property); - } - - private static Map> createPropertyToOpenAPITypeMapping() { - final ImmutableMap.Builder> mapping = ImmutableMap.builder(); - mapping.put("time", timeProperty()); - return mapping.build(); - } - - private static Predicate timeProperty() { - return new Predicate() { - @Override - public boolean apply(Schema property) { - return ModelUtils.isStringSchema(property) && "time".equalsIgnoreCase(property.getFormat()); - } - }; - } - - private static Map nodaTimeTypesMappings() { - return ImmutableMap.of( - "time", "LocalTime?", - "date", "LocalDate?", - "datetime", "ZonedDateTime?"); - } - - private static Set nodaTimePrimitiveTypes() { - return ImmutableSet.of("LocalTime?", "LocalDate?", "ZonedDateTime?"); - } - - private static class DependencyInfo { - private final String version; - private final String framework; - - private DependencyInfo(final String version, final String framework) { - this.version = version; - this.framework = framework; - } - } -} 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 daa315be174b..0b6c579e434f 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 @@ -22,7 +22,6 @@ org.openapitools.codegen.languages.CppUE4ClientCodegen org.openapitools.codegen.languages.CSharpClientCodegen org.openapitools.codegen.languages.CSharpNetCoreClientCodegen org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen -org.openapitools.codegen.languages.CSharpNancyFXServerCodegen org.openapitools.codegen.languages.CsharpNetcoreFunctionsServerCodegen org.openapitools.codegen.languages.DartClientCodegen org.openapitools.codegen.languages.DartDioClientCodegen diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache deleted file mode 100644 index 0b24e4c020ac..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache +++ /dev/null @@ -1,79 +0,0 @@ - - - - Debug - AnyCPU - {{packageGuid}} - Library - Properties - {{packageName}}.{{packageContext}} - {{packageName}} - {{^supportsUWP}} - v4.5 - {{/supportsUWP}} - {{#supportsUWP}} - UAP - 10.0.10240.0 - 10.0.10240.0 - 14 - {{/supportsUWP}} - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\{{packageName}}.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\{{packageName}}.XML - - - - ..\..\packages\Nancy.1.4.3\lib\net40\Nancy.dll - True - - - ..\..\packages\NodaTime.1.3.1\lib\net35-Client\NodaTime.dll - True - - - ..\..\packages\Sharpility.1.2.2\lib\net45\Sharpility.dll - True - - - ..\..\packages\System.Collections.Immutable.1.1.37\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - {{#dependencies}} - - ..\..\packages\{{dependency}}.{{dependencyVersion}}\lib\{{dependencyFramework}}\{{dependency}}.dll - True - - {{/dependencies}} - - - - - - - - - - - - - - - - - diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/Solution.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/Solution.mustache deleted file mode 100644 index 7f2d34e366ea..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/Solution.mustache +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -VisualStudioVersion = 12.0.0.0 -MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" -EndProject -Global -GlobalSection(SolutionConfigurationPlatforms) = preSolution -Debug|Any CPU = Debug|Any CPU -Release|Any CPU = Release|Any CPU -EndGlobalSection -GlobalSection(ProjectConfigurationPlatforms) = postSolution -{{packageGuid}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU -{{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU -{{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU -EndGlobalSection -GlobalSection(SolutionProperties) = preSolution -HideSolutionNode = FALSE -EndGlobalSection -EndGlobal \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache deleted file mode 100644 index c680c47a114d..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using {{packageName}}.{{packageContext}}.Models; -using {{packageName}}.{{packageContext}}.Utils; -using NodaTime;{{#asyncServer}} -using System.Threading.Tasks;{{/asyncServer}} - -namespace {{packageName}}.{{packageContext}}.Modules -{ {{#operations}}{{#operation}}{{#allParams}}{{#isEnum}} - {{>innerApiEnum}}{{/isEnum}}{{/allParams}}{{/operation}} - - /// - /// Module processing requests of {{classname}} domain. - /// - public sealed class {{classname}}Module : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public {{classname}}Module({{interfacePrefix}}{{classname}}Service service) : base("{{{baseContext}}}") - { {{#operation}} - {{httpMethod}}["{{{path}}}"{{#asyncServer}}, true{{/asyncServer}}] = {{#asyncServer}}async (parameters, ct){{/asyncServer}}{{^asyncServer}}parameters{{/asyncServer}} => - { - {{#allParams}}{{#isBodyParam}}var {{paramName}} = this.Bind<{{&dataType}}>();{{/isBodyParam}}{{^isBodyParam}}{{#isEnum}}var {{paramName}} = Parameters.ValueOf<{{>innerApiEnumName}}?>({{>innerParameterValueOfArgs}});{{/isEnum}}{{^isEnum}}var {{paramName}} = Parameters.ValueOf<{{&dataType}}>({{>innerParameterValueOfArgs}});{{/isEnum}}{{^-last}} - {{/-last}}{{/isBodyParam}}{{/allParams}}{{#allParams}}{{#required}} - Preconditions.IsNotNull({{paramName}}, "Required parameter: '{{paramName}}' is missing at '{{operationId}}'"); - {{/required}}{{/allParams}} - {{#returnType}}return {{/returnType}}{{#asyncServer}}await {{/asyncServer}}service.{{operationId}}(Context{{#allParams.0}}, {{/allParams.0}}{{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}{{#isArray}}.ToArray(){{/isArray}}{{/returnType}};{{^returnType}} - return new Response { ContentType = "{{produces.0.mediaType}}"};{{/returnType}} - }; -{{/operation}} - } - } - - /// - /// Service handling {{classname}} requests. - /// - public interface {{interfacePrefix}}{{classname}}Service - { - {{#operation}}/// - /// {{notes}} - /// - /// Context of request - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#asyncServer}}{{#returnType}}Task<{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}});{{^-last}} - - {{/-last}}{{/operation}} - } - - /// - /// Abstraction of {{classname}}Service. - /// - public abstract class Abstract{{classname}}Service: {{interfacePrefix}}{{classname}}Service - { - {{#operation}}{{#isDeprecated}}[Obsolete] - {{/isDeprecated}}public virtual {{#asyncServer}}{{#returnType}}Task<{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}}) - { - {{^asyncServer}}{{#returnType}}return {{/returnType}}{{/asyncServer}}{{#asyncServer}}return {{/asyncServer}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - }{{^-last}} - - {{/-last}}{{/operation}} - - {{#operation}}{{#isDeprecated}}[Obsolete] - {{/isDeprecated}}protected abstract {{#asyncServer}}{{#returnType}}Task<{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}({{>paramsList}});{{^-last}} - - {{/-last}}{{/operation}} - } - -{{/operations}} -} diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/gitignore b/modules/openapi-generator/src/main/resources/csharp-nancyfx/gitignore deleted file mode 100644 index 1ee53850b84c..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/gitignore +++ /dev/null @@ -1,362 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache deleted file mode 100644 index eb456ababf9e..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache +++ /dev/null @@ -1,10 +0,0 @@ -/// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - public enum {{>innerApiEnumName}} - { - {{#allowableValues}} -{{#values}} {{&.}}{{^isInteger}} = {{-index}}{{/isInteger}}{{^-last}}, {{/-last}} -{{/values}} - {{/allowableValues}} - }; diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnumName.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnumName.mustache deleted file mode 100644 index f2b90daa144f..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnumName.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#datatypeWithEnum}}{{operationId}}{{^isContainer}}{{.}}{{/isContainer}}{{#isContainer}}{{{items.datatypeWithEnum}}}{{/isContainer}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache deleted file mode 100644 index 3fd8e401dcf8..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache +++ /dev/null @@ -1 +0,0 @@ -public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} }; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerParameterType.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerParameterType.mustache deleted file mode 100644 index c9a8cb664495..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerParameterType.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isQueryParam}}ParameterType.Query{{/isQueryParam}}{{#isPathParam}}ParameterType.Path{{/isPathParam}}{{#isHeaderParam}}ParameterType.Header{{/isHeaderParam}}{{^isQueryParam}}{{^isPathParam}}{{^isHeaderParam}}ParameterType.Undefined{{/isHeaderParam}}{{/isPathParam}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerParameterValueOfArgs.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerParameterValueOfArgs.mustache deleted file mode 100644 index 2aca302eecf5..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerParameterValueOfArgs.mustache +++ /dev/null @@ -1 +0,0 @@ -parameters, Context.Request, "{{paramName}}", {{>innerParameterType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache deleted file mode 100644 index d709c22cc1b5..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache +++ /dev/null @@ -1,55 +0,0 @@ -using Nancy.Bootstrapper; -using Nancy.Json; -using NodaTime; -using NodaTime.Text; -using System; -using System.Collections.Generic; - -namespace {{packageName}}.{{packageContext}}.Utils -{ - /// - /// (De)serializes a to a string using - /// the RFC3339 - /// full-date format. - /// - public class LocalDateConverter : JavaScriptPrimitiveConverter, IApplicationStartup - { - public override IEnumerable SupportedTypes - { - get - { - yield return typeof(LocalDate); - yield return typeof(LocalDate?); - } - } - - public void Initialize(IPipelines pipelines) - { - JsonSettings.PrimitiveConverters.Add(new LocalDateConverter()); - } - - - public override object Serialize(object obj, JavaScriptSerializer serializer) - { - if (obj is LocalDate) - { - LocalDate localDate = (LocalDate)obj; - return LocalDatePattern.IsoPattern.Format(localDate); - } - return null; - } - - public override object Deserialize(object primitiveValue, Type type, JavaScriptSerializer serializer) - { - if ((type == typeof(LocalDate) || type == typeof(LocalDate?)) && primitiveValue is string) - { - try - { - return LocalDatePattern.IsoPattern.Parse(primitiveValue as string).GetValueOrThrow(); - } - catch { } - } - return null; - } - } -} diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/model.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/model.mustache deleted file mode 100644 index 7765632abdb4..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/model.mustache +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace {{packageName}}.{{packageContext}}.Models -{ -{{#models}} -{{#model}} -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}} -{{/model}} -{{/models}} -} diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache deleted file mode 100644 index 01c5ec32aa1f..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache +++ /dev/null @@ -1,15 +0,0 @@ - /// - /// {{description}}{{^description}}Defines {{{name}}}{{/description}} - /// - {{#description}} - /// {{.}} - {{/description}} - public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} - { - {{#allowableValues}}{{#enumVars}} - /// - /// Enum {{name}} - /// - {{name}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^isInteger}} = {{-index}}{{/isInteger}}{{^-last}}, - {{/-last}}{{/enumVars}}{{/allowableValues}} - } diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache deleted file mode 100644 index 8bb564a79713..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache +++ /dev/null @@ -1,156 +0,0 @@ - /// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{.}}}, {{/parent}} IEquatable<{{classname}}> - { {{#vars}}{{^isInherited}} - /// - /// {{description}}{{^description}}{{{name}}}{{/description}} - /// - public {{>nullableDataType}} {{name}} { get; private set; } -{{/isInherited}}{{/vars}} - - /// - /// Empty constructor required by some serializers. - /// Use {{classname}}.Builder() for instance creation instead. - /// - [Obsolete] - public {{classname}}(){{#parent}} : base({{/parent}}{{#parentVars}}null{{^-last}}, {{/-last}}{{/parentVars}}{{#parent}}){{/parent}} - { - } - - {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{classname}}({{#vars}}{{>nullableDataType}} {{name}}{{^-last}}, {{/-last}}{{/vars}}){{#parent}} : base({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} - { - {{#vars}}{{^isInherited}} - this.{{name}} = {{name}}; - {{/isInherited}}{{/vars}} - } - - /// - /// Returns builder of {{classname}}. - /// - /// {{classname}}Builder - public static {{#parent}}new {{/parent}}{{classname}}Builder Builder() - { - return new {{classname}}Builder(); - } - - /// - /// Returns {{classname}}Builder with properties set. - /// Use it to change properties. - /// - /// {{classname}}Builder - public {{#parent}}new {{/parent}}{{classname}}Builder With() - { - return Builder() - {{#vars}} - .{{name}}({{name}}){{^-last}} -{{/-last}}{{/vars}}; - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals({{classname}} other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for ({{classname}}. - /// - /// Compared ({{classname}} - /// Compared ({{classname}} - /// true if compared items are equals, false otherwise - public static bool operator == ({{classname}} left, {{classname}} right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for ({{classname}}. - /// - /// Compared ({{classname}} - /// Compared ({{classname}} - /// true if compared items are not equals, false otherwise - public static bool operator != ({{classname}} left, {{classname}} right) - { - return !Equals(left, right); - } - - /// - /// Builder of {{classname}}. - /// - public sealed class {{classname}}Builder - { - {{#vars}} - private {{>nullableDataType}} _{{name}}; - {{/vars}} - - internal {{classname}}Builder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - {{#vars}} - {{^required}} - {{#defaultValue}} - _{{name}} = {{{defaultValue}}}; - {{/defaultValue}} - {{/required}} - {{/vars}} - } - - {{#vars}} - /// - /// Sets value for {{classname}}.{{{name}}} property. - /// - /// {{description}}{{^description}}{{{name}}}{{/description}} - public {{classname}}Builder {{name}}({{>nullableDataType}} value) - { - _{{name}} = value; - return this; - } - - {{/vars}} - - /// - /// Builds instance of {{classname}}. - /// - /// {{classname}} - public {{classname}} Build() - { - Validate(); - return new {{classname}}( - {{#vars}} - {{name}}: _{{name}}{{^-last}},{{/-last}} - {{/vars}} - ); - } - - private void Validate() - { {{#vars}}{{#required}} - if (_{{name}} == null) - { - throw new ArgumentException("{{name}} is a required property for {{classname}} and cannot be null"); - } {{/required}}{{/vars}} - } - } - - {{#vars}}{{#isEnum}}{{^parent}} - {{>innerModelEnum}}{{/parent}}{{/isEnum}}{{#items.isEnum}} - {{#items}}{{>innerModelEnum}}{{/items}}{{/items.isEnum}}{{/vars}} - } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache deleted file mode 100644 index 3ab64e3b06e4..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; -{{#imports}}using {{import}}; -{{/imports}} - -{{#models}} -{{#model}} -namespace {{packageName}}.{{packageContext}}.Models -{ {{#vars}}{{#isEnum}}{{^parent}} - {{>innerModelEnum}}{{/parent}}{{/isEnum}}{{#items.isEnum}} - {{#items}}{{>innerModelEnum}}{{/items}}{{/items.isEnum}}{{/vars}} - -/// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{.}}}, {{/parent}} IEquatable<{{classname}}> - { {{#vars}}{{^isInherited}} - /// - /// {{description}}{{^description}}{{{name}}}{{/description}} - /// - public {{>nullableDataType}} {{name}} { get; set; } -{{/isInherited}}{{/vars}} - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals({{classname}} other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for ({{classname}}. - /// - /// Compared ({{classname}} - /// Compared ({{classname}} - /// true if compared items are equals, false otherwise - public static bool operator == ({{classname}} left, {{classname}} right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for ({{classname}}. - /// - /// Compared ({{classname}} - /// Compared ({{classname}} - /// true if compared items are not equals, false otherwise - public static bool operator != ({{classname}} left, {{classname}} right) - { - return !Equals(left, right); - } - } -{{/model}} -{{/models}} -} diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/nullableDataType.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/nullableDataType.mustache deleted file mode 100644 index c999b870119e..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/nullableDataType.mustache +++ /dev/null @@ -1 +0,0 @@ -{{&datatypeWithEnum}}{{#isEnum}}?{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache deleted file mode 100644 index 65912590d191..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache +++ /dev/null @@ -1,14 +0,0 @@ - - - - {{packageName}} - {{packageName}} - {{{version}}} - openapi-generator - openapi-generator - false - NancyFx {{packageName}} API{{#termsOfService}} - {{.}}{{/termsOfService}}{{#licenseUrl}} - {{.}}{{/licenseUrl}} - - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/packages.config.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/packages.config.mustache deleted file mode 100644 index c511c50acc8c..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/packages.config.mustache +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - {{#dependencies}} - - {{/dependencies}} - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/parameters.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/parameters.mustache deleted file mode 100644 index 61caaf25f567..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/parameters.mustache +++ /dev/null @@ -1,450 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using Nancy; -using NodaTime; -using NodaTime.Text; -using Sharpility.Base; -using Sharpility.Extensions; -using Sharpility.Util; - -namespace {{packageName}}.{{packageContext}}.Utils -{ - internal static class Parameters - { - private static readonly IDictionary> Parsers = CreateParsers(); - - internal static TValue ValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) - { - var valueType = typeof(TValue); - var valueUnderlyingType = Nullable.GetUnderlyingType(valueType); - var isNullable = default(TValue) == null; - string value = RawValueOf(parameters, request, name, parameterType); - Preconditions.Evaluate(!string.IsNullOrEmpty(value) || isNullable, string.Format("Required parameter: '{0}' is missing", name)); - if (value == null && isNullable) - { - return default(TValue); - } - if (valueType.IsEnum || (valueUnderlyingType != null && valueUnderlyingType.IsEnum)) - { - return EnumValueOf(name, value); - } - return ValueOf(parameters, name, value, valueType, request, parameterType); - } - - private static string RawValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) - { - try - { - switch (parameterType) - { - case ParameterType.Query: - string querValue = request.Query[name]; - return querValue; - case ParameterType.Path: - string pathValue = parameters[name]; - return pathValue; - case ParameterType.Header: - var headerValue = request.Headers[name]; - return headerValue != null ? string.Join(",", headerValue) : null; - } - } - catch (Exception e) - { - throw new InvalidOperationException(string.Format("Could not obtain value of '{0}' parameter", name), e); - } - throw new InvalidOperationException(string.Format("Parameter with type: {0} is not supported", parameterType)); - } - - private static TValue EnumValueOf(string name, string value) - { - var valueType = typeof(TValue); - var enumType = valueType.IsEnum ? valueType : Nullable.GetUnderlyingType(valueType); - Preconditions.IsNotNull(enumType, () => new InvalidOperationException( - string.Format("Could not parse parameter: '{0}' to enum. Type {1} is not enum", name, valueType))); - var values = Enum.GetValues(enumType); - foreach (var entry in values) - { - if (entry.ToString().EqualsIgnoreCases(value) - || ((int)entry).ToString().EqualsIgnoreCases(value)) - { - return (TValue)entry; - } - } - throw new ArgumentException(string.Format("Parameter: '{0}' value: '{1}' is not supported. Expected one of: {2}", - name, value, Strings.ToString(values))); - } - - private static TValue ValueOf(dynamic parameters, string name, string value, Type valueType, Request request, ParameterType parameterType) - { - var parser = Parsers.GetIfPresent(valueType); - if (parser != null) - { - return ParseValueUsing(name, value, valueType, parser); - } - if (parameterType == ParameterType.Path) - { - return DynamicValueOf(parameters, name); - } - if (parameterType == ParameterType.Query) - { - return DynamicValueOf(request.Query, name); - } - throw new InvalidOperationException(string.Format("Could not get value for {0} with type {1}", name, valueType)); - } - - private static TValue ParseValueUsing(string name, string value, Type valueType, Func parser) - { - var result = parser(Parameter.Of(name, value)); - try - { - return (TValue)result; - } - catch (InvalidCastException) - { - throw new InvalidOperationException( - string.Format("Could not parse parameter: '{0}' with value: '{1}'. " + - "Received: '{2}', expected: '{3}'.", - name, value, result.GetType(), valueType)); - } - } - - private static TValue DynamicValueOf(dynamic parameters, string name) - { - string value = parameters[name]; - try - { - TValue result = parameters[name]; - return result; - } - catch (InvalidCastException) - { - throw new InvalidOperationException(Strings.Format("Parameter: '{0}' value: '{1}' could not be parsed. " + - "Expected type: '{2}' is not supported", - name, value, typeof(TValue))); - } - catch (Exception e) - { - throw new InvalidOperationException(string.Format("Could not get '{0}' value of '{1}' type dynamically", - name, typeof(TValue)), e); - } - } - - private static IDictionary> CreateParsers() - { - var parsers = ImmutableDictionary.CreateBuilder>(); - parsers.Put(typeof(string), value => value.Value); - parsers.Put(typeof(bool), SafeParse(bool.Parse)); - parsers.Put(typeof(bool?), SafeParse(bool.Parse)); - parsers.Put(typeof(byte), SafeParse(byte.Parse)); - parsers.Put(typeof(sbyte?), SafeParse(sbyte.Parse)); - parsers.Put(typeof(short), SafeParse(short.Parse)); - parsers.Put(typeof(short?), SafeParse(short.Parse)); - parsers.Put(typeof(ushort), SafeParse(ushort.Parse)); - parsers.Put(typeof(ushort?), SafeParse(ushort.Parse)); - parsers.Put(typeof(int), SafeParse(int.Parse)); - parsers.Put(typeof(int?), SafeParse(int.Parse)); - parsers.Put(typeof(uint), SafeParse(uint.Parse)); - parsers.Put(typeof(uint?), SafeParse(uint.Parse)); - parsers.Put(typeof(long), SafeParse(long.Parse)); - parsers.Put(typeof(long?), SafeParse(long.Parse)); - parsers.Put(typeof(ulong), SafeParse(ulong.Parse)); - parsers.Put(typeof(ulong?), SafeParse(ulong.Parse)); - parsers.Put(typeof(float), SafeParse(float.Parse)); - parsers.Put(typeof(float?), SafeParse(float.Parse)); - parsers.Put(typeof(double), SafeParse(double.Parse)); - parsers.Put(typeof(double?), SafeParse(double.Parse)); - parsers.Put(typeof(decimal), SafeParse(decimal.Parse)); - parsers.Put(typeof(decimal?), SafeParse(decimal.Parse)); - parsers.Put(typeof(DateTime), SafeParse(DateTime.Parse)); - parsers.Put(typeof(DateTime?), SafeParse(DateTime.Parse)); - parsers.Put(typeof(TimeSpan), SafeParse(TimeSpan.Parse)); - parsers.Put(typeof(TimeSpan?), SafeParse(TimeSpan.Parse)); - parsers.Put(typeof(ZonedDateTime), SafeParse(ParseZonedDateTime)); - parsers.Put(typeof(ZonedDateTime?), SafeParse(ParseZonedDateTime)); - parsers.Put(typeof(LocalDate), SafeParse(ParseLocalDate)); - parsers.Put(typeof(LocalDate?), SafeParse(ParseLocalDate)); - parsers.Put(typeof(LocalTime), SafeParse(ParseLocalTime)); - parsers.Put(typeof(LocalTime?), SafeParse(ParseLocalTime)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(value => value)); - parsers.Put(typeof(ICollection), ImmutableListParse(value => value)); - parsers.Put(typeof(IList), ImmutableListParse(value => value)); - parsers.Put(typeof(List), ListParse(value => value)); - parsers.Put(typeof(ISet), ImmutableListParse(value => value)); - parsers.Put(typeof(HashSet), SetParse(value => value)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(List), NullableListParse(bool.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(bool.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(bool.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(List), ListParse(byte.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(byte.Parse)); - parsers.Put(typeof(HashSet), SetParse(byte.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(List), ListParse(sbyte.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(sbyte.Parse)); - parsers.Put(typeof(HashSet), SetParse(sbyte.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(short.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(short.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(short.Parse)); - parsers.Put(typeof(List), ListParse(short.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(short.Parse)); - parsers.Put(typeof(HashSet), SetParse(short.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(List), ListParse(ushort.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(ushort.Parse)); - parsers.Put(typeof(HashSet), SetParse(ushort.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(List), NullableListParse(int.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(int.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(int.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(List), ListParse(uint.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(uint.Parse)); - parsers.Put(typeof(HashSet), SetParse(uint.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(List), NullableListParse(long.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(long.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(long.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(List), ListParse(ulong.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(ulong.Parse)); - parsers.Put(typeof(HashSet), SetParse(ulong.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(List), NullableListParse(float.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(float.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(float.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(List), NullableListParse(double.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(double.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(double.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(List), NullableListParse(decimal.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(decimal.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(decimal.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(List), NullableListParse(DateTime.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(DateTime.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(DateTime.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(List), ListParse(TimeSpan.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(TimeSpan.Parse)); - parsers.Put(typeof(HashSet), SetParse(TimeSpan.Parse)); - - return parsers.ToImmutableDictionary(); - } - - private static Func SafeParse(Func parse) - { - return parameter => - { - try - { - return parse(parameter.Value); - } - catch (OverflowException) - { - throw ParameterOutOfRange(parameter, typeof(T)); - } - catch (FormatException) - { - throw InvalidParameterFormat(parameter, typeof(T)); - } - catch (Exception e) - { - throw new InvalidOperationException(Strings.Format("Unable to parse parameter: '{0}' with value: '{1}' to {2}", - parameter.Name, parameter.Value, typeof(T)), e); - } - }; - } - - private static Func NullableListParse(Func itemParser) where T: struct - { - return ListParse(it => it.ToNullable(itemParser)); - } - - private static Func ListParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return new List(); - } - return ParseCollection(parameter.Value, itemParser).ToList(); - }; - } - - private static Func NullableImmutableListParse(Func itemParser) where T: struct - { - return ImmutableListParse(it => it.ToNullable(itemParser)); - } - - private static Func ImmutableListParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return Lists.EmptyList(); - } - return ParseCollection(parameter.Value, itemParser).ToImmutableList(); - }; - } - - private static Func NullableSetParse(Func itemParser) where T: struct - { - return SetParse(it => it.ToNullable(itemParser)); - } - - private static Func SetParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return new HashSet(); - } - return ParseCollection(parameter.Value, itemParser).ToSet(); - }; - } - - private static Func NullableImmutableSetParse(Func itemParser) where T: struct - { - return ImmutableSetParse(it => it.ToNullable(itemParser)); - } - - private static Func ImmutableSetParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return Sets.EmptySet(); - } - return ParseCollection(parameter.Value, itemParser).ToImmutableHashSet(); - }; - } - - private static ZonedDateTime ParseZonedDateTime(string value) - { - var dateTime = DateTime.Parse(value); - return new ZonedDateTime(Instant.FromDateTimeUtc(dateTime.ToUniversalTime()), DateTimeZone.Utc); - } - - private static LocalDate ParseLocalDate(string value) - { - return LocalDatePattern.IsoPattern.Parse(value).Value; - } - - private static LocalTime ParseLocalTime(string value) - { - return LocalTimePattern.ExtendedIsoPattern.Parse(value).Value; - } - - private static ArgumentException ParameterOutOfRange(Parameter parameter, Type type) - { - return new ArgumentException(Strings.Format("Query: '{0}' value: '{1}' is out of range for: '{2}'", - parameter.Name, parameter.Value, type)); - } - - private static ArgumentException InvalidParameterFormat(Parameter parameter, Type type) - { - return new ArgumentException(Strings.Format("Query '{0}' value: '{1}' format is invalid for: '{2}'", - parameter.Name, parameter.Value, type)); - } - - private static IEnumerable ParseCollection(string value, Func itemParser) - { - var results = value.Split(new[] { ',' }, StringSplitOptions.None) - .Where(it => it != null) - .Select(it => it.Trim()) - .Select(itemParser); - return results; - } - - public static T? ToNullable(this string s, Func itemParser) where T : struct - { - T? result = new T?(); - try - { - if (!string.IsNullOrEmpty(s) && s.Trim().Length > 0) - { - result = itemParser(s); - } - } - catch (Exception e) - { - throw new InvalidOperationException(Strings.Format("Unable to parse value: '{0}' to nullable: '{1}'", s, typeof(T).ToString()), e); - } - return result; - } - - private class Parameter - { - internal string Name { get; private set; } - internal string Value { get; private set; } - - private Parameter(string name, string value) - { - Name = name; - Value = value; - } - - internal static Parameter Of(string name, string value) - { - return new Parameter(name, value); - } - } - } - - internal enum ParameterType - { - Undefined, - Query, - Path, - Header - } -} diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/paramsList.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/paramsList.mustache deleted file mode 100644 index 47e502dded96..000000000000 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/paramsList.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#allParams}}{{#isEnum}}{{>innerApiEnumName}}?{{/isEnum}}{{^isEnum}}{{&dataType}}{{/isEnum}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}} \ No newline at end of file diff --git a/website/i18n/en.json b/website/i18n/en.json index 6a41385357c8..af769f8ec269 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -115,10 +115,6 @@ "title": "Config Options for csharp-dotnet2", "sidebar_label": "csharp-dotnet2" }, - "generators/csharp-nancyfx": { - "title": "Config Options for csharp-nancyfx", - "sidebar_label": "csharp-nancyfx" - }, "generators/csharp-netcore": { "title": "Config Options for csharp-netcore", "sidebar_label": "csharp-netcore" From dbb63dc0777df6e01b97ca797fac401fd8b5604e Mon Sep 17 00:00:00 2001 From: Jason Finch Date: Mon, 7 Feb 2022 17:18:24 +1000 Subject: [PATCH 017/111] tidy [csharp-netcore]: Remove unused UrlEncode method. Possible breaking change: Method is public so upstream consumer *may* of used it, but library does not. (#11453) --- .../csharp-netcore/ClientUtils.mustache | 35 ------------------- .../Org.OpenAPITools/Client/ClientUtils.cs | 35 ------------------- .../Org.OpenAPITools/Client/ClientUtils.cs | 35 ------------------- .../Org.OpenAPITools/Client/ClientUtils.cs | 35 ------------------- .../Org.OpenAPITools/Client/ClientUtils.cs | 35 ------------------- .../Org.OpenAPITools/Client/ClientUtils.cs | 35 ------------------- .../Org.OpenAPITools/Client/ClientUtils.cs | 35 ------------------- .../Org.OpenAPITools/Client/ClientUtils.cs | 35 ------------------- .../Org.OpenAPITools/Client/ClientUtils.cs | 35 ------------------- 9 files changed, 315 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache index 776be1b052ff..59684096e76e 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache @@ -116,41 +116,6 @@ namespace {{packageName}}.Client return Convert.ToString(obj, CultureInfo.InvariantCulture); } - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Encode string in base64 format. /// diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs index 7544e0dfd802..f287a97a0225 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -120,41 +120,6 @@ public static string ParameterToString(object obj, IReadableConfiguration config return Convert.ToString(obj, CultureInfo.InvariantCulture); } - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Encode string in base64 format. /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ClientUtils.cs index cf1c59e1a867..dcc97c295e00 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -120,41 +120,6 @@ public static string ParameterToString(object obj, IReadableConfiguration config return Convert.ToString(obj, CultureInfo.InvariantCulture); } - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Encode string in base64 format. /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ClientUtils.cs index cf1c59e1a867..dcc97c295e00 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -120,41 +120,6 @@ public static string ParameterToString(object obj, IReadableConfiguration config return Convert.ToString(obj, CultureInfo.InvariantCulture); } - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Encode string in base64 format. /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ClientUtils.cs index cf1c59e1a867..dcc97c295e00 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -120,41 +120,6 @@ public static string ParameterToString(object obj, IReadableConfiguration config return Convert.ToString(obj, CultureInfo.InvariantCulture); } - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Encode string in base64 format. /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ClientUtils.cs index cf1c59e1a867..dcc97c295e00 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -120,41 +120,6 @@ public static string ParameterToString(object obj, IReadableConfiguration config return Convert.ToString(obj, CultureInfo.InvariantCulture); } - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Encode string in base64 format. /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs index cf1c59e1a867..dcc97c295e00 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -120,41 +120,6 @@ public static string ParameterToString(object obj, IReadableConfiguration config return Convert.ToString(obj, CultureInfo.InvariantCulture); } - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Encode string in base64 format. /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs index cf1c59e1a867..dcc97c295e00 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -120,41 +120,6 @@ public static string ParameterToString(object obj, IReadableConfiguration config return Convert.ToString(obj, CultureInfo.InvariantCulture); } - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Encode string in base64 format. /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ClientUtils.cs index 31c481622917..494b55f85260 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -120,41 +120,6 @@ public static string ParameterToString(object obj, IReadableConfiguration config return Convert.ToString(obj, CultureInfo.InvariantCulture); } - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - /// /// Encode string in base64 format. /// From 859c1969fd20cddc9e58a667433c2d60a267a92d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 7 Feb 2022 15:43:35 +0800 Subject: [PATCH 018/111] add numary as bronze sponsor of the project (#11539) --- README.md | 1 + website/src/dynamic/sponsors.yml | 5 +++++ website/static/img/companies/numary.png | Bin 0 -> 3680 bytes 3 files changed, 6 insertions(+) create mode 100644 website/static/img/companies/numary.png diff --git a/README.md b/README.md index c624cc075b4a..474628e05761 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa [](https://cpl.thalesgroup.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) [](https://www.apideck.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) [](https://www.pexa.com.au/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) +[](https://www.numary.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) #### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS and Checkly for sponsoring the API monitoring diff --git a/website/src/dynamic/sponsors.yml b/website/src/dynamic/sponsors.yml index 15f9a11509ba..fd32929f0955 100644 --- a/website/src/dynamic/sponsors.yml +++ b/website/src/dynamic/sponsors.yml @@ -33,3 +33,8 @@ image: "img/companies/pexa.png" infoLink: "https://www.pexa.com.au/?utm_source=openapi_generator&utm_medium=official_website&utm_campaign=sponsor" bronze: true +- + caption: "Numary" + image: "img/companies/numary.png" + infoLink: "https://www.numary.com/?utm_source=openapi_generator&utm_medium=official_website&utm_campaign=sponsor" + bronze: true diff --git a/website/static/img/companies/numary.png b/website/static/img/companies/numary.png new file mode 100644 index 0000000000000000000000000000000000000000..c0face7ea92c8d5d53abc2a12b469d3ff7275a19 GIT binary patch literal 3680 zcmZvfWn2?n7r-}0${08hN6AQq2M0ru#?d1rML?uRh@{jI6d8@QlF}t9NP~p2 z06?y5s3_ilmO-5JcQ#t%qWQk}u|f3eC0ZSdSKc^i_=u3o9Vb0&89sg)?e5Jm4oC4M zZID`~2>-TM+UrUaamk}MLT8G-$%5n3TzqCC93fETeML&Xs!h8Gs18EP^BK=Q(~(_6 zk=>S}jdSTE-`4Dq%AxurW5S;Qe0BoGWutB!le85of>R8x0)a8{(tv4SgQ!FL6k~`K z4lJjS#ewb8%X@Ui_aq87vc14@VeNC`|GS;Zox1dE2KnlQtQp_v_Q+V#FF`ODi zaC>=0;@&MipWRS&ru;S4L1zW&owqc0S1XvQ`7IKFa*#!xA8qPYAmqyfrHMPkoCgcw zg7oDZZ(6%?Dua*?B|sG5TifjZ;CVWSVQ(&}iC({9m3IP>!H{2gHaaRMR77F=U4V-~@P~ z9xX6XrkhVH{9to-J_VQGch(iP0>_%c;!|PO^m@3tn1{f{LrwEyp56jK+Xo1g{qGkA zf<~?;87w#VKPJ><`NGj1tJlopt&%C8^$*h!mQov^NIPywQ2Qx@wtfe;0(?6|l>*i& zo?S)_rgA@tyY;{_SjbI|MT(ONbTCvZ7%CvSS#ck>pV$GDZQBbo6gBzedpT?4lqDX>gyDMD!g zJ#BN%6j%j%dJ8wxJ>fllkYQba3+`AG0Q?%6Y@=PmW;j}T=r>{U+}f7Pw0(A{lxp0Q z1B+EVMY}An?!5`#9#5_PO@o$fI{gj@7wlSoE5Gdj zyC1`_F%r@Ga&i&gQauQ4Cf(sIDPc%GKApkP(P)|(jNnC9MW3{>$?>;tFv4OLofXy6 z;Z66;xQsi(ODwTM>{+eIUmcAJgu?w@;7AkBvKP|BkasF2TQHW`iHkm@soLDoJg*)U zvpyel_(!-)Eczp`Eu=_;#=I)(;2j&_&yoP=TYQ^<0B7efA?~y89g+oJ^~HU!To~l) zw;*tJ*OzU(utL{<&f9YJQiRf8tDJdPs^rGw(JcUp>M0H0V7`)yt@ewSltIknT5_E(*_kE%?}W*N?WE+nT0`;Qx0Y@$u3)?~%hk|cV06N8?iYNG|PKv{4u%p8GG+tKXb1uRC;prG4tLR zYJWbQ+NR{)HmATGeaYTG(Ku|E8)1lWonG2}Sj83!%I-s``u3l0soR8pb6tAqG7g@2 zMBFmOSck7nc((;kCMB3hvUb`Ir!>w=v()=2IK^6-XNH4_y{qz@0Xn^iaG*B`7(wh7_EyT#X-KAV>{*;!}X zGE@Z2DE^YTP{*=8G?0dSw$xv%AF9rwIq00KIh2?daL`)A%`P7>k6qPOJ_+*7E9oto zU6+6N_MbP(lQ?bGIPRyzsfis0H~)dwk*s~n{jz2S@!)cSjRu}a!^^_jQ;uo&{M#Af zbB-_EKU>AY4c7QAmai zg0|TgH=fS%{iuaRAXP~ai~ZdT4S#?3^m*WuV)`~HwmPHv6 zw;0=?DVMmeziYYkv4}jnch!3fU!V{ctMS~$LpKR`%;z3Iw4+iM{1y1x?+^YT(Y?BU ziE@y^*?Z$w*NGtKfig%qgc#^|ad>2xq6kI8ZTj|M6<=ZT$X{-E!DU63ST=q- zka%)4-M)ORs#g!LvE51I;ID{@I>DeGS<&Z-Qg??cebQk0D5|9ej^GI89gJes|5^l-(NDyu7bm z+lf0KJv!4dvDe44v4E(%!#kIlZ(x7Af0405y;xpXl^266Txs;xrw2#qHhb$clEr#f zoRr=a0JNMinY4m32Z7N5&SJd5WViz?9&midWZYzTm5CAr1!QwCM+)I_a55fJ{$#aQ zcCx`8UOGS5kE8q|+rAMlRr874sHG+WNOxo5XEG7`#<_t=5rjceuz$nShOQXNLt+fl z|0PQ8hGAFg1`zNY)cllSw5fDG{C;N?=K#TS7vv=dUlKdImSnC3-Ayq^!C>)BiKIb7 zdXl-?7-!228qd#bcmK!7>I!E6wB{0YFGD`zLWJD574#Zt)^+<3yxL%N z-_YM{L$R=2xbB)2suL!eBHdc}p*GW%nca5WA($+9Kh=R}pH# z2dCtP7NF+m4Lyn-MDRd3fW$;|l|)#4gu~OSy18;cJ?v$D8x${wBwzZo^*tv}*2qjk zl-yP`m)3C3=%BomvxJN6Yi=h#yZ9L56rdYNb^`%Mdl4c(HBFJrw%94hYXBElqCKkf zapZL7UPtx)oiI5dD*d;U8TpCKl0fzJ)99t>SYG>a41(Ql*yN2J(<$@Eg0XX|7*C!aPY9OI9_L zRce%72crG~X6kiwUamf64+aptbTFo)mx4i6BRj10HRbtfuJ!c`l&(f=+oL&B!#hNO z_lKlOtEngK&pSngm2P5&a+e_h%Wpx^_TkG709PpJdp328Q@xw=4&7j9@^?+}+$l!e z`=2g%!Fsr*DkW1*Fc5rg5~Lqy>is7D`!8b?^bw?5@7{Dy6i|KNq|? ze+A!@{kdnpn0a}R@==;oEijpgJL75}7naL=%W}(gvh$tg*0Z6s+O_bni-^Q;f53oe zT Date: Mon, 7 Feb 2022 20:19:19 +0800 Subject: [PATCH 019/111] update readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c624cc075b4a..9278a37b3e24 100644 --- a/README.md +++ b/README.md @@ -949,6 +949,7 @@ Here is a list of template creators: * C# ASP.NET Core 3.0: @A-Joshi * C# APS.NET Core 3.1: @phatcher * C# Azure functions: @Abrhm7786 + * C# NancyFX: @mstefaniuk * C++ (Qt5 QHttpEngine): @etherealjoy * C++ Pistache: @sebymiano * C++ Restbed: @stkrwork @@ -967,6 +968,7 @@ Here is a list of template creators: * Java Play Framework: @JFCote * Java PKMST: @anshu2185 @sanshuman @rkumar-pk @ninodpillai * Java Vert.x: @lwlee2608 + * Java Micronaut: @andriy-dmytruk * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard @@ -974,6 +976,7 @@ Here is a list of template creators: * Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * Kotlin (Spring Boot): @dr4ke616 * Kotlin (Vertx): @Wooyme + * Kotlin (JAX-RS): @anttileppa * NodeJS Express: @YishTish * PHP Laravel: @renepardon * PHP Lumen: @abcsun From 51800471fa86e8aa9c50a5a38c26896d94a0b0c1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 8 Feb 2022 00:05:44 +0800 Subject: [PATCH 020/111] [java][Okhttp] replace okhttp-gson with okhttp-gson-nextgen (#11538) * replace okhttp-gson with okhttp-gson-nextgen * add new files * update doc * clean up pom * update test * restore error handling in doc * add back changes * uncomment tests * update samples --- bin/configs/java-okhttp-gson-nextgen.yaml | 8 - bin/configs/java-okhttp-gson.yaml | 2 +- docs/generators/java.md | 2 +- .../codegen/languages/JavaClientCodegen.java | 10 +- .../okhttp-gson-nextgen/ApiCallback.mustache | 51 - .../okhttp-gson-nextgen/ApiClient.mustache | 1738 ------------ .../okhttp-gson-nextgen/ApiResponse.mustache | 75 - .../GzipRequestInterceptor.mustache | 74 - .../ProgressRequestBody.mustache | 62 - .../ProgressResponseBody.mustache | 59 - .../okhttp-gson-nextgen/README.mustache | 183 -- .../okhttp-gson-nextgen/api.mustache | 520 ---- .../okhttp-gson-nextgen/apiException.mustache | 199 -- .../okhttp-gson-nextgen/api_doc.mustache | 118 - .../okhttp-gson-nextgen/api_test.mustache | 56 - .../auth/ApiKeyAuth.mustache | 69 - .../auth/Authentication.mustache | 25 - .../auth/HttpBasicAuth.mustache | 46 - .../auth/HttpBearerAuth.mustache | 52 - .../okhttp-gson-nextgen/auth/OAuth.mustache | 31 - .../auth/OAuthOkHttpClient.mustache | 70 - .../auth/RetryingOAuth.mustache | 213 -- .../okhttp-gson-nextgen/build.gradle.mustache | 169 -- .../okhttp-gson-nextgen/build.sbt.mustache | 39 - .../okhttp-gson-nextgen/pom.mustache | 420 --- .../AbstractOpenApiSchema.mustache | 0 .../libraries/okhttp-gson/ApiClient.mustache | 4 + .../JSON.mustache | 0 .../anyof_model.mustache | 0 .../Java/libraries/okhttp-gson/api.mustache | 29 +- .../okhttp-gson/apiException.mustache | 40 + .../okhttp-gson/auth/RetryingOAuth.mustache | 43 +- .../model.mustache | 0 .../oneof_model.mustache | 0 .../pojo.mustache | 0 .../Java/libraries/okhttp-gson/pom.mustache | 10 + .../codegen/DefaultGeneratorTest.java | 2 +- .../codegen/java/JavaClientCodegenTest.java | 6 +- ...th-http-signature-okhttp-gson-nextgen.yaml | 2184 --------------- pom.xml | 1 - .../.openapi-generator/FILES | 1 + .../others/java/okhttp-gson-streaming/pom.xml | 10 + .../org/openapitools/client/ApiClient.java | 4 + .../org/openapitools/client/ApiException.java | 40 + .../java/org/openapitools/client/JSON.java | 65 +- .../org/openapitools/client/api/PingApi.java | 12 +- .../client/model/AbstractOpenApiSchema.java | 149 + .../openapitools/client/model/SomeObj.java | 107 + .../.openapi-generator/FILES | 1 + .../okhttp-gson-dynamicOperations/pom.xml | 10 + .../org/openapitools/client/ApiClient.java | 4 + .../org/openapitools/client/ApiException.java | 40 + .../java/org/openapitools/client/JSON.java | 140 +- .../client/api/AnotherFakeApi.java | 12 +- .../org/openapitools/client/api/FakeApi.java | 65 +- .../client/api/FakeClassnameTags123Api.java | 12 +- .../org/openapitools/client/api/PetApi.java | 60 +- .../org/openapitools/client/api/StoreApi.java | 35 +- .../org/openapitools/client/api/UserApi.java | 29 +- .../client/auth/RetryingOAuth.java | 43 +- .../model/AdditionalPropertiesAnyType.java | 103 + .../model/AdditionalPropertiesArray.java | 103 + .../model/AdditionalPropertiesBoolean.java | 103 + .../model/AdditionalPropertiesClass.java | 113 + .../model/AdditionalPropertiesInteger.java | 103 + .../model/AdditionalPropertiesNumber.java | 103 + .../model/AdditionalPropertiesObject.java | 103 + .../model/AdditionalPropertiesString.java | 103 + .../org/openapitools/client/model/Animal.java | 85 + .../model/ArrayOfArrayOfNumberOnly.java | 103 + .../client/model/ArrayOfNumberOnly.java | 103 + .../openapitools/client/model/ArrayTest.java | 105 + .../org/openapitools/client/model/BigCat.java | 114 + .../client/model/BigCatAllOf.java | 103 + .../client/model/Capitalization.java | 108 + .../org/openapitools/client/model/Cat.java | 80 + .../openapitools/client/model/CatAllOf.java | 103 + .../openapitools/client/model/Category.java | 112 + .../openapitools/client/model/ClassModel.java | 103 + .../org/openapitools/client/model/Client.java | 103 + .../org/openapitools/client/model/Dog.java | 113 + .../openapitools/client/model/DogAllOf.java | 103 + .../openapitools/client/model/EnumArrays.java | 104 + .../openapitools/client/model/EnumTest.java | 115 + .../client/model/FileSchemaTestClass.java | 115 + .../openapitools/client/model/FormatTest.java | 127 + .../client/model/HasOnlyReadOnly.java | 104 + .../openapitools/client/model/MapTest.java | 106 + ...ropertiesAndAdditionalPropertiesClass.java | 105 + .../client/model/Model200Response.java | 104 + .../client/model/ModelApiResponse.java | 105 + .../openapitools/client/model/ModelFile.java | 103 + .../openapitools/client/model/ModelList.java | 103 + .../client/model/ModelReturn.java | 103 + .../org/openapitools/client/model/Name.java | 114 + .../openapitools/client/model/NumberOnly.java | 103 + .../org/openapitools/client/model/Order.java | 108 + .../client/model/OuterComposite.java | 105 + .../org/openapitools/client/model/Pet.java | 128 + .../client/model/ReadOnlyFirst.java | 104 + .../client/model/SpecialModelName.java | 103 + .../org/openapitools/client/model/Tag.java | 104 + .../client/model/TypeHolderDefault.java | 119 + .../client/model/TypeHolderExample.java | 121 + .../org/openapitools/client/model/User.java | 110 + .../openapitools/client/model/XmlItem.java | 131 + .../java/okhttp-gson-nextgen/.gitignore | 21 - .../.openapi-generator-ignore | 14 - .../.openapi-generator/FILES | 199 -- .../.openapi-generator/VERSION | 1 - .../java/okhttp-gson-nextgen/.travis.yml | 22 - .../java/okhttp-gson-nextgen/README.md | 278 -- .../java/okhttp-gson-nextgen/api/openapi.yaml | 2468 ----------------- .../java/okhttp-gson-nextgen/build.gradle | 153 - .../java/okhttp-gson-nextgen/build.sbt | 27 - .../docs/AdditionalPropertiesAnyType.md | 13 - .../docs/AdditionalPropertiesArray.md | 13 - .../docs/AdditionalPropertiesBoolean.md | 13 - .../docs/AdditionalPropertiesClass.md | 20 - .../docs/AdditionalPropertiesInteger.md | 13 - .../docs/AdditionalPropertiesNumber.md | 13 - .../docs/AdditionalPropertiesObject.md | 13 - .../docs/AdditionalPropertiesString.md | 13 - .../java/okhttp-gson-nextgen/docs/Animal.md | 14 - .../okhttp-gson-nextgen/docs/AnimalFarm.md | 9 - .../docs/AnotherFakeApi.md | 67 - .../docs/ArrayOfArrayOfNumberOnly.md | 13 - .../docs/ArrayOfNumberOnly.md | 13 - .../okhttp-gson-nextgen/docs/ArrayTest.md | 15 - .../java/okhttp-gson-nextgen/docs/BigCat.md | 24 - .../okhttp-gson-nextgen/docs/BigCatAllOf.md | 24 - .../docs/Capitalization.md | 18 - .../java/okhttp-gson-nextgen/docs/Cat.md | 13 - .../java/okhttp-gson-nextgen/docs/CatAllOf.md | 13 - .../java/okhttp-gson-nextgen/docs/Category.md | 14 - .../okhttp-gson-nextgen/docs/ClassModel.md | 14 - .../java/okhttp-gson-nextgen/docs/Client.md | 13 - .../java/okhttp-gson-nextgen/docs/Dog.md | 13 - .../java/okhttp-gson-nextgen/docs/DogAllOf.md | 13 - .../okhttp-gson-nextgen/docs/EnumArrays.md | 32 - .../okhttp-gson-nextgen/docs/EnumClass.md | 15 - .../java/okhttp-gson-nextgen/docs/EnumTest.md | 68 - .../java/okhttp-gson-nextgen/docs/FakeApi.md | 888 ------ .../docs/FakeClassnameTags123Api.md | 74 - .../docs/FileSchemaTestClass.md | 14 - .../okhttp-gson-nextgen/docs/FormatTest.md | 28 - .../docs/HasOnlyReadOnly.md | 14 - .../java/okhttp-gson-nextgen/docs/MapTest.md | 25 - ...dPropertiesAndAdditionalPropertiesClass.md | 15 - .../docs/Model200Response.md | 15 - .../docs/ModelApiResponse.md | 15 - .../okhttp-gson-nextgen/docs/ModelFile.md | 14 - .../okhttp-gson-nextgen/docs/ModelList.md | 13 - .../okhttp-gson-nextgen/docs/ModelReturn.md | 14 - .../java/okhttp-gson-nextgen/docs/Name.md | 17 - .../okhttp-gson-nextgen/docs/NumberOnly.md | 13 - .../java/okhttp-gson-nextgen/docs/Order.md | 28 - .../docs/OuterComposite.md | 15 - .../okhttp-gson-nextgen/docs/OuterEnum.md | 15 - .../java/okhttp-gson-nextgen/docs/Pet.md | 28 - .../java/okhttp-gson-nextgen/docs/PetApi.md | 594 ---- .../okhttp-gson-nextgen/docs/ReadOnlyFirst.md | 14 - .../docs/SpecialModelName.md | 14 - .../java/okhttp-gson-nextgen/docs/StoreApi.md | 248 -- .../docs/StringBooleanMap.md | 9 - .../java/okhttp-gson-nextgen/docs/Tag.md | 14 - .../docs/TypeHolderDefault.md | 17 - .../docs/TypeHolderExample.md | 18 - .../java/okhttp-gson-nextgen/docs/User.md | 24 - .../java/okhttp-gson-nextgen/docs/UserApi.md | 469 ---- .../java/okhttp-gson-nextgen/docs/XmlItem.md | 41 - .../java/okhttp-gson-nextgen/git_push.sh | 57 - .../okhttp-gson-nextgen/gradle.properties | 6 - .../gradle/wrapper/gradle-wrapper.jar | Bin 59536 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 - .../petstore/java/okhttp-gson-nextgen/gradlew | 234 -- .../java/okhttp-gson-nextgen/gradlew.bat | 89 - .../java/okhttp-gson-nextgen/hello.txt | 1 - .../petstore/java/okhttp-gson-nextgen/pom.xml | 349 --- .../java/okhttp-gson-nextgen/settings.gradle | 1 - .../src/main/AndroidManifest.xml | 3 - .../org/openapitools/client/ApiCallback.java | 62 - .../org/openapitools/client/ApiClient.java | 1553 ----------- .../org/openapitools/client/ApiException.java | 194 -- .../org/openapitools/client/ApiResponse.java | 76 - .../openapitools/client/Configuration.java | 39 - .../client/GzipRequestInterceptor.java | 85 - .../java/org/openapitools/client/JSON.java | 594 ---- .../java/org/openapitools/client/Pair.java | 57 - .../client/ProgressRequestBody.java | 73 - .../client/ProgressResponseBody.java | 70 - .../client/ServerConfiguration.java | 58 - .../openapitools/client/ServerVariable.java | 23 - .../org/openapitools/client/StringUtil.java | 83 - .../client/api/AnotherFakeApi.java | 177 -- .../org/openapitools/client/api/FakeApi.java | 1998 ------------- .../client/api/FakeClassnameTags123Api.java | 177 -- .../org/openapitools/client/api/PetApi.java | 1198 -------- .../org/openapitools/client/api/StoreApi.java | 533 ---- .../org/openapitools/client/api/UserApi.java | 991 ------- .../openapitools/client/auth/ApiKeyAuth.java | 80 - .../client/auth/Authentication.java | 36 - .../client/auth/HttpBasicAuth.java | 57 - .../client/auth/HttpBearerAuth.java | 63 - .../org/openapitools/client/auth/OAuth.java | 42 - .../openapitools/client/auth/OAuthFlow.java | 25 - .../client/auth/OAuthOkHttpClient.java | 68 - .../client/auth/RetryingOAuth.java | 211 -- .../model/AdditionalPropertiesClass.java | 460 --- .../org/openapitools/client/model/Animal.java | 214 -- .../model/ArrayOfArrayOfNumberOnly.java | 214 -- .../client/model/ArrayOfNumberOnly.java | 214 -- .../openapitools/client/model/ArrayTest.java | 290 -- .../client/model/Capitalization.java | 353 --- .../org/openapitools/client/model/Cat.java | 218 -- .../openapitools/client/model/CatAllOf.java | 203 -- .../openapitools/client/model/Category.java | 241 -- .../openapitools/client/model/ClassModel.java | 204 -- .../org/openapitools/client/model/Client.java | 203 -- .../org/openapitools/client/model/Dog.java | 218 -- .../openapitools/client/model/DogAllOf.java | 203 -- .../openapitools/client/model/EnumArrays.java | 337 --- .../openapitools/client/model/EnumClass.java | 75 - .../openapitools/client/model/EnumTest.java | 706 ----- .../openapitools/client/model/FormatTest.java | 679 ----- .../client/model/HasOnlyReadOnly.java | 225 -- .../openapitools/client/model/MapTest.java | 375 --- ...ropertiesAndAdditionalPropertiesClass.java | 277 -- .../client/model/Model200Response.java | 234 -- .../client/model/ModelApiResponse.java | 263 -- .../openapitools/client/model/ModelFile.java | 204 -- .../openapitools/client/model/ModelList.java | 203 -- .../client/model/ModelReturn.java | 204 -- .../org/openapitools/client/model/Name.java | 294 -- .../openapitools/client/model/NumberOnly.java | 204 -- .../org/openapitools/client/model/Order.java | 403 --- .../client/model/OuterComposite.java | 264 -- .../openapitools/client/model/OuterEnum.java | 75 - .../org/openapitools/client/model/Pet.java | 439 --- .../client/model/ReadOnlyFirst.java | 232 -- .../client/model/SpecialModelName.java | 233 -- .../org/openapitools/client/model/Tag.java | 233 -- .../org/openapitools/client/model/User.java | 545 ---- .../openapitools/client/ApiClientTest.java | 345 --- .../client/ConfigurationTest.java | 15 - .../org/openapitools/client/JSONTest.java | 450 --- .../openapitools/client/StringUtilTest.java | 33 - .../client/api/AnotherFakeApiTest.java | 41 - .../openapitools/client/api/FakeApiTest.java | 286 -- .../api/FakeClassnameTags123ApiTest.java | 41 - .../openapitools/client/api/PetApiTest.java | 575 ---- .../openapitools/client/api/StoreApiTest.java | 86 - .../openapitools/client/api/UserApiTest.java | 138 - .../client/auth/ApiKeyAuthTest.java | 119 - .../client/auth/HttpBasicAuthTest.java | 65 - .../client/auth/RetryingOAuthTest.java | 123 - .../model/AdditionalPropertiesClassTest.java | 111 - .../openapitools/client/model/AnimalTest.java | 61 - .../client/model/ArrayOfNumberOnlyTest.java | 54 - .../client/model/ArrayTestTest.java | 70 - .../client/model/CapitalizationTest.java | 91 - .../client/model/CatAllOfTest.java | 51 - .../openapitools/client/model/CatTest.java | 69 - .../client/model/CategoryTest.java | 59 - .../client/model/ClassModelTest.java | 51 - .../openapitools/client/model/ClientTest.java | 51 - .../client/model/DogAllOfTest.java | 51 - .../openapitools/client/model/DogTest.java | 69 - .../client/model/EnumArraysTest.java | 61 - .../client/model/EnumClassTest.java | 34 - .../client/model/EnumTestTest.java | 120 - .../client/model/FormatTestTest.java | 176 -- .../client/model/HasOnlyReadOnlyTest.java | 59 - .../client/model/MapTestTest.java | 78 - ...rtiesAndAdditionalPropertiesClassTest.java | 73 - .../client/model/Model200ResponseTest.java | 59 - .../client/model/ModelApiResponseTest.java | 67 - .../client/model/ModelFileTest.java | 51 - .../client/model/ModelListTest.java | 51 - .../client/model/ModelReturnTest.java | 51 - .../openapitools/client/model/NameTest.java | 75 - .../client/model/NumberOnlyTest.java | 52 - .../openapitools/client/model/OrderTest.java | 92 - .../client/model/OuterCompositeTest.java | 68 - .../client/model/OuterEnumTest.java | 34 - .../client/model/ReadOnlyFirstTest.java | 59 - .../client/model/SpecialModelNameTest.java | 59 - .../openapitools/client/model/TagTest.java | 59 - .../openapitools/client/model/UserTest.java | 140 - .../.openapi-generator/FILES | 1 + .../java/okhttp-gson-parcelableModel/pom.xml | 10 + .../org/openapitools/client/ApiClient.java | 4 + .../org/openapitools/client/ApiException.java | 40 + .../java/org/openapitools/client/JSON.java | 140 +- .../client/api/AnotherFakeApi.java | 12 +- .../org/openapitools/client/api/FakeApi.java | 65 +- .../client/api/FakeClassnameTags123Api.java | 12 +- .../org/openapitools/client/api/PetApi.java | 60 +- .../org/openapitools/client/api/StoreApi.java | 35 +- .../org/openapitools/client/api/UserApi.java | 29 +- .../client/auth/RetryingOAuth.java | 43 +- .../model/AdditionalPropertiesAnyType.java | 103 + .../model/AdditionalPropertiesArray.java | 103 + .../model/AdditionalPropertiesBoolean.java | 103 + .../model/AdditionalPropertiesClass.java | 113 + .../model/AdditionalPropertiesInteger.java | 103 + .../model/AdditionalPropertiesNumber.java | 103 + .../model/AdditionalPropertiesObject.java | 103 + .../model/AdditionalPropertiesString.java | 103 + .../org/openapitools/client/model/Animal.java | 85 + .../model/ArrayOfArrayOfNumberOnly.java | 103 + .../client/model/ArrayOfNumberOnly.java | 103 + .../openapitools/client/model/ArrayTest.java | 105 + .../org/openapitools/client/model/BigCat.java | 114 + .../client/model/BigCatAllOf.java | 103 + .../client/model/Capitalization.java | 108 + .../org/openapitools/client/model/Cat.java | 80 + .../openapitools/client/model/CatAllOf.java | 103 + .../openapitools/client/model/Category.java | 112 + .../openapitools/client/model/ClassModel.java | 103 + .../org/openapitools/client/model/Client.java | 103 + .../org/openapitools/client/model/Dog.java | 113 + .../openapitools/client/model/DogAllOf.java | 103 + .../openapitools/client/model/EnumArrays.java | 104 + .../openapitools/client/model/EnumTest.java | 115 + .../client/model/FileSchemaTestClass.java | 115 + .../openapitools/client/model/FormatTest.java | 127 + .../client/model/HasOnlyReadOnly.java | 104 + .../openapitools/client/model/MapTest.java | 106 + ...ropertiesAndAdditionalPropertiesClass.java | 105 + .../client/model/Model200Response.java | 104 + .../client/model/ModelApiResponse.java | 105 + .../openapitools/client/model/ModelFile.java | 103 + .../openapitools/client/model/ModelList.java | 103 + .../client/model/ModelReturn.java | 103 + .../org/openapitools/client/model/Name.java | 114 + .../openapitools/client/model/NumberOnly.java | 103 + .../org/openapitools/client/model/Order.java | 108 + .../client/model/OuterComposite.java | 105 + .../org/openapitools/client/model/Pet.java | 128 + .../client/model/ReadOnlyFirst.java | 104 + .../client/model/SpecialModelName.java | 103 + .../org/openapitools/client/model/Tag.java | 104 + .../client/model/TypeHolderDefault.java | 119 + .../client/model/TypeHolderExample.java | 121 + .../org/openapitools/client/model/User.java | 110 + .../openapitools/client/model/XmlItem.java | 131 + .../java/okhttp-gson/.openapi-generator/FILES | 105 +- .../petstore/java/okhttp-gson/README.md | 69 +- .../java/okhttp-gson/api/openapi.yaml | 1390 ++++++---- .../docs/AdditionalPropertiesClass.md | 17 +- .../java/okhttp-gson/docs/AnotherFakeApi.md | 8 +- .../docs/Apple.md | 0 .../docs/AppleReq.md | 0 .../docs/Banana.md | 0 .../docs/BananaReq.md | 0 .../docs/BasquePig.md | 0 .../docs/ChildCat.md | 0 .../docs/ChildCatAllOf.md | 0 .../docs/ComplexQuadrilateral.md | 0 .../docs/DanishPig.md | 0 .../docs/DefaultApi.md | 6 +- .../docs/DeprecatedObject.md | 0 .../docs/Drawing.md | 0 .../java/okhttp-gson/docs/EnumTest.md | 13 + .../docs/EquilateralTriangle.md | 0 .../petstore/java/okhttp-gson/docs/FakeApi.md | 153 +- .../docs/FakeClassnameTags123Api.md | 8 +- .../docs/Foo.md | 0 .../java/okhttp-gson/docs/FormatTest.md | 4 +- .../docs/Fruit.md | 0 .../docs/FruitReq.md | 0 .../docs/GmFruit.md | 0 .../docs/GrandparentAnimal.md | 0 .../docs/HealthCheckResult.md | 0 .../docs/InlineResponseDefault.md | 0 .../docs/IsoscelesTriangle.md | 0 .../docs/Mammal.md | 0 .../docs/NullableClass.md | 0 .../docs/NullableShape.md | 0 .../docs/ObjectWithDeprecatedFields.md | 0 .../docs/OuterEnumDefaultValue.md | 0 .../docs/OuterEnumInteger.md | 0 .../docs/OuterEnumIntegerDefaultValue.md | 0 .../docs/ParentPet.md | 0 .../petstore/java/okhttp-gson/docs/Pet.md | 2 +- .../petstore/java/okhttp-gson/docs/PetApi.md | 41 +- .../docs/PetWithRequiredTags.md | 0 .../docs/Pig.md | 0 .../docs/Pineapple.md | 0 .../docs/Quadrilateral.md | 0 .../docs/QuadrilateralInterface.md | 0 .../docs/ScaleneTriangle.md | 0 .../docs/Shape.md | 0 .../docs/ShapeInterface.md | 0 .../docs/ShapeOrNull.md | 0 .../docs/SimpleQuadrilateral.md | 0 .../java/okhttp-gson/docs/SpecialModelName.md | 1 + .../java/okhttp-gson/docs/StoreApi.md | 10 +- .../docs/Triangle.md | 0 .../docs/TriangleInterface.md | 0 .../petstore/java/okhttp-gson/docs/User.md | 4 + .../petstore/java/okhttp-gson/docs/UserApi.md | 40 +- .../docs/Whale.md | 0 .../docs/Zebra.md | 0 .../client/petstore/java/okhttp-gson/pom.xml | 10 + .../org/openapitools/client/ApiClient.java | 23 + .../org/openapitools/client/ApiException.java | 40 + .../java/org/openapitools/client/JSON.java | 251 +- .../client/api/AnotherFakeApi.java | 46 +- .../openapitools/client/api/DefaultApi.java | 33 +- .../org/openapitools/client/api/FakeApi.java | 464 ++-- .../client/api/FakeClassnameTags123Api.java | 46 +- .../org/openapitools/client/api/PetApi.java | 171 +- .../org/openapitools/client/api/StoreApi.java | 71 +- .../org/openapitools/client/api/UserApi.java | 173 +- .../client/auth/RetryingOAuth.java | 43 +- .../client/model/AbstractOpenApiSchema.java | 0 .../model/AdditionalPropertiesAnyType.java | 104 - .../model/AdditionalPropertiesArray.java | 105 - .../model/AdditionalPropertiesBoolean.java | 104 - .../model/AdditionalPropertiesClass.java | 482 ++-- .../model/AdditionalPropertiesInteger.java | 104 - .../model/AdditionalPropertiesNumber.java | 105 - .../model/AdditionalPropertiesObject.java | 104 - .../model/AdditionalPropertiesString.java | 104 - .../org/openapitools/client/model/Animal.java | 83 +- .../org/openapitools/client/model/Apple.java | 0 .../openapitools/client/model/AppleReq.java | 0 .../model/ArrayOfArrayOfNumberOnly.java | 103 + .../client/model/ArrayOfNumberOnly.java | 103 + .../openapitools/client/model/ArrayTest.java | 105 + .../org/openapitools/client/model/Banana.java | 0 .../openapitools/client/model/BananaReq.java | 0 .../openapitools/client/model/BasquePig.java | 0 .../org/openapitools/client/model/BigCat.java | 156 -- .../client/model/BigCatAllOf.java | 151 - .../client/model/Capitalization.java | 108 + .../org/openapitools/client/model/Cat.java | 114 +- .../openapitools/client/model/CatAllOf.java | 103 + .../openapitools/client/model/Category.java | 112 + .../client/model/ChildCatAllOf.java | 0 .../openapitools/client/model/ClassModel.java | 103 + .../org/openapitools/client/model/Client.java | 103 + .../client/model/ComplexQuadrilateral.java | 0 .../openapitools/client/model/DanishPig.java | 0 .../client/model/DeprecatedObject.java | 0 .../org/openapitools/client/model/Dog.java | 113 + .../openapitools/client/model/DogAllOf.java | 103 + .../openapitools/client/model/Drawing.java | 0 .../openapitools/client/model/EnumArrays.java | 104 + .../openapitools/client/model/EnumTest.java | 301 +- .../client/model/EquilateralTriangle.java | 0 .../client/model/FileSchemaTestClass.java | 115 + .../org/openapitools/client/model/Foo.java | 0 .../openapitools/client/model/FormatTest.java | 221 +- .../org/openapitools/client/model/Fruit.java | 0 .../openapitools/client/model/FruitReq.java | 0 .../openapitools/client/model/GmFruit.java | 0 .../client/model/GrandparentAnimal.java | 0 .../client/model/HasOnlyReadOnly.java | 104 + .../client/model/HealthCheckResult.java | 0 .../client/model/InlineResponseDefault.java | 0 .../client/model/IsoscelesTriangle.java | 0 .../org/openapitools/client/model/Mammal.java | 0 .../openapitools/client/model/MapTest.java | 106 + ...ropertiesAndAdditionalPropertiesClass.java | 105 + .../client/model/Model200Response.java | 104 + .../client/model/ModelApiResponse.java | 105 + .../openapitools/client/model/ModelFile.java | 103 + .../openapitools/client/model/ModelList.java | 103 + .../client/model/ModelReturn.java | 103 + .../org/openapitools/client/model/Name.java | 114 + .../client/model/NullableClass.java | 0 .../client/model/NullableShape.java | 0 .../openapitools/client/model/NumberOnly.java | 103 + .../model/ObjectWithDeprecatedFields.java | 0 .../org/openapitools/client/model/Order.java | 110 +- .../client/model/OuterComposite.java | 105 + .../openapitools/client/model/OuterEnum.java | 2 +- .../client/model/OuterEnumDefaultValue.java | 0 .../client/model/OuterEnumInteger.java | 0 .../model/OuterEnumIntegerDefaultValue.java | 0 .../openapitools/client/model/ParentPet.java | 0 .../org/openapitools/client/model/Pet.java | 138 +- .../client/model/PetWithRequiredTags.java | 0 .../org/openapitools/client/model/Pig.java | 0 .../openapitools/client/model/Pineapple.java | 0 .../client/model/Quadrilateral.java | 0 .../client/model/QuadrilateralInterface.java | 0 .../client/model/ReadOnlyFirst.java | 104 + .../client/model/ScaleneTriangle.java | 0 .../org/openapitools/client/model/Shape.java | 0 .../client/model/ShapeInterface.java | 0 .../client/model/ShapeOrNull.java | 0 .../client/model/SimpleQuadrilateral.java | 0 .../client/model/SpecialModelName.java | 139 +- .../org/openapitools/client/model/Tag.java | 104 + .../openapitools/client/model/Triangle.java | 0 .../client/model/TriangleInterface.java | 0 .../client/model/TypeHolderDefault.java | 224 -- .../client/model/TypeHolderExample.java | 253 -- .../org/openapitools/client/model/User.java | 246 +- .../org/openapitools/client/model/Whale.java | 0 .../openapitools/client/model/XmlItem.java | 987 ------- .../org/openapitools/client/model/Zebra.java | 0 .../openapitools/client/ApiClientTest.java | 18 - .../org/openapitools/client/JSONTest.java | 232 ++ .../client/api/DefaultApiTest.java | 0 .../openapitools/client/api/FakeApiTest.java | 228 +- .../openapitools/client/api/PetApiTest.java | 11 +- .../AdditionalPropertiesAnyTypeTest.java | 33 - .../model/AdditionalPropertiesArrayTest.java | 33 - .../AdditionalPropertiesBooleanTest.java | 33 - .../model/AdditionalPropertiesClassTest.java | 86 +- .../AdditionalPropertiesIntegerTest.java | 33 - .../model/AdditionalPropertiesNumberTest.java | 33 - .../model/AdditionalPropertiesObjectTest.java | 33 - .../model/AdditionalPropertiesStringTest.java | 33 - .../openapitools/client/model/AnimalTest.java | 36 +- .../client/model/AppleReqTest.java | 0 .../openapitools/client/model/AppleTest.java | 0 .../model/ArrayOfArrayOfNumberOnlyTest.java | 55 - .../client/model/ArrayOfNumberOnlyTest.java | 33 +- .../client/model/ArrayTestTest.java | 41 +- .../client/model/BananaReqTest.java | 0 .../openapitools/client/model/BananaTest.java | 0 .../client/model/BasquePigTest.java | 0 .../client/model/BigCatAllOfTest.java | 33 - .../openapitools/client/model/BigCatTest.java | 51 - .../client/model/CapitalizationTest.java | 50 +- .../client/model/CatAllOfTest.java | 30 +- .../openapitools/client/model/CatTest.java | 40 +- .../client/model/CategoryTest.java | 34 +- .../client/model/ClassModelTest.java | 30 +- .../openapitools/client/model/ClientTest.java | 30 +- .../model/ComplexQuadrilateralTest.java | 0 .../client/model/DanishPigTest.java | 0 .../client/model/DeprecatedObjectTest.java | 0 .../client/model/DogAllOfTest.java | 30 +- .../openapitools/client/model/DogTest.java | 40 +- .../client/model/DrawingTest.java | 0 .../client/model/EnumArraysTest.java | 36 +- .../client/model/EnumClassTest.java | 19 +- .../client/model/EnumTestTest.java | 83 +- .../client/model/EnumValueTest.java | 55 - .../client/model/EquilateralTriangleTest.java | 0 .../client/model/FileSchemaTestClassTest.java | 41 +- .../openapitools/client/model/FooTest.java | 0 .../client/model/FormatTestTest.java | 107 +- .../client/model/FruitReqTest.java | 0 .../openapitools/client/model/FruitTest.java | 0 .../client/model/GmFruitTest.java | 0 .../client/model/GrandparentAnimalTest.java | 0 .../client/model/HasOnlyReadOnlyTest.java | 34 +- .../client/model/HealthCheckResultTest.java | 0 .../model/InlineResponseDefaultTest.java | 0 .../client/model/IsoscelesTriangleTest.java | 0 .../openapitools/client/model/MammalTest.java | 0 .../client/model/MapTestTest.java | 45 +- ...rtiesAndAdditionalPropertiesClassTest.java | 47 +- .../client/model/Model200ResponseTest.java | 34 +- .../client/model/ModelApiResponseTest.java | 38 +- .../client/model/ModelReturnTest.java | 30 +- .../openapitools/client/model/NameTest.java | 42 +- .../client/model/NullableClassTest.java | 0 .../client/model/NullableShapeTest.java | 0 .../client/model/NumberOnlyTest.java | 31 +- .../model/ObjectWithDeprecatedFieldsTest.java | 0 .../openapitools/client/model/OrderTest.java | 51 +- .../client/model/OuterCompositeTest.java | 39 +- .../model/OuterEnumDefaultValueTest.java | 0 .../OuterEnumIntegerDefaultValueTest.java | 0 .../client/model/OuterEnumIntegerTest.java | 0 .../client/model/OuterEnumTest.java | 19 +- .../client/model/ParentPetTest.java | 0 .../openapitools/client/model/PetTest.java | 72 - .../client/model/PetWithRequiredTagsTest.java | 0 .../openapitools/client/model/PigTest.java | 0 .../client/model/PineappleTest.java | 0 .../model/QuadrilateralInterfaceTest.java | 0 .../client/model/QuadrilateralTest.java | 0 .../client/model/ReadOnlyFirstTest.java | 34 +- .../client/model/ScaleneTriangleTest.java | 0 .../client/model/ShapeInterfaceTest.java | 0 .../client/model/ShapeOrNullTest.java | 0 .../openapitools/client/model/ShapeTest.java | 0 .../client/model/SimpleQuadrilateralTest.java | 0 .../client/model/SpecialModelNameTest.java | 38 +- .../openapitools/client/model/TagTest.java | 34 +- .../client/model/TriangleInterfaceTest.java | 0 .../client/model/TriangleTest.java | 0 .../client/model/TypeHolderDefaultTest.java | 57 - .../client/model/TypeHolderExampleTest.java | 57 - .../openapitools/client/model/UserTest.java | 91 +- .../openapitools/client/model/WhaleTest.java | 0 .../client/model/XmlItemTest.java | 201 -- .../openapitools/client/model/ZebraTest.java | 0 598 files changed, 18720 insertions(+), 42239 deletions(-) delete mode 100644 bin/configs/java-okhttp-gson-nextgen.yaml delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiCallback.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiResponse.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/README.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_test.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/Authentication.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuth.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.gradle.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache delete mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache rename modules/openapi-generator/src/main/resources/Java/libraries/{okhttp-gson-nextgen => okhttp-gson}/AbstractOpenApiSchema.mustache (100%) rename modules/openapi-generator/src/main/resources/Java/libraries/{okhttp-gson-nextgen => okhttp-gson}/JSON.mustache (100%) rename modules/openapi-generator/src/main/resources/Java/libraries/{okhttp-gson-nextgen => okhttp-gson}/anyof_model.mustache (100%) rename modules/openapi-generator/src/main/resources/Java/libraries/{okhttp-gson-nextgen => okhttp-gson}/model.mustache (100%) rename modules/openapi-generator/src/main/resources/Java/libraries/{okhttp-gson-nextgen => okhttp-gson}/oneof_model.mustache (100%) rename modules/openapi-generator/src/main/resources/Java/libraries/{okhttp-gson-nextgen => okhttp-gson}/pojo.mustache (100%) delete mode 100644 modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml create mode 100644 samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.gitignore delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator-ignore delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.travis.yml delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/README.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/build.gradle delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/build.sbt delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesAnyType.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesArray.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesBoolean.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesInteger.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesNumber.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesObject.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesString.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Animal.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayTest.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCat.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCatAllOf.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Capitalization.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Cat.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/CatAllOf.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Category.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ClassModel.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Client.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Dog.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/DogAllOf.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumArrays.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumClass.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumTest.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FormatTest.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/MapTest.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Model200Response.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelApiResponse.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelReturn.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Name.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/NumberOnly.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Order.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterComposite.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnum.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Pet.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Tag.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/User.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/XmlItem.md delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/git_push.sh delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradle.properties delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.jar delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.properties delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradlew delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradlew.bat delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/hello.txt delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/pom.xml delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/settings.gradle delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/AndroidManifest.xml delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiCallback.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiResponse.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Configuration.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/GzipRequestInterceptor.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Pair.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressRequestBody.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressResponseBody.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerConfiguration.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerVariable.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/StringUtil.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/Authentication.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuth.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthFlow.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumClass.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnum.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ApiClientTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ConfigurationTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/StringUtilTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/PetApiTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/StoreApiTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/UserApiTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AnimalTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayTestTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CapitalizationTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatAllOfTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CategoryTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClassModelTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClientTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogAllOfTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumArraysTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumClassTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumTestTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FormatTestTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MapTestTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/Model200ResponseTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelReturnTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NameTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NumberOnlyTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OrderTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterCompositeTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TagTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/UserTest.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Apple.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/AppleReq.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Banana.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/BananaReq.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/BasquePig.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/ChildCat.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/ChildCatAllOf.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/ComplexQuadrilateral.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/DanishPig.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/DefaultApi.md (82%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/DeprecatedObject.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Drawing.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/EquilateralTriangle.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Foo.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Fruit.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/FruitReq.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/GmFruit.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/GrandparentAnimal.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/HealthCheckResult.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/InlineResponseDefault.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/IsoscelesTriangle.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Mammal.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/NullableClass.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/NullableShape.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/ObjectWithDeprecatedFields.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/OuterEnumDefaultValue.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/OuterEnumInteger.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/OuterEnumIntegerDefaultValue.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/ParentPet.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/PetWithRequiredTags.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Pig.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Pineapple.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Quadrilateral.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/QuadrilateralInterface.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/ScaleneTriangle.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Shape.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/ShapeInterface.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/ShapeOrNull.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/SimpleQuadrilateral.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Triangle.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/TriangleInterface.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Whale.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/docs/Zebra.md (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/api/DefaultApi.java (85%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Apple.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/AppleReq.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Banana.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/BananaReq.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/BasquePig.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/ChildCatAllOf.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/DanishPig.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/DeprecatedObject.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Drawing.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/EquilateralTriangle.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Foo.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Fruit.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/FruitReq.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/GmFruit.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/GrandparentAnimal.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/HealthCheckResult.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/InlineResponseDefault.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Mammal.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/NullableClass.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/NullableShape.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/OuterEnumInteger.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/ParentPet.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Pig.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Pineapple.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Quadrilateral.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/ScaleneTriangle.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Shape.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/ShapeInterface.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/ShapeOrNull.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Triangle.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/TriangleInterface.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Whale.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/main/java/org/openapitools/client/model/Zebra.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/api/DefaultApiTest.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/AppleReqTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/AppleTest.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/BananaReqTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/BananaTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/BasquePigTest.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/DanishPigTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/DrawingTest.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/FooTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/FruitReqTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/FruitTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/GmFruitTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/MammalTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/NullableClassTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/NullableShapeTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/ParentPetTest.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/PigTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/PineappleTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/QuadrilateralTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/ShapeTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java (100%) rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/TriangleTest.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/WhaleTest.java (100%) delete mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/XmlItemTest.java rename samples/client/petstore/java/{okhttp-gson-nextgen => okhttp-gson}/src/test/java/org/openapitools/client/model/ZebraTest.java (100%) diff --git a/bin/configs/java-okhttp-gson-nextgen.yaml b/bin/configs/java-okhttp-gson-nextgen.yaml deleted file mode 100644 index 724edc9d9083..000000000000 --- a/bin/configs/java-okhttp-gson-nextgen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -generatorName: java -outputDir: samples/client/petstore/java/okhttp-gson-nextgen -library: okhttp-gson-nextgen -inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml -templateDir: modules/openapi-generator/src/main/resources/Java -additionalProperties: - artifactId: petstore-okhttp-gson-nextgen - hideGenerationTimestamp: "true" diff --git a/bin/configs/java-okhttp-gson.yaml b/bin/configs/java-okhttp-gson.yaml index c71c509aa28e..88b87d75c4aa 100644 --- a/bin/configs/java-okhttp-gson.yaml +++ b/bin/configs/java-okhttp-gson.yaml @@ -1,7 +1,7 @@ generatorName: java outputDir: samples/client/petstore/java/okhttp-gson library: okhttp-gson -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: petstore-okhttp-gson diff --git a/docs/generators/java.md b/docs/generators/java.md index c33081e2df54..811277beed73 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -51,7 +51,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |invokerPackage|root package for generated code| |org.openapitools.client| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **okhttp-gson-nextgen**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release. IMPORTANT: this may subject to breaking changes without further notice.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 1.x. JSON processing: JSON-B
    **apache-httpclient**
    HTTP client: Apache httpclient 4.x
    |okhttp-gson| +|library|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 1.x. JSON processing: JSON-B
    **apache-httpclient**
    HTTP client: Apache httpclient 4.x
    |okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 8476e2d88b7b..b090cbd62253 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -76,7 +76,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String JERSEY2 = "jersey2"; public static final String NATIVE = "native"; public static final String OKHTTP_GSON = "okhttp-gson"; - public static final String OKHTTP_GSON_NEXTGEN = "okhttp-gson-nextgen"; public static final String RESTEASY = "resteasy"; public static final String RESTTEMPLATE = "resttemplate"; public static final String WEBCLIENT = "webclient"; @@ -165,7 +164,6 @@ public JavaClientCodegen() { supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x."); supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); - supportedLibraries.put(OKHTTP_GSON_NEXTGEN, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release. IMPORTANT: this may subject to breaking changes without further notice."); supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)"); supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x"); supportedLibraries.put(WEBCLIENT, "HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x"); @@ -421,7 +419,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java")); supportingFiles.add(new SupportingFile("EncodingUtils.mustache", invokerFolder, "EncodingUtils.java")); supportingFiles.add(new SupportingFile("auth/DefaultApi20Impl.mustache", authFolder, "DefaultApi20Impl.java")); - } else if (OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary()) || OKHTTP_GSON_NEXTGEN.equals(getLibrary())) { + } else if (OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) { // the "okhttp-gson" library template requires "ApiCallback.mustache" for async call supportingFiles.add(new SupportingFile("ApiCallback.mustache", invokerFolder, "ApiCallback.java")); supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java")); @@ -429,7 +427,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("ProgressRequestBody.mustache", invokerFolder, "ProgressRequestBody.java")); supportingFiles.add(new SupportingFile("ProgressResponseBody.mustache", invokerFolder, "ProgressResponseBody.java")); supportingFiles.add(new SupportingFile("GzipRequestInterceptor.mustache", invokerFolder, "GzipRequestInterceptor.java")); - if (OKHTTP_GSON_NEXTGEN.equals(getLibrary())) { + if (OKHTTP_GSON.equals(getLibrary())) { supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", modelsFolder, "AbstractOpenApiSchema.java")); } @@ -589,7 +587,7 @@ public void processOpts() { // has OAuth defined if (ProcessUtils.hasOAuthMethods(openAPI)) { // for okhttp-gson (default), check to see if OAuth is defined and included OAuth-related files accordingly - if ((OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) || OKHTTP_GSON_NEXTGEN.equals(getLibrary())) { + if ((OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary()))) { supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); supportingFiles.add(new SupportingFile("auth/RetryingOAuth.mustache", authFolder, "RetryingOAuth.java")); } @@ -890,7 +888,7 @@ public Map postProcessModels(Map objs) { CodegenModel cm = (CodegenModel) mo.get("model"); cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList()); - if (JERSEY2.equals(getLibrary()) || NATIVE.equals(getLibrary()) || OKHTTP_GSON_NEXTGEN.equals(getLibrary())) { + if (JERSEY2.equals(getLibrary()) || NATIVE.equals(getLibrary()) || OKHTTP_GSON.equals(getLibrary())) { cm.getVendorExtensions().put("x-implements", new ArrayList()); if (cm.oneOf != null && !cm.oneOf.isEmpty() && cm.oneOf.contains("ModelNull")) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiCallback.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiCallback.mustache deleted file mode 100644 index 53b6a7b8e34f..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiCallback.mustache +++ /dev/null @@ -1,51 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.io.IOException; - -import java.util.Map; -import java.util.List; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure(ApiException e, int statusCode, Map> responseHeaders); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess(T result, int statusCode, Map> responseHeaders); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API download processing. - * - * @param bytesRead bytes Read - * @param contentLength content length of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache deleted file mode 100644 index ce5e4bf48486..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache +++ /dev/null @@ -1,1738 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -{{#dynamicOperations}} -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.Parameter.StyleEnum; -import io.swagger.v3.parser.OpenAPIV3Parser; -{{/dynamicOperations}} -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; -{{#joda}} -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -{{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} -{{#hasOAuthMethods}} -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.common.message.types.GrantType; -{{/hasOAuthMethods}} - -import javax.net.ssl.*; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URI; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -{{#java8}} -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -{{/java8}} -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import {{invokerPackage}}.auth.Authentication; -import {{invokerPackage}}.auth.HttpBasicAuth; -import {{invokerPackage}}.auth.HttpBearerAuth; -import {{invokerPackage}}.auth.ApiKeyAuth; -{{#hasOAuthMethods}} -import {{invokerPackage}}.auth.OAuth; -import {{invokerPackage}}.auth.RetryingOAuth; -import {{invokerPackage}}.auth.OAuthFlow; -{{/hasOAuthMethods}} - -/** - *

    ApiClient class.

    - */ -public class ApiClient { - - private String basePath = "{{{basePath}}}"; - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - {{#dynamicOperations}} - private Map operationLookupMap = new HashMap<>(); - - {{/dynamicOperations}} - /** - * Basic constructor for ApiClient - */ - public ApiClient() { - init(); - initHttpClient(); - - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Basic constructor with custom OkHttpClient - * - * @param client a {@link okhttp3.OkHttpClient} object - */ - public ApiClient(OkHttpClient client) { - init(); - - httpClient = client; - - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - {{#hasOAuthMethods}} - {{#oauthMethods}} - {{#-first}} - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID - * - * @param clientId client ID - */ - public ApiClient(String clientId) { - this(clientId, null, null); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters - * - * @param clientId client ID - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, Map parameters) { - this(clientId, null, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters - * - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, String clientSecret, Map parameters) { - this(null, clientId, clientSecret, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters - * - * @param basePath base path - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { - init(); - if (basePath != null) { - this.basePath = basePath; - } - -{{#hasOAuthMethods}} - String tokenUrl = "{{tokenUrl}}"; - if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { - URI uri = URI.create(getBasePath()); - tokenUrl = uri.getScheme() + ":" + - (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") + - tokenUrl; - if (!URI.create(tokenUrl).isAbsolute()) { - throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); - } - } - RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, clientSecret, parameters); - authentications.put( - "{{name}}", - retryingOAuth - ); - initHttpClient(Collections.singletonList(retryingOAuth)); -{{/hasOAuthMethods}} - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}} - - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - {{/-first}} - {{/oauthMethods}} - {{/hasOAuthMethods}} - private void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - private void initHttpClient(List interceptors) { - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { - builder.addInterceptor(interceptor); - } - {{#useGzipFeature}} - // Enable gzip request compression - builder.addInterceptor(new GzipRequestInterceptor()); - {{/useGzipFeature}} - - httpClient = builder.build(); - } - - private void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); - - authentications = new HashMap(); - {{#dynamicOperations}} - - OpenAPI openAPI = new OpenAPIV3Parser().read("openapi/openapi.yaml"); - createOperationLookupMap(openAPI); - {{/dynamicOperations}} - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g {{{basePath}}} - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Set HTTP client, which must never be null. - * - * @param newHttpClient An instance of OkHttpClient - * @return Api Client - * @throws java.lang.NullPointerException when newHttpClient is null - */ - public ApiClient setHttpClient(OkHttpClient newHttpClient) { - this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); - return this; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - *

    Getter for the field keyManagers.

    - * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - *

    Getter for the field dateFormat.

    - * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - *

    Setter for the field dateFormat.

    - * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); - return this; - } - - /** - *

    Set SqlDateFormat.

    - * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); - return this; - } - - {{#joda}} - public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setDateTimeFormat(dateFormat); - return this; - } - - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - {{/joda}} - {{#jsr310}} - /** - *

    Set OffsetDateTimeFormat.

    - * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - *

    Set LocalDateFormat.

    - * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - {{/jsr310}} - /** - *

    Set LenientOnJson.

    - * - * @param lenientOnJson a boolean - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - {{#hasHttpBearerMethods}} - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - {{/hasHttpBearerMethods}} - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - {{#hasOAuthMethods}} - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - {{/hasOAuthMethods}} - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - {{#hasOAuthMethods}} - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * - * @return Token request builder - */ - public TokenRequestBuilder getTokenEndPoint() { - for (Authentication apiAuth : authentications.values()) { - if (apiAuth instanceof RetryingOAuth) { - RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; - return retryingOAuth.getTokenRequestBuilder(); - } - } - return null; - } - {{/hasOAuthMethods}} - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - {{^dynamicOperations}} - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - {{/dynamicOperations}} - {{#dynamicOperations}} - public List parameterToPairs(Parameter param, Collection value) { - List params = new ArrayList(); - - // preconditions - if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) { - return params; - } - - // create the params based on the collection format - if (StyleEnum.FORM.equals(param.getStyle()) && Boolean.TRUE.equals(param.getExplode())) { - for (Object item : value) { - params.add(new Pair(param.getName(), escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if (StyleEnum.SPACEDELIMITED.equals(param.getStyle())) { - delimiter = escapeString(" "); - } else if (StyleEnum.PIPEDELIMITED.equals(param.getStyle())) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(param.getName(), sb.substring(delimiter.length()))); - - return params; - } - {{/dynamicOperations}} - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(String collectionFormat, Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * returns null. If it matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if (contentTypes[0].equals("*/*")) { - return "application/json"; - } - - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; - } catch (IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws org.openapitools.client.ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = json.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - {{#supportStreaming}} - /** - *

    Execute stream.

    - * - * @param call a {@link okhttp3.Call} object - * @param returnType a {@link java.lang.reflect.Type} object - * @return a {@link java.io.InputStream} object - * @throws org.openapitools.client.ApiException if any. - */ - public InputStream executeStream(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - if (!response.isSuccessful()) { - throw new ApiException(response.code(), response.message()); - } - if (response.body() == null) { - return null; - } - return response.body().byteStream(); - } catch (IOException e) { - throw new ApiException(e); - } - } - - {{/supportStreaming}} - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - - final String url = buildUrl(path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - String contentType = headerParams.get("Content-Type"); - - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { - for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - for (Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws org.openapitools.client.ApiException If fails to update the parameters - */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RuntimeException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. - */ - private Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } - - /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; - } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); - } else { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); - } - trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { - try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); - } - } - {{#dynamicOperations}} - - public ApiClient createOperationLookupMap(OpenAPI openAPI) { - operationLookupMap = new HashMap<>(); - for (Map.Entry pathItemEntry : openAPI.getPaths().entrySet()) { - String path = pathItemEntry.getKey(); - PathItem pathItem = pathItemEntry.getValue(); - addOperationLookupEntry(path, "GET", pathItem.getGet()); - addOperationLookupEntry(path, "PUT", pathItem.getPut()); - addOperationLookupEntry(path, "POST", pathItem.getPost()); - addOperationLookupEntry(path, "DELETE", pathItem.getDelete()); - addOperationLookupEntry(path, "OPTIONS", pathItem.getOptions()); - addOperationLookupEntry(path, "HEAD", pathItem.getHead()); - addOperationLookupEntry(path, "PATCH", pathItem.getPatch()); - addOperationLookupEntry(path, "TRACE", pathItem.getTrace()); - } - return this; - } - - private void addOperationLookupEntry(String path, String method, Operation operation) { - if ( operation != null && operation.getOperationId() != null) { - operationLookupMap.put( - operation.getOperationId(), - new ApiOperation(path, method, operation)); - } - } - - public Map getOperationLookupMap() { - return operationLookupMap; - } - - public String fillParametersFromOperation( - Operation operation, - Map paramMap, - String path, - List queryParams, - List collectionQueryParams, - Map headerParams, - Map cookieParams - ) { - for (Map.Entry entry : paramMap.entrySet()) { - Object value = entry.getValue(); - for (Parameter param : operation.getParameters()) { - if (entry.getKey().equals(param.getName())) { - switch (param.getIn()) { - case "path": - path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); - break; - case "query": - if (value instanceof Collection) { - collectionQueryParams.addAll(parameterToPairs(param, (Collection) value)); - } else { - queryParams.addAll(parameterToPair(param.getName(), value)); - } - break; - case "header": - headerParams.put(param.getName(), parameterToString(value)); - break; - case "cookie": - cookieParams.put(param.getName(), parameterToString(value)); - break; - default: - throw new IllegalStateException("Unexpected param in: " + param.getIn()); - } - - } - } - } - return path; - } - {{/dynamicOperations}} - - /** - * Convert the HTTP request body to a string. - * - * @param request The HTTP request object - * @return The string representation of the HTTP request body - * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string - */ - private String requestBodyToString(RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - // empty http request body - return ""; - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiResponse.mustache deleted file mode 100644 index cecbaac1df27..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiResponse.mustache +++ /dev/null @@ -1,75 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.util.List; -import java.util.Map; -{{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; -import java.util.TreeMap; -{{/caseInsensitiveResponseHeaders}} - -/** - * API response returned by API call. - */ -public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; - - /** - *

    Constructor for ApiResponse.

    - * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - *

    Constructor for ApiResponse.

    - * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - {{#caseInsensitiveResponseHeaders}} - Map> responseHeaders = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : headers.entrySet()){ - responseHeaders.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.headers = {{#caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}; - this.data = data; - } - - /** - *

    Get the status code.

    - * - * @return the status code - */ - public int getStatusCode() { - return statusCode; - } - - /** - *

    Get the headers.

    - * - * @return a {@link java.util.Map} of headers - */ - public Map> getHeaders() { - return headers; - } - - /** - *

    Get the data.

    - * - * @return the data - */ - public T getData() { - return data; - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache deleted file mode 100644 index b633aa8f5864..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache +++ /dev/null @@ -1,74 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.*; -import okio.Buffer; -import okio.BufferedSink; -import okio.GzipSink; -import okio.Okio; - -import java.io.IOException; - -/** - * Encodes request bodies using gzip. - * - * Taken from https://github.com/square/okhttp/issues/350 - */ -class GzipRequestInterceptor implements Interceptor { - @Override - public Response intercept(Chain chain) throws IOException { - Request originalRequest = chain.request(); - if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { - return chain.proceed(originalRequest); - } - - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); - return chain.proceed(compressedRequest); - } - - private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return new RequestBody() { - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() { - return buffer.size(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - sink.write(buffer.snapshot()); - } - }; - } - - private RequestBody gzip(final RequestBody body) { - return new RequestBody() { - @Override - public MediaType contentType() { - return body.contentType(); - } - - @Override - public long contentLength() { - return -1; // We don't know the compressed length in advance! - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); - body.writeTo(gzipSink); - gzipSink.close(); - } - }; - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache deleted file mode 100644 index 71e1e2b4cbe8..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache +++ /dev/null @@ -1,62 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.MediaType; -import okhttp3.RequestBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - private final RequestBody requestBody; - - private final ApiCallback callback; - - public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { - this.requestBody = requestBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); - } - }; - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache deleted file mode 100644 index 45115940b665..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache +++ /dev/null @@ -1,59 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.MediaType; -import okhttp3.ResponseBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ApiCallback callback; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { - this.responseBody = responseBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/README.mustache deleted file mode 100644 index a1a142bd488c..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/README.mustache +++ /dev/null @@ -1,183 +0,0 @@ -# {{artifactId}} - -{{appName}} -- API version: {{appVersion}} -{{^hideGenerationTimestamp}} - - Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} - -{{{appDescriptionWithNewLines}}} - -{{#infoUrl}} - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* - - -## Requirements - -Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ -2. Maven (3.8.3+)/Gradle (7.2+) - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn clean install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn clean deploy -``` - -Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - {{{groupId}}} - {{{artifactId}}} - {{{artifactVersion}}} - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy - repositories { - mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central. - mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo. - } - - dependencies { - implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" - } -``` - -### Others - -At first generate the JAR by executing: - -```shell -mvn clean package -``` - -Then manually install the following JARs: - -* `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` -* `target/lib/*.jar` - -## Getting Started - -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -// Import classes: -import {{{invokerPackage}}}.ApiClient; -import {{{invokerPackage}}}.ApiException; -import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} -import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} -import {{{invokerPackage}}}.models.*; -import {{{package}}}.{{{classname}}}; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("{{{basePath}}}"); - {{#hasAuthMethods}} - {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setUsername("YOUR USERNAME"); - {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} - // Configure HTTP bearer authorization: {{{name}}} - HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - // Configure API key authorization: {{{name}}} - ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} - {{/authMethods}} - {{/hasAuthMethods}} - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{#allParams}} - {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} - {{/allParams}} - try { - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{{paramName}}}({{{paramName}}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} - } catch (ApiException e) { - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -{{/-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#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation for Models - -{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) -{{/model}}{{/models}} - -## Documentation for Authorization - -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - {{scope}}: {{description}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache deleted file mode 100644 index 943e6948de76..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache +++ /dev/null @@ -1,520 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -import {{invokerPackage}}.ApiCallback; -import {{invokerPackage}}.ApiClient; -import {{invokerPackage}}.ApiException; -{{#dynamicOperations}} -import {{invokerPackage}}.ApiOperation; -{{/dynamicOperations}} -import {{invokerPackage}}.ApiResponse; -import {{invokerPackage}}.Configuration; -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ProgressRequestBody; -import {{invokerPackage}}.ProgressResponseBody; -{{#performBeanValidation}} -import {{invokerPackage}}.BeanValidationException; -{{/performBeanValidation}} - -import com.google.gson.reflect.TypeToken; -{{#dynamicOperations}} -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.parameters.Parameter; -{{/dynamicOperations}} - -import java.io.IOException; - -{{#useBeanValidation}} -import javax.validation.constraints.*; -{{/useBeanValidation}} -{{#performBeanValidation}} -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.ValidatorFactory; -import javax.validation.executable.ExecutableValidator; -import java.util.Set; -import java.lang.reflect.Method; -import java.lang.reflect.Type; -{{/performBeanValidation}} - -{{#imports}}import {{import}}; -{{/imports}} - -import java.lang.reflect.Type; -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{#supportStreaming}} -import java.io.InputStream; -{{/supportStreaming}} -{{/fullJavaUtil}} -import javax.ws.rs.core.GenericType; - -{{#operations}} -public class {{classname}} { - private ApiClient localVarApiClient; - - public {{classname}}() { - this(Configuration.getDefaultApiClient()); - } - - public {{classname}}(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - {{#operation}} - {{^vendorExtensions.x-group-parameters}}/** - * Build call for {{operationId}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    - {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - - // create path and map variables - {{^dynamicOperations}} - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; - {{/dynamicOperations}} - {{#dynamicOperations}} - ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}"); - if (apiOperation == null) { - throw new ApiException("Operation not found in OAS"); - } - Operation operation = apiOperation.getOperation(); - String localVarPath = apiOperation.getPath(); - Map paramMap = new HashMap<>(); - {{#allParams}} - {{^isFormParam}} - {{^isBodyParam}} - paramMap.put("{{baseName}}", {{paramName}}); - {{/isBodyParam}} - {{/isFormParam}} - {{/allParams}} - {{/dynamicOperations}} - - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); - - {{#formParams}} - if ({{paramName}} != null) { - localVarFormParams.put("{{baseName}}", {{paramName}}); - } - - {{/formParams}} - {{^dynamicOperations}} - {{#queryParams}} - if ({{paramName}} != null) { - {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); - } - - {{/queryParams}} - {{#headerParams}} - if ({{paramName}} != null) { - localVarHeaderParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); - } - - {{/headerParams}} - {{#cookieParams}} - if ({{paramName}} != null) { - localVarCookieParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); - } - - {{/cookieParams}} - {{/dynamicOperations}} - {{#dynamicOperations}} - localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); - - {{/dynamicOperations}} - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - return localVarApiClient.buildCall(localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - @SuppressWarnings("rawtypes") - private okhttp3.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - {{^performBeanValidation}} - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) { - throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); - } - {{/required}}{{/allParams}} - - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - - {{/performBeanValidation}} - {{#performBeanValidation}} - try { - ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); - ExecutableValidator executableValidator = factory.getValidator().forExecutables(); - - Object[] parameterValues = { {{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}} }; - Method method = this.getClass().getMethod("{{operationId}}WithHttpInfo"{{#allParams}}, {{#isArray}}java.util.List{{/isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isArray}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class{{/allParams}}); - Set> violations = executableValidator.validateParameters(this, method, - parameterValues); - - if (violations.size() == 0) { - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - - } else { - throw new BeanValidationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - - {{/performBeanValidation}} - } - - {{^vendorExtensions.x-group-parameters}} - /** - * {{summary}} - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}{{#returnType}} - * @return {{.}}{{/returnType}} - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    - {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#vendorExtensions.x-streaming}} - public {{#returnType}}InputStream {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}InputStream localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp;{{/returnType}} - } - {{/vendorExtensions.x-streaming}} - {{^vendorExtensions.x-streaming}} - public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp.getData();{{/returnType}} - } - {{/vendorExtensions.x-streaming}} - {{/vendorExtensions.x-group-parameters}} - - {{^vendorExtensions.x-group-parameters}}/** - * {{summary}} - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    - {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}} - try { - Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); - e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); - throw e; - } - {{/returnType}} - } - {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{^returnType}} - return localVarApiClient.execute(localVarCall); - {{/returnType}} - {{#returnType}} - try { - Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); - e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); - throw e; - } - {{/returnType}} - } - {{/vendorExtensions.x-streaming}} - - {{^vendorExtensions.x-group-parameters}}/** - * {{summary}} (asynchronously) - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    - {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { - - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}_callback); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);{{/returnType}}{{^returnType}}localVarApiClient.executeAsync(localVarCall, _callback);{{/returnType}} - return localVarCall; - } - {{#vendorExtensions.x-group-parameters}} - - public class API{{operationId}}Request { - {{#requiredParams}} - private final {{{dataType}}} {{paramName}}; - {{/requiredParams}} - {{#optionalParams}} - private {{{dataType}}} {{paramName}}; - {{/optionalParams}} - - private API{{operationId}}Request({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { - {{#requiredParams}} - this.{{paramName}} = {{paramName}}; - {{/requiredParams}} - } - - {{#optionalParams}} - /** - * Set {{paramName}} - * @param {{paramName}} {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}) - * @return API{{operationId}}Request - */ - public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) { - this.{{paramName}} = {{paramName}}; - return this; - } - - {{/optionalParams}} - /** - * Build call for {{operationId}} - * @param _callback ApiCallback API callback - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    - {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - } - - /** - * Execute {{operationId}} request{{#returnType}} - * @return {{.}}{{/returnType}} - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    - {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { - {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp.getData();{{/returnType}} - } - - /** - * Execute {{operationId}} request with HTTP info returned - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    - {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { - return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - } - - /** - * Execute {{operationId}} request (asynchronously) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    - {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public okhttp3.Call executeAsync(final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { - return {{operationId}}Async({{#allParams}}{{paramName}}, {{/allParams}}_callback); - } - } - - /** - * {{summary}} - * {{notes}}{{#requiredParams}} - * @param {{paramName}} {{description}} (required){{/requiredParams}} - * @return API{{operationId}}Request - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    - {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public API{{operationId}}Request {{operationId}}({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { - return new API{{operationId}}Request({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}); - } - {{/vendorExtensions.x-group-parameters}} - {{/operation}} -} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache deleted file mode 100644 index 59da3c51c261..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache +++ /dev/null @@ -1,199 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.util.Map; -import java.util.List; -{{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; -import java.util.TreeMap; -{{/caseInsensitiveResponseHeaders}} - -import javax.ws.rs.core.GenericType; - -/** - *

    ApiException class.

    - */ -@SuppressWarnings("serial") -{{>generatedAnnotation}} -public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - private {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject = null; - private GenericType errorObjectType = null; - - /** - *

    Constructor for ApiException.

    - */ - public ApiException() {} - - /** - *

    Constructor for ApiException.

    - * - * @param throwable a {@link java.lang.Throwable} object - */ - public ApiException(Throwable throwable) { - super(throwable); - } - - /** - *

    Constructor for ApiException.

    - * - * @param message the error message - */ - public ApiException(String message) { - super(message); - } - - /** - *

    Constructor for ApiException.

    - * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - {{#caseInsensitiveResponseHeaders}} - Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : responseHeaders.entrySet()){ - headers.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; - this.responseBody = responseBody; - } - - /** - *

    Constructor for ApiException.

    - * - * @param message the error message - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

    Constructor for ApiException.

    - * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - /** - *

    Constructor for ApiException.

    - * - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

    Constructor for ApiException.

    - * - * @param code HTTP status code - * @param message a {@link java.lang.String} object - */ - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - /** - *

    Constructor for ApiException.

    - * - * @param code HTTP status code - * @param message the error message - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - {{#caseInsensitiveResponseHeaders}} - Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : responseHeaders.entrySet()){ - headers.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } - - /** - * Get the error object type. - * - * @return Error object type - */ - public GenericType getErrorObjectType() { - return errorObjectType; - } - - /** - * Set the error object type. - * - * @param errorObjectType object type - */ - public void setErrorObjectType(GenericType errorObjectType) { - this.errorObjectType = errorObjectType; - } - - /** - * Get the error object. - * - * @return Error object - */ - public {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} getErrorObject() { - return errorObject; - } - - /** - * Get the error object. - * - * @param errorObject Error object - */ - public void setErrorObject({{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject) { - this.errorObject = errorObject; - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache deleted file mode 100644 index 616ad65a5aca..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache +++ /dev/null @@ -1,118 +0,0 @@ -# {{classname}}{{#description}} -{{.}}{{/description}} - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} - -# **{{operationId}}**{{^vendorExtensions.x-group-parameters}} -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} - -{{summary}}{{#notes}} - -{{.}}{{/notes}} - -### Example -```java -// Import classes: -import {{{invokerPackage}}}.ApiClient; -import {{{invokerPackage}}}.ApiException; -import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} -import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} -import {{{invokerPackage}}}.models.*; -import {{{package}}}.{{{classname}}}; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("{{{basePath}}}"); - {{#hasAuthMethods}} - {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setUsername("YOUR USERNAME"); - {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} - // Configure HTTP bearer authorization: {{{name}}} - HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - // Configure API key authorization: {{{name}}} - ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} - {{/authMethods}} - {{/hasAuthMethods}} - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{#allParams}} - {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} - {{/allParams}} - try { - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{{paramName}}}({{{paramName}}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} - } catch (ApiException e) { - {{=< >=}} - <#errorObjectSubtype> - <^-first>} else if (e.getErrorObject() instanceof <&.>) { - // do something here - <#-last> - } else { - // something else happened - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - - - <={{ }}=> - - } - } -} -``` - -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (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}} - -{{#responses.0}} -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -{{#responses}} -**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}} | -{{/responses}} -{{/responses.0}} - -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_test.mustache deleted file mode 100644 index 98a30a60cd54..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_test.mustache +++ /dev/null @@ -1,56 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -import {{invokerPackage}}.ApiException; -{{#imports}}import {{import}}; -{{/imports}} -import org.junit.Test; -import org.junit.Ignore; - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{#supportStreaming}} -import java.io.InputStream; -{{/supportStreaming}} -{{/fullJavaUtil}} - -/** - * API tests for {{classname}} - */ -@Ignore -public class {{classname}}Test { - - private final {{classname}} api = new {{classname}}(); - - {{#operations}}{{#operation}} - /** - * {{summary}} - * - * {{notes}} - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void {{operationId}}Test() throws ApiException { - {{#allParams}} - {{{dataType}}} {{paramName}} = null; - {{/allParams}} - {{#vendorExtensions.x-streaming}} - InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{paramName}}({{paramName}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}} - {{/vendorExtensions.x-streaming}} - {{^vendorExtensions.x-streaming}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{paramName}}({{paramName}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}} - {{/vendorExtensions.x-streaming}} - // TODO: test validations - } - {{/operation}}{{/operations}} -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache deleted file mode 100644 index a0dda669a899..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache +++ /dev/null @@ -1,69 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); - } - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/Authentication.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/Authentication.mustache deleted file mode 100644 index c4ad338c793b..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/Authentication.mustache +++ /dev/null @@ -1,25 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws ApiException if failed to update the parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache deleted file mode 100644 index 417a89e34ccd..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache +++ /dev/null @@ -1,46 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import okhttp3.Credentials; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -import java.io.UnsupportedEncodingException; - -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (username == null && password == null) { - return; - } - headerParams.put("Authorization", Credentials.basic( - username == null ? "" : username, - password == null ? "" : password)); - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache deleted file mode 100644 index c8a9fce29650..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache +++ /dev/null @@ -1,52 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class HttpBearerAuth implements Authentication { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return bearerToken; - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (bearerToken == null) { - return; - } - - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuth.mustache deleted file mode 100644 index 34d359857181..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuth.mustache +++ /dev/null @@ -1,31 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class OAuth implements Authentication { - private String accessToken; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (accessToken != null) { - headerParams.put("Authorization", "Bearer " + accessToken); - } - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache deleted file mode 100644 index cb0e82505507..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache +++ /dev/null @@ -1,70 +0,0 @@ -{{#hasOAuthMethods}} -package {{invokerPackage}}.auth; - -import okhttp3.OkHttpClient; -import okhttp3.MediaType; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -public class OAuthOkHttpClient implements HttpClient { - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - @Override - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - MediaType mediaType = MediaType.parse("application/json"); - Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); - - if(headers != null) { - for (Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - mediaType = MediaType.parse(entry.getValue()); - } else { - requestBuilder.addHeader(entry.getKey(), entry.getValue()); - } - } - } - - RequestBody body = request.getBody() != null ? RequestBody.create(request.getBody(), mediaType) : null; - requestBuilder.method(requestMethod, body); - - try { - Response response = client.newCall(requestBuilder.build()).execute(); - return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), - response.body().contentType().toString(), - response.code(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - @Override - public void shutdown() { - // Nothing to do here - } -} -{{/hasOAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache deleted file mode 100644 index 49f3d0ccc30a..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache +++ /dev/null @@ -1,213 +0,0 @@ -{{#hasOAuthMethods}} -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import okhttp3.Interceptor; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URI; -import java.util.Map; -import java.util.List; - -public class RetryingOAuth extends OAuth implements Interceptor { - private OAuthClient oAuthClient; - - private TokenRequestBuilder tokenRequestBuilder; - - /** - * @param client An OkHttp client - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { - this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = tokenRequestBuilder; - } - - /** - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { - this(new OkHttpClient(), tokenRequestBuilder); - } - - /** - * @param tokenUrl The token URL to be used for this OAuth2 flow. - * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - * The value must be an absolute URL. - * @param clientId The OAuth2 client ID for the "clientCredentials" flow. - * @param flow OAuth flow. - * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - * @param parameters A map of string. - */ - public RetryingOAuth( - String tokenUrl, - String clientId, - OAuthFlow flow, - String clientSecret, - Map parameters - ) { - this(OAuthClientRequest.tokenLocation(tokenUrl) - .setClientId(clientId) - .setClientSecret(clientSecret)); - setFlow(flow); - if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); - } - } - } - - /** - * Set the OAuth flow - * - * @param flow The OAuth flow. - */ - public void setFlow(OAuthFlow flow) { - switch(flow) { - case ACCESS_CODE: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case IMPLICIT: - tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); - break; - case PASSWORD: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case APPLICATION: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - } - - @Override - public Response intercept(Chain chain) throws IOException { - return retryingIntercept(chain, true); - } - - private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { - Request request = chain.request(); - - // If the request already has an authorization (e.g. Basic auth), proceed with the request as is - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // Get the token if it has not yet been acquired - if (getAccessToken() == null) { - updateAccessToken(null); - } - - OAuthClientRequest oAuthRequest; - if (getAccessToken() != null) { - // Build the request - Request.Builder requestBuilder = request.newBuilder(); - - String requestAccessToken = getAccessToken(); - try { - oAuthRequest = - new OAuthBearerClientRequest(request.url().toString()). - setAccessToken(requestAccessToken). - buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); - } - requestBuilder.url(oAuthRequest.getLocationUri()); - - // Execute the request - Response response = chain.proceed(requestBuilder.build()); - - // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row - if ( - response != null && - ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || - response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && - updateTokenAndRetryOnAuthorizationFailure - ) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body().close(); - return retryingIntercept(chain, false); - } - } catch (Exception e) { - response.body().close(); - throw e; - } - } - return response; - } - else { - return chain.proceed(chain.request()); - } - } - - /** - * Returns true if the access token has been updated - * - * @param requestAccessToken the request access token - * @return True if the update is successful - * @throws java.io.IOException If fail to update the access token - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = - oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - } - } catch (OAuthSystemException | OAuthProblemException e) { - throw new IOException(e); - } - } - return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); - } - - /** - * Gets the token request builder - * - * @return A token request builder - * @throws java.io.IOException If fail to update the access token - */ - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - /** - * Sets the token request builder - * - * @param tokenRequestBuilder Token request builder - */ - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - // Applying authorization to parameters is performed in the retryingIntercept method - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - // No implementation necessary - } -} -{{/hasOAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.gradle.mustache deleted file mode 100644 index c97cb873e97b..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.gradle.mustache +++ /dev/null @@ -1,169 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' -{{#sourceFolder}} -apply plugin: 'java' -{{/sourceFolder}} -apply plugin: 'com.diffplug.spotless' - -group = '{{groupId}}' -version = '{{artifactVersion}}' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' - } -} - -repositories { - mavenCentral() -} -{{#sourceFolder}} -sourceSets { - main.java.srcDirs = ['{{sourceFolder}}'] -} - -{{/sourceFolder}} -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven-publish' - - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - - publishing { - publications { - maven(MavenPublication) { - artifactId = '{{artifactId}}' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - jakarta_annotation_version = "1.3.5" -} - -dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' - {{#openApiNullable}} - implementation 'org.openapitools:jackson-databind-nullable:0.2.1' - {{/openApiNullable}} - {{#hasOAuthMethods}} - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' - {{/hasOAuthMethods}} - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - {{#joda}} - implementation 'joda-time:joda-time:2.9.9' - {{/joda}} - {{#threetenbp}} - implementation 'org.threeten:threetenbp:1.4.3' - {{/threetenbp}} - {{#dynamicOperations}} - implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' - {{/dynamicOperations}} - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:3.11.2' -} - -javadoc { - options.tags = [ "http.response.details:a:Http Response Details" ] -} - -// Use spotless plugin to automatically format code, remove unused import, etc -// To apply changes directly to the file, run `gradlew spotlessApply` -// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle -spotless { - // comment out below to run spotless as part of the `check` task - enforceCheck false - - format 'misc', { - // define the files (e.g. '*.gradle', '*.md') to apply `misc` to - target '.gitignore' - - // define the steps to apply to those files - trimTrailingWhitespace() - indentWithSpaces() // Takes an integer argument if you don't like 4 - endWithNewline() - } - java { - // don't need to set target, it is inferred from java - - // apply a specific flavor of google-java-format - googleJavaFormat('1.8').aosp().reflowLongStrings() - - removeUnusedImports() - importOrder() - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache deleted file mode 100644 index 5e0c74c55c05..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache +++ /dev/null @@ -1,39 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "{{groupId}}", - name := "{{artifactId}}", - version := "{{artifactVersion}}", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", - {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", - {{/openApiNullable}} - {{#hasOAuthMethods}} - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", - {{/hasOAuthMethods}} - {{#joda}} - "joda-time" % "joda-time" % "2.9.9" % "compile", - {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - {{/threetenbp}} - {{#dynamicOperations}} - "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" - {{/dynamicOperations}} - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache deleted file mode 100644 index 10dfc15ab7fe..000000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache +++ /dev/null @@ -1,420 +0,0 @@ - - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} - {{artifactUrl}} - {{artifactDescription}} - - {{scmConnection}} - {{scmDeveloperConnection}} - {{scmUrl}} - -{{#parentOverridden}} - - {{{parentGroupId}}} - {{{parentArtifactId}}} - {{{parentVersion}}} - -{{/parentOverridden}} - - - - {{licenseName}} - {{licenseUrl}} - repo - - - - - - {{developerName}} - {{developerEmail}} - {{developerOrganization}} - {{developerOrganizationUrl}} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - true - 128m - 512m - - -Xlint:all - -J-Xss4m - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M5 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - 10 - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - - test-jar - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.2.0 - - - add_sources - generate-sources - - add-source - - - - {{{sourceFolder}}} - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.3.1 - - - attach-javadocs - - jar - - - - - none - - - http.response.details - a - Http Response Details: - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.0 - - - attach-sources - - jar-no-fork - - - - - - - com.diffplug.spotless - spotless-maven-plugin - ${spotless.version} - - - - - - - .gitignore - - - - - - true - 4 - - - - - - - - - - 1.8 - - true - - - - - - - - - - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.squareup.okhttp3 - okhttp - ${okhttp-version} - - - com.squareup.okhttp3 - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - {{#hasOAuthMethods}} - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - 1.0.1 - - {{/hasOAuthMethods}} - - org.apache.commons - commons-lang3 - ${commons-lang3-version} - - {{#joda}} - - joda-time - joda-time - ${jodatime-version} - - {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} - {{#dynamicOperations}} - - io.swagger.parser.v3 - swagger-parser-v3 - 2.0.28 - - {{/dynamicOperations}} - {{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - {{/useBeanValidation}} - {{#performBeanValidation}} - - - org.hibernate - hibernate-validator - 5.4.3.Final - - - jakarta.el - jakarta.el-api - ${jakarta.el-version} - - {{/performBeanValidation}} - {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - - {{/parcelableModel}} - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - provided - - {{#openApiNullable}} - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - {{/openApiNullable}} - - javax.ws.rs - jsr311-api - 1.1.1 - - - javax.ws.rs - javax.ws.rs-api - 2.0 - - - - junit - junit - ${junit-version} - test - - - org.mockito - mockito-core - 3.12.4 - test - - - - 1.8 - ${java.version} - ${java.version} - 1.8.5 - 1.6.3 - 4.9.2 - 2.8.8 - 3.12.0 - {{#openApiNullable}} - 0.2.2 - {{/openApiNullable}} - {{#joda}} - 2.10.9 - {{/joda}} - {{#threetenbp}} - 1.5.0 - {{/threetenbp}} - 1.3.5 -{{#performBeanValidation}} - 3.0.3 -{{/performBeanValidation}} -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 4.13.2 - UTF-8 - 2.17.3 - - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/AbstractOpenApiSchema.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache rename to modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/AbstractOpenApiSchema.mustache diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 52fc1c5492d7..82eef936df65 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -1303,6 +1303,7 @@ public class ApiClient { /** * Build HTTP call with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1325,6 +1326,7 @@ public class ApiClient { /** * Build an HTTP request with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1393,6 +1395,7 @@ public class ApiClient { /** * Build full URL by concatenating base path, the given sub path and query parameters. * + * @param baseUrl The base URL * @param path The sub path * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters @@ -1487,6 +1490,7 @@ public class ApiClient { * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache rename to modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache rename to modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index e81f874f1e1b..410639f9a72e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -51,6 +51,7 @@ import java.util.Map; import java.io.InputStream; {{/supportStreaming}} {{/fullJavaUtil}} +import javax.ws.rs.core.GenericType; {{#operations}} public class {{classname}} { @@ -119,7 +120,6 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { {{#servers}}"{{{url}}}"{{^-last}}, {{/-last}}{{/servers}} }; @@ -326,13 +326,32 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType);{{/returnType}} + {{#returnType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); + e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); + throw e; + } + {{/returnType}} } {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}} + {{^returnType}} + return localVarApiClient.execute(localVarCall); + {{/returnType}} + {{#returnType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); + e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); + throw e; + } + {{/returnType}} } {{/vendorExtensions.x-streaming}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/apiException.mustache index 4bec51da938e..59da3c51c261 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/apiException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/apiException.mustache @@ -9,6 +9,8 @@ import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} +import javax.ws.rs.core.GenericType; + /** *

    ApiException class.

    */ @@ -18,6 +20,8 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject = null; + private GenericType errorObjectType = null; /** *

    Constructor for ApiException.

    @@ -156,4 +160,40 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + /** + * Get the error object type. + * + * @return Error object type + */ + public GenericType getErrorObjectType() { + return errorObjectType; + } + + /** + * Set the error object type. + * + * @param errorObjectType object type + */ + public void setErrorObjectType(GenericType errorObjectType) { + this.errorObjectType = errorObjectType; + } + + /** + * Get the error object. + * + * @return Error object + */ + public {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject({{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject) { + this.errorObject = errorObject; + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache index 7b09aa700d61..49f3d0ccc30a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache @@ -29,22 +29,31 @@ public class RetryingOAuth extends OAuth implements Interceptor { private TokenRequestBuilder tokenRequestBuilder; + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); this.tokenRequestBuilder = tokenRequestBuilder; } + /** + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { this(new OkHttpClient(), tokenRequestBuilder); } /** - @param tokenUrl The token URL to be used for this OAuth2 flow. - Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - The value must be an absolute URL. - @param clientId The OAuth2 client ID for the "clientCredentials" flow. - @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - */ + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ public RetryingOAuth( String tokenUrl, String clientId, @@ -63,6 +72,11 @@ public class RetryingOAuth extends OAuth implements Interceptor { } } + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ public void setFlow(OAuthFlow flow) { switch(flow) { case ACCESS_CODE: @@ -148,8 +162,12 @@ public class RetryingOAuth extends OAuth implements Interceptor { } } - /* + /** * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { @@ -166,10 +184,21 @@ public class RetryingOAuth extends OAuth implements Interceptor { return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); } + /** + * Gets the token request builder + * + * @return A token request builder + * @throws java.io.IOException If fail to update the access token + */ public TokenRequestBuilder getTokenRequestBuilder() { return tokenRequestBuilder; } + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { this.tokenRequestBuilder = tokenRequestBuilder; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/model.mustache rename to modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache rename to modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache rename to modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 94c057b1424a..10dfc15ab7fe 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -364,6 +364,16 @@ ${jackson-databind-nullable-version} {{/openApiNullable}} + + javax.ws.rs + jsr311-api + 1.1.1 + + + javax.ws.rs + javax.ws.rs-api + 2.0 + junit diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java index e5613d745cf9..f112a670c313 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java @@ -64,7 +64,7 @@ public void testIgnoreFileProcessing() throws IOException { List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 42); + Assert.assertEquals(files.size(), 43); // Check expected generated files // api sanity check diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 47b490e46ef2..bc18eeb917a6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -291,7 +291,7 @@ public void testGeneratePing() throws Exception { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 38); + Assert.assertEquals(files.size(), 39); TestUtils.ensureContainsFile(files, output, ".gitignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); @@ -360,7 +360,7 @@ public void testGeneratePingSomeObj() throws Exception { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 41); + Assert.assertEquals(files.size(), 42); TestUtils.ensureContainsFile(files, output, ".gitignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); @@ -1005,7 +1005,7 @@ public void testAllowModelWithNoProperties() throws Exception { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 47); + Assert.assertEquals(files.size(), 48); TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/RealCommand.java"); TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/Command.java"); diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml deleted file mode 100644 index 2ea7d82e8c0b..000000000000 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml +++ /dev/null @@ -1,2184 +0,0 @@ -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 -paths: - /foo: - 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' - post: - tags: - - pet - summary: Add a new pet to the store - description: '' - operationId: addPet - responses: - '405': - description: Invalid input - security: - - http_signature_test: [] - - petstore_auth: - - 'write:pets' - - 'read:pets' - requestBody: - $ref: '#/components/requestBodies/Pet' - put: - tags: - - pet - summary: Update an existing pet - description: '' - operationId: updatePet - responses: - '400': - description: Invalid ID supplied - '404': - description: Pet not found - '405': - description: Validation exception - security: - - http_signature_test: [] - - 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 - 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: - - http_signature_test: [] - - 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 - parameters: - - name: tags - in: query - description: Tags to filter by - required: true - style: form - explode: false - schema: - type: array - items: - type: string - 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 tag value - security: - - http_signature_test: [] - - 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 - 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: - '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: - '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 - 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 generated 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 - 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 - default: '2010-02-01T10:20:10.11111+01:00' - example: '2020-02-02T20:20:20.22222Z' - 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: Someting 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/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 much reference a schema named -# `File`. -# operationId: testBodyWithFileSchema -# responses: -# '200': -# description: Success -# requestBody: -# content: -# application/json: -# schema: -# $ref: '#/components/schemas/FileSchemaTestClass' -# 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 - 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 - 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/array-of-enums: - get: - tags: - - fake - summary: Array of Enums - operationId: getArrayOfEnums - responses: - 200: - description: Got named array of enums - content: - application/json: - schema: - $ref: '#/components/schemas/ArrayOfEnums' -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_variable - description: The local server without variables -components: - requestBodies: - UserArray: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - examples: - simple-list: - summary: Simple list example - description: Should not get into code examples - value: - - username: foo - - username: bar - 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 - 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: - # Test the 'HTTP signature' security scheme. - # Each HTTP request is cryptographically signed as specified - # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - type: http - scheme: signature - schemas: - Foo: - type: object - properties: - bar: - $ref: '#/components/schemas/Bar' - Bar: - type: string - default: bar - 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 - example: '2020-02-02T20:20:20.000222Z' - 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 - objectWithNoDeclaredProps: - type: object - # Note: the 'additionalProperties' keyword is not specified, which is - # equivalent to allowing undeclared properties of any type. - description: test code generation for objects - Value must be a map of strings to values. It cannot be the 'null' value. - objectWithNoDeclaredPropsNullable: - type: object - # Note: the 'additionalProperties' keyword is not specified, which is - # equivalent to allowing undeclared properties of any type. - description: test code generation for nullable objects. - Value must be a map of strings to values or the 'null' value. - nullable: true - anyTypeProp: - description: test code generation for any type - Here the 'type' attribute is not specified, which means the value can be anything, - including the null value, string, number, boolean, array or object. - See https://github.com/OAI/OpenAPI-Specification/issues/1389 - # TODO: this should be supported, currently there are some issues in the code generation. - #anyTypeExceptNullProp: - # description: any type except 'null' - # Here the 'type' attribute is not specified, which means the value can be anything, - # including the null value, string, number, boolean, array or object. - # not: - # type: 'null' - anyTypePropNullable: - description: test code generation for any type - Here the 'type' attribute is not specified, which means the value can be anything, - including the null value, string, number, boolean, array or object. - The 'nullable' attribute does not change the allowed values. - nullable: true - 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 - 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' - - $ref: '#/components/schemas/Address' - - type: object - properties: - declawed: - type: boolean - Address: - type: object - additionalProperties: - type: integer - Animal: - type: object - discriminator: - propertyName: className - 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 - multipleOf: 2 - int32: - type: integer - format: int32 - maximum: 200 - minimum: 20 - int64: - type: integer - format: int64 - number: - maximum: 543.2 - minimum: 32.1 - type: number - multipleOf: 32.5 - 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 - example: '2020-02-02' - dateTime: - type: string - format: date-time - example: '2007-12-03T10:15:30+01:00' - 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_integer_only: - type: integer - enum: - - 2 - - -2 - 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 - anytype_1: {} - map_with_undeclared_properties_anytype_1: - type: object - map_with_undeclared_properties_anytype_2: - type: object - properties: {} - map_with_undeclared_properties_anytype_3: - type: object - additionalProperties: true - empty_map: - type: object - description: an object with no declared properties and no undeclared - properties, hence it's an empty map. - additionalProperties: false - map_with_undeclared_properties_string: - 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 - 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 - 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 - '_special_model.name_': - type: string - 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 - fruit: - properties: - color: - type: string - oneOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' - # Below additionalProperties is set to false to validate the use - # case when a composed schema has additionalProperties set to false. - additionalProperties: false - apple: - type: object - properties: - cultivar: - type: string - pattern: ^[a-zA-Z\s]*$ - origin: - type: string - pattern: /^[A-Z\s]*$/i - nullable: true - banana: - type: object - properties: - lengthCm: - type: number - mammal: - oneOf: - - $ref: '#/components/schemas/whale' - - $ref: '#/components/schemas/zebra' - - $ref: '#/components/schemas/Pig' - discriminator: - propertyName: className - whale: - type: object - properties: - hasBaleen: - type: boolean - hasTeeth: - type: boolean - className: - type: string - required: - - className - zebra: - type: object - properties: - type: - type: string - enum: - - plains - - mountain - - grevys - className: - type: string - required: - - className - additionalProperties: true - Pig: - oneOf: - - $ref: '#/components/schemas/BasquePig' - - $ref: '#/components/schemas/DanishPig' - discriminator: - propertyName: className - BasquePig: - type: object - properties: - className: - type: string - required: - - className - DanishPig: - type: object - properties: - className: - type: string - required: - - className - gmFruit: - properties: - color: - type: string - anyOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' - additionalProperties: false - fruitReq: - oneOf: - - type: 'null' - - $ref: '#/components/schemas/appleReq' - - $ref: '#/components/schemas/bananaReq' - additionalProperties: false - appleReq: - type: object - properties: - cultivar: - type: string - mealy: - type: boolean - required: - - cultivar - additionalProperties: false - bananaReq: - type: object - properties: - lengthCm: - type: number - sweet: - type: boolean - required: - - lengthCm - additionalProperties: false - # go-experimental is unable to make Triangle and Quadrilateral models - # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 - Drawing: - type: object - properties: - mainShape: - # A property whose value is a 'oneOf' type, and the type is referenced instead - # of being defined inline. The value cannot be null. - $ref: '#/components/schemas/Shape' - shapeOrNull: - # A property whose value is a 'oneOf' type, and the type is referenced instead - # of being defined inline. The value may be null because ShapeOrNull has 'null' - # type as a child schema of 'oneOf'. - $ref: '#/components/schemas/ShapeOrNull' - nullableShape: - # A property whose value is a 'oneOf' type, and the type is referenced instead - # of being defined inline. The value may be null because NullableShape has the - # 'nullable: true' attribute. For this specific scenario this is exactly the - # same thing as 'shapeOrNull'. - $ref: '#/components/schemas/NullableShape' - shapes: - type: array - items: - $ref: '#/components/schemas/Shape' - additionalProperties: - # Here the additional properties are specified using a referenced schema. - # This is just to validate the generated code works when using $ref - # under 'additionalProperties'. - $ref: '#/components/schemas/fruit' - Shape: - oneOf: - - $ref: '#/components/schemas/Triangle' - - $ref: '#/components/schemas/Quadrilateral' - discriminator: - propertyName: shapeType - ShapeOrNull: - description: The value may be a shape or the 'null' value. - This is introduced in OAS schema >= 3.1. - oneOf: - - type: 'null' - - $ref: '#/components/schemas/Triangle' - - $ref: '#/components/schemas/Quadrilateral' - discriminator: - propertyName: shapeType - NullableShape: - description: The value may be a shape or the 'null' value. - The 'nullable' attribute was introduced in OAS schema >= 3.0 - and has been deprecated in OAS schema >= 3.1. - oneOf: - - $ref: '#/components/schemas/Triangle' - - $ref: '#/components/schemas/Quadrilateral' - discriminator: - propertyName: shapeType - nullable: true - ShapeInterface: - properties: - shapeType: - type: string - required: - - shapeType - TriangleInterface: - properties: - triangleType: - type: string - required: - - triangleType - Triangle: - oneOf: - - $ref: '#/components/schemas/EquilateralTriangle' - - $ref: '#/components/schemas/IsoscelesTriangle' - - $ref: '#/components/schemas/ScaleneTriangle' - discriminator: - propertyName: triangleType - # Note: the 'additionalProperties' keyword is not specified, which is - # equivalent to allowing undeclared properties of any type. - EquilateralTriangle: - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/TriangleInterface' - IsoscelesTriangle: - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/TriangleInterface' - additionalProperties: false - ScaleneTriangle: - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/TriangleInterface' - QuadrilateralInterface: - properties: - quadrilateralType: - type: string - required: - - quadrilateralType - Quadrilateral: - oneOf: - - $ref: '#/components/schemas/SimpleQuadrilateral' - - $ref: '#/components/schemas/ComplexQuadrilateral' - discriminator: - propertyName: quadrilateralType - SimpleQuadrilateral: - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/QuadrilateralInterface' - ComplexQuadrilateral: - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/QuadrilateralInterface' - GrandparentAnimal: - type: object - required: - - pet_type - properties: - pet_type: - type: string - discriminator: - propertyName: pet_type - ParentPet: - type: object - allOf: - - $ref: '#/components/schemas/GrandparentAnimal' - #ChildCat: - # allOf: - # - $ref: '#/components/schemas/ParentPet' - # - type: object - # properties: - # name: - # type: string - # pet_type: - # x-enum-as-string: true - # type: string - # enum: - # - ChildCat - # default: ChildCat - ArrayOfEnums: - type: array - items: - $ref: '#/components/schemas/OuterEnum' - DateTimeTest: - type: string - default: '2010-01-01T10:10:10.000111+01:00' - example: '2010-01-01T10:10:10.000111+01:00' - format: date-time - 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' - PetWithRequiredTags: - type: object - required: - - name - - photoUrls - - tags - 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 - 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 diff --git a/pom.xml b/pom.xml index e7a19c49beae..358690a1210b 100644 --- a/pom.xml +++ b/pom.xml @@ -1346,7 +1346,6 @@ samples/openapi3/client/petstore/java/jersey2-java8 samples/client/others/java/okhttp-gson-streaming samples/client/petstore/java/okhttp-gson - samples/client/petstore/java/retrofit2 samples/client/petstore/java/retrofit2rx2 samples/client/petstore/java/retrofit2rx3 diff --git a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/FILES b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/FILES index 9efd92ad7a1a..77e02d36f052 100644 --- a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/FILES +++ b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/FILES @@ -33,4 +33,5 @@ src/main/java/org/openapitools/client/auth/ApiKeyAuth.java src/main/java/org/openapitools/client/auth/Authentication.java src/main/java/org/openapitools/client/auth/HttpBasicAuth.java src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java src/main/java/org/openapitools/client/model/SomeObj.java diff --git a/samples/client/others/java/okhttp-gson-streaming/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index 2b89ca0c1c20..8a1529f3b2b8 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -301,6 +301,16 @@ jackson-databind-nullable ${jackson-databind-nullable-version} + + javax.ws.rs + jsr311-api + 1.1.1 + + + javax.ws.rs + javax.ws.rs-api + 2.0 + junit diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java index f2fca9d7ea3b..840cac41bd29 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java @@ -1091,6 +1091,7 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept /** * Build HTTP call with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1113,6 +1114,7 @@ public Call buildCall(String baseUrl, String path, String method, List que /** * Build an HTTP request with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1181,6 +1183,7 @@ public Request buildRequest(String baseUrl, String path, String method, List cookieParams, Request.Builde * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiException.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiException.java index 46e3601c1343..afa977ee2585 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiException.java @@ -16,6 +16,8 @@ import java.util.Map; import java.util.List; +import javax.ws.rs.core.GenericType; + /** *

    ApiException class.

    */ @@ -25,6 +27,8 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorObject = null; + private GenericType errorObjectType = null; /** *

    Constructor for ApiException.

    @@ -151,4 +155,40 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the error object type. + * + * @return Error object type + */ + public GenericType getErrorObjectType() { + return errorObjectType; + } + + /** + * Set the error object type. + * + * @param errorObjectType object type + */ + public void setErrorObjectType(GenericType errorObjectType) { + this.errorObjectType = errorObjectType; + } + + /** + * Get the error object. + * + * @return Error object + */ + public Object getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject(Object errorObject) { + this.errorObject = errorObject; + } } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java index 4c7ae244a335..33256f94541c 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java @@ -27,7 +27,6 @@ import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; -import org.openapitools.client.model.*; import okio.ByteString; import java.io.IOException; @@ -41,14 +40,20 @@ import java.util.Map; import java.util.HashMap; +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { @@ -81,13 +86,14 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - public JSON() { + { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(byte[].class, byteArrayAdapter) + .registerTypeAdapterFactory(new org.openapitools.client.model.SomeObj.CustomTypeAdapterFactory()) .create(); } @@ -96,7 +102,7 @@ public JSON() { * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -104,23 +110,13 @@ public Gson getGson() { * Set Gson. * * @param gson Gson - * @return JSON */ - public JSON setGson(Gson gson) { - this.gson = gson; - return this; + public static void setGson(Gson gson) { + JSON.gson = gson; } - /** - * Configure the parser to be liberal in what it accepts. - * - * @param lenientOnJson Set it to true to ignore some syntax errors - * @return JSON - * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html - */ - public JSON setLenientOnJson(boolean lenientOnJson) { + public static void setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; - return this; } /** @@ -129,7 +125,7 @@ public JSON setLenientOnJson(boolean lenientOnJson) { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -142,11 +138,11 @@ public String serialize(Object obj) { * @return The deserialized Java object */ @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { @@ -166,7 +162,7 @@ public T deserialize(String body, Type returnType) { /** * Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { + public static class ByteArrayAdapter extends TypeAdapter { @Override public void write(JsonWriter out, byte[] value) throws IOException { @@ -238,7 +234,7 @@ public OffsetDateTime read(JsonReader in) throws IOException { /** * Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -276,14 +272,12 @@ public LocalDate read(JsonReader in) throws IOException { } } - public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); - return this; } /** @@ -397,14 +391,11 @@ public Date read(JsonReader in) throws IOException { } } - public JSON setDateFormat(DateFormat dateFormat) { + public static void setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setSqlDateFormat(DateFormat dateFormat) { + public static void setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); - return this; } - } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java index dc64eace5442..31835e16e011 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java @@ -35,6 +35,7 @@ import java.util.List; import java.util.Map; import java.io.InputStream; +import javax.ws.rs.core.GenericType; public class PingApi { private ApiClient localVarApiClient; @@ -87,7 +88,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call postPingCall(SomeObj someObj, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -171,8 +171,14 @@ public InputStream postPing(SomeObj someObj) throws ApiException { */ public InputStream postPingWithHttpInfo(SomeObj someObj) throws ApiException { okhttp3.Call localVarCall = postPingValidateBeforeCall(someObj, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 000000000000..e16bfc964dd0 --- /dev/null +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * ping some object + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java index 99455e9f948a..a8b42537e4d8 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * SomeObj */ @@ -257,5 +276,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("$_type"); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("active"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SomeObj + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SomeObj.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SomeObj is not found in the empty JSON string", SomeObj.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SomeObj.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SomeObj` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SomeObj.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SomeObj' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SomeObj.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SomeObj value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SomeObj read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SomeObj given an JSON string + * + * @param jsonString JSON string + * @return An instance of SomeObj + * @throws IOException if the JSON string is invalid with respect to SomeObj + */ + public static SomeObj fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SomeObj.class); + } + + /** + * Convert an instance of SomeObj to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES index f8e8f2d5a9e8..f21fe42c6bcf 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES @@ -94,6 +94,7 @@ src/main/java/org/openapitools/client/auth/OAuth.java src/main/java/org/openapitools/client/auth/OAuthFlow.java src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java src/main/java/org/openapitools/client/auth/RetryingOAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index 9e8777894cea..3e85ce99567e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -311,6 +311,16 @@ jackson-databind-nullable ${jackson-databind-nullable-version}
    + + javax.ws.rs + jsr311-api + 1.1.1 + + + javax.ws.rs + javax.ws.rs-api + 2.0 + junit diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java index 7707d1a586d5..95e5f6a6caa2 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java @@ -1169,6 +1169,7 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept /** * Build HTTP call with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1191,6 +1192,7 @@ public Call buildCall(String baseUrl, String path, String method, List que /** * Build an HTTP request with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1259,6 +1261,7 @@ public Request buildRequest(String baseUrl, String path, String method, List cookieParams, Request.Builde * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java index 5851f0405ade..60e4f9a5e7e6 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiException.java @@ -16,6 +16,8 @@ import java.util.Map; import java.util.List; +import javax.ws.rs.core.GenericType; + /** *

    ApiException class.

    */ @@ -25,6 +27,8 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorObject = null; + private GenericType errorObjectType = null; /** *

    Constructor for ApiException.

    @@ -151,4 +155,40 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the error object type. + * + * @return Error object type + */ + public GenericType getErrorObjectType() { + return errorObjectType; + } + + /** + * Set the error object type. + * + * @param errorObjectType object type + */ + public void setErrorObjectType(GenericType errorObjectType) { + this.errorObjectType = errorObjectType; + } + + /** + * Get the error object. + * + * @return Error object + */ + public Object getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject(Object errorObject) { + this.errorObject = errorObject; + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java index 274416e5dedc..c2502541ff1d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java @@ -27,7 +27,6 @@ import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; -import org.openapitools.client.model.*; import okio.ByteString; import java.io.IOException; @@ -41,54 +40,60 @@ import java.util.Map; import java.util.HashMap; +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() - .registerTypeSelector(Animal.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.Animal.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BigCat", BigCat.class); - classByDiscriminatorValue.put("Cat", Cat.class); - classByDiscriminatorValue.put("Dog", Dog.class); - classByDiscriminatorValue.put("Animal", Animal.class); + classByDiscriminatorValue.put("BigCat", org.openapitools.client.model.BigCat.class); + classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); + classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); + classByDiscriminatorValue.put("Animal", org.openapitools.client.model.Animal.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } }) - .registerTypeSelector(BigCat.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.BigCat.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BigCat", BigCat.class); + classByDiscriminatorValue.put("BigCat", org.openapitools.client.model.BigCat.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } }) - .registerTypeSelector(Cat.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.Cat.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BigCat", BigCat.class); - classByDiscriminatorValue.put("Cat", Cat.class); + classByDiscriminatorValue.put("BigCat", org.openapitools.client.model.BigCat.class); + classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } }) - .registerTypeSelector(Dog.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.Dog.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Dog", Dog.class); + classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } @@ -121,13 +126,57 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - public JSON() { + { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(byte[].class, byteArrayAdapter) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesAnyType.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesArray.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesBoolean.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesInteger.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesNumber.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesObject.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesString.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfArrayOfNumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfNumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.BigCat.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.BigCatAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Capitalization.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.CatAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Category.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ClassModel.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Client.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Dog.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.DogAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EnumArrays.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FileSchemaTestClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FormatTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.HasOnlyReadOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.MapTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.MixedPropertiesAndAdditionalPropertiesClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Model200Response.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelApiResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelFile.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelList.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelReturn.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Name.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.NumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Order.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.OuterComposite.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ReadOnlyFirst.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.SpecialModelName.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.TypeHolderDefault.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.TypeHolderExample.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.User.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.XmlItem.CustomTypeAdapterFactory()) .create(); } @@ -136,7 +185,7 @@ public JSON() { * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -144,23 +193,13 @@ public Gson getGson() { * Set Gson. * * @param gson Gson - * @return JSON */ - public JSON setGson(Gson gson) { - this.gson = gson; - return this; + public static void setGson(Gson gson) { + JSON.gson = gson; } - /** - * Configure the parser to be liberal in what it accepts. - * - * @param lenientOnJson Set it to true to ignore some syntax errors - * @return JSON - * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html - */ - public JSON setLenientOnJson(boolean lenientOnJson) { + public static void setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; - return this; } /** @@ -169,7 +208,7 @@ public JSON setLenientOnJson(boolean lenientOnJson) { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -182,11 +221,11 @@ public String serialize(Object obj) { * @return The deserialized Java object */ @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { @@ -206,7 +245,7 @@ public T deserialize(String body, Type returnType) { /** * Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { + public static class ByteArrayAdapter extends TypeAdapter { @Override public void write(JsonWriter out, byte[] value) throws IOException { @@ -278,7 +317,7 @@ public OffsetDateTime read(JsonReader in) throws IOException { /** * Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -316,14 +355,12 @@ public LocalDate read(JsonReader in) throws IOException { } } - public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); - return this; } /** @@ -437,14 +474,11 @@ public Date read(JsonReader in) throws IOException { } } - public JSON setDateFormat(DateFormat dateFormat) { + public static void setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setSqlDateFormat(DateFormat dateFormat) { + public static void setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); - return this; } - } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 5f6571f9e7d8..f364de8ca6fd 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class AnotherFakeApi { private ApiClient localVarApiClient; @@ -89,7 +90,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -186,8 +186,14 @@ public Client call123testSpecialTags(Client body) throws ApiException { */ public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throws ApiException { okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java index c55d1e12c08a..781eb83cd822 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java @@ -45,6 +45,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeApi { private ApiClient localVarApiClient; @@ -97,7 +98,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -228,7 +228,6 @@ public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback */ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -320,8 +319,14 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -358,7 +363,6 @@ public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallba */ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -450,8 +454,14 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Ap */ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -488,7 +498,6 @@ public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final */ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -580,8 +589,14 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -618,7 +633,6 @@ public okhttp3.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCall */ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -710,8 +724,14 @@ public String fakeOuterStringSerialize(String body) throws ApiException { */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { okhttp3.Call localVarCall = fakeOuterStringSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -748,7 +768,6 @@ public okhttp3.Call fakeOuterStringSerializeAsync(String body, final ApiCallback */ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -880,7 +899,6 @@ public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass body, final */ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1020,7 +1038,6 @@ public okhttp3.Call testBodyWithQueryParamsAsync(String query, User body, final */ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1117,8 +1134,14 @@ public Client testClientModel(Client body) throws ApiException { */ public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { okhttp3.Call localVarCall = testClientModelValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -1169,7 +1192,6 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1421,7 +1443,6 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1573,7 +1594,6 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1800,7 +1820,6 @@ public APItestGroupParametersRequest testGroupParameters(Integer requiredStringG */ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1932,7 +1951,6 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -2083,7 +2101,6 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api */ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index c508d0d8bb6b..0a4db0f802cc 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeClassnameTags123Api { private ApiClient localVarApiClient; @@ -89,7 +90,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -186,8 +186,14 @@ public Client testClassname(Client body) throws ApiException { */ public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { okhttp3.Call localVarCall = testClassnameValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java index f41e1b5ebe7e..ed5ccbc7127a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java @@ -40,6 +40,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class PetApi { private ApiClient localVarApiClient; @@ -93,7 +94,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -229,7 +229,6 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -369,7 +368,6 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -469,8 +467,14 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -511,7 +515,6 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback @Deprecated public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -616,8 +619,14 @@ public Set findPetsByTags(Set tags) throws ApiException { @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -659,7 +668,6 @@ public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback getPetByIdWithHttpInfo(Long petId) throws ApiException { okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -804,7 +818,6 @@ public okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback _callback */ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -946,7 +959,6 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1094,7 +1106,6 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1204,8 +1215,14 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _ */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -1246,7 +1263,6 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1361,8 +1377,14 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { okhttp3.Call localVarCall = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java index afa9b5c026d3..be85241a91d0 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class StoreApi { private ApiClient localVarApiClient; @@ -90,7 +91,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -224,7 +224,6 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -314,8 +313,14 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getInventoryValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -353,7 +358,6 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -455,8 +459,14 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -496,7 +506,6 @@ public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _ca */ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -595,8 +604,14 @@ public Order placeOrder(Order body) throws ApiException { */ public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { okhttp3.Call localVarCall = placeOrderValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java index 2051423374cb..9ab78e005338 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java @@ -38,6 +38,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class UserApi { private ApiClient localVarApiClient; @@ -90,7 +91,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -221,7 +221,6 @@ public okhttp3.Call createUserAsync(User body, final ApiCallback _callback */ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -352,7 +351,6 @@ public okhttp3.Call createUsersWithArrayInputAsync(List body, final ApiCal */ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -484,7 +482,6 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -621,7 +618,6 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -723,8 +719,14 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -765,7 +767,6 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -873,8 +874,14 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -912,7 +919,6 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1037,7 +1043,6 @@ public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws Ap */ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index a37cbdd5a55e..7b630bb57e77 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -28,22 +28,31 @@ public class RetryingOAuth extends OAuth implements Interceptor { private TokenRequestBuilder tokenRequestBuilder; + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); this.tokenRequestBuilder = tokenRequestBuilder; } + /** + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { this(new OkHttpClient(), tokenRequestBuilder); } /** - @param tokenUrl The token URL to be used for this OAuth2 flow. - Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - The value must be an absolute URL. - @param clientId The OAuth2 client ID for the "clientCredentials" flow. - @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - */ + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ public RetryingOAuth( String tokenUrl, String clientId, @@ -62,6 +71,11 @@ public RetryingOAuth( } } + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ public void setFlow(OAuthFlow flow) { switch(flow) { case ACCESS_CODE: @@ -147,8 +161,12 @@ private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAut } } - /* + /** * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { @@ -165,10 +183,21 @@ public synchronized boolean updateAccessToken(String requestAccessToken) throws return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); } + /** + * Gets the token request builder + * + * @return A token request builder + * @throws java.io.IOException If fail to update the access token + */ public TokenRequestBuilder getTokenRequestBuilder() { return tokenRequestBuilder; } + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { this.tokenRequestBuilder = tokenRequestBuilder; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 1b5a3cd22390..57f536d3c51a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -26,6 +26,25 @@ import java.util.HashMap; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesAnyType */ @@ -100,5 +119,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesAnyType + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesAnyType.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesAnyType is not found in the empty JSON string", AdditionalPropertiesAnyType.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesAnyType.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesAnyType` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesAnyType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesAnyType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesAnyType.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesAnyType value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesAnyType read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesAnyType given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesAnyType + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesAnyType + */ + public static AdditionalPropertiesAnyType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesAnyType.class); + } + + /** + * Convert an instance of AdditionalPropertiesAnyType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 6835e103b62d..1a51ef6f93d6 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -27,6 +27,25 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesArray */ @@ -101,5 +120,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesArray + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesArray.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesArray is not found in the empty JSON string", AdditionalPropertiesArray.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesArray.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesArray` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesArray.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesArray' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesArray.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesArray value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesArray read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesArray given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesArray + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesArray + */ + public static AdditionalPropertiesArray fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesArray.class); + } + + /** + * Convert an instance of AdditionalPropertiesArray to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 3f2f1b3ba823..fd81b8f83a67 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -26,6 +26,25 @@ import java.util.HashMap; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesBoolean */ @@ -100,5 +119,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesBoolean + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesBoolean.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesBoolean is not found in the empty JSON string", AdditionalPropertiesBoolean.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesBoolean.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesBoolean` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesBoolean.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesBoolean' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesBoolean.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesBoolean value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesBoolean read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesBoolean given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesBoolean + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesBoolean + */ + public static AdditionalPropertiesBoolean fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesBoolean.class); + } + + /** + * Convert an instance of AdditionalPropertiesBoolean to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 21db6cb109ff..b9bee5272497 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -28,6 +28,25 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesClass */ @@ -454,5 +473,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("map_string"); + openapiFields.add("map_number"); + openapiFields.add("map_integer"); + openapiFields.add("map_boolean"); + openapiFields.add("map_array_integer"); + openapiFields.add("map_array_anytype"); + openapiFields.add("map_map_string"); + openapiFields.add("map_map_anytype"); + openapiFields.add("anytype_1"); + openapiFields.add("anytype_2"); + openapiFields.add("anytype_3"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesClass is not found in the empty JSON string", AdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesClass read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass + */ + public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class); + } + + /** + * Convert an instance of AdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index c90f346b182d..7b2d39d38ca7 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -26,6 +26,25 @@ import java.util.HashMap; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesInteger */ @@ -100,5 +119,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesInteger + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesInteger.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesInteger is not found in the empty JSON string", AdditionalPropertiesInteger.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesInteger.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesInteger` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesInteger.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesInteger' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesInteger.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesInteger value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesInteger read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesInteger given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesInteger + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesInteger + */ + public static AdditionalPropertiesInteger fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesInteger.class); + } + + /** + * Convert an instance of AdditionalPropertiesInteger to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index b9a1d371fd30..ee781461925e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -27,6 +27,25 @@ import java.util.HashMap; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesNumber */ @@ -101,5 +120,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesNumber + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesNumber.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesNumber is not found in the empty JSON string", AdditionalPropertiesNumber.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesNumber.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesNumber` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesNumber.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesNumber' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesNumber.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesNumber value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesNumber read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesNumber given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesNumber + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesNumber + */ + public static AdditionalPropertiesNumber fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesNumber.class); + } + + /** + * Convert an instance of AdditionalPropertiesNumber to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index a61d030c6c01..2696084fde5e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -26,6 +26,25 @@ import java.util.HashMap; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesObject */ @@ -100,5 +119,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesObject + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesObject.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesObject is not found in the empty JSON string", AdditionalPropertiesObject.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesObject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesObject` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesObject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesObject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesObject read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesObject + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesObject + */ + public static AdditionalPropertiesObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesObject.class); + } + + /** + * Convert an instance of AdditionalPropertiesObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 4745fed6651c..9d2ca2d3c36d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -26,6 +26,25 @@ import java.util.HashMap; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesString */ @@ -100,5 +119,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesString + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesString.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesString is not found in the empty JSON string", AdditionalPropertiesString.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesString.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesString` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesString.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesString' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesString.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesString value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesString read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesString given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesString + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesString + */ + public static AdditionalPropertiesString fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesString.class); + } + + /** + * Convert an instance of AdditionalPropertiesString to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java index 24f916d3add3..111ee0879bb8 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java @@ -27,6 +27,25 @@ import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Animal */ @@ -129,5 +148,71 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Animal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Animal.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Animal is not found in the empty JSON string", Animal.openapiRequiredFields.toString())); + } + } + + String discriminatorValue = jsonObj.get("className").getAsString(); + switch (discriminatorValue) { + case "BigCat": + BigCat.validateJsonObject(jsonObj); + break; + case "Cat": + Cat.validateJsonObject(jsonObj); + break; + case "Dog": + Dog.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + } + + + /** + * Create an instance of Animal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Animal + * @throws IOException if the JSON string is invalid with respect to Animal + */ + public static Animal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Animal.class); + } + + /** + * Convert an instance of Animal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 8c7d76947343..d375bd8a4886 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -27,6 +27,25 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ArrayOfArrayOfNumberOnly */ @@ -107,5 +126,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ArrayArrayNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayOfArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayOfArrayOfNumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfArrayOfNumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayOfArrayOfNumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayOfArrayOfNumberOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2408d2577088..9ec157ed1515 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -27,6 +27,25 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ArrayOfNumberOnly */ @@ -107,5 +126,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ArrayNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayOfNumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfNumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayOfNumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayOfNumberOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly + */ + public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java index 1c7469d68e08..66d23d236a84 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -27,6 +27,25 @@ import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ArrayTest */ @@ -181,5 +200,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("array_of_string"); + openapiFields.add("array_array_of_integer"); + openapiFields.add("array_array_of_model"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTest + * @throws IOException if the JSON string is invalid with respect to ArrayTest + */ + public static ArrayTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayTest.class); + } + + /** + * Convert an instance of ArrayTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java index 37b2bb735b9c..cd5f6ef6ccff 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java @@ -26,6 +26,25 @@ import org.openapitools.client.model.BigCatAllOf; import org.openapitools.client.model.Cat; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * BigCat */ @@ -152,5 +171,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("declawed"); + openapiFields.add("kind"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BigCat + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BigCat.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BigCat is not found in the empty JSON string", BigCat.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BigCat.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BigCat` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BigCat.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BigCat.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BigCat' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BigCat.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BigCat value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BigCat read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BigCat given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCat + * @throws IOException if the JSON string is invalid with respect to BigCat + */ + public static BigCat fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BigCat.class); + } + + /** + * Convert an instance of BigCat to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 8334448ffdfc..e1c6d9a895c7 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * BigCatAllOf */ @@ -147,5 +166,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("kind"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BigCatAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BigCatAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BigCatAllOf is not found in the empty JSON string", BigCatAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BigCatAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BigCatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BigCatAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BigCatAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BigCatAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BigCatAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BigCatAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BigCatAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCatAllOf + * @throws IOException if the JSON string is invalid with respect to BigCatAllOf + */ + public static BigCatAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BigCatAllOf.class); + } + + /** + * Convert an instance of BigCatAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java index a99f3586985f..ce4095ed0e52 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Capitalization */ @@ -241,5 +260,94 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("smallCamel"); + openapiFields.add("CapitalCamel"); + openapiFields.add("small_Snake"); + openapiFields.add("Capital_Snake"); + openapiFields.add("SCA_ETH_Flow_Points"); + openapiFields.add("ATT_NAME"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Capitalization + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Capitalization.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Capitalization is not found in the empty JSON string", Capitalization.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Capitalization.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Capitalization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Capitalization.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Capitalization' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Capitalization.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Capitalization value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Capitalization read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Capitalization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Capitalization + * @throws IOException if the JSON string is invalid with respect to Capitalization + */ + public static Capitalization fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Capitalization.class); + } + + /** + * Convert an instance of Capitalization to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java index b226ce008f24..81072f8b6e5a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java @@ -27,6 +27,25 @@ import org.openapitools.client.model.BigCat; import org.openapitools.client.model.CatAllOf; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Cat */ @@ -102,5 +121,66 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("declawed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Cat + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Cat.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Cat is not found in the empty JSON string", Cat.openapiRequiredFields.toString())); + } + } + + String discriminatorValue = jsonObj.get("className").getAsString(); + switch (discriminatorValue) { + case "BigCat": + BigCat.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + } + + + /** + * Create an instance of Cat given an JSON string + * + * @param jsonString JSON string + * @return An instance of Cat + * @throws IOException if the JSON string is invalid with respect to Cat + */ + public static Cat fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Cat.class); + } + + /** + * Convert an instance of Cat to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java index 39c740ffe3fb..6a2c50e1c046 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * CatAllOf */ @@ -96,5 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("declawed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CatAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CatAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CatAllOf is not found in the empty JSON string", CatAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CatAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatAllOf + * @throws IOException if the JSON string is invalid with respect to CatAllOf + */ + public static CatAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatAllOf.class); + } + + /** + * Convert an instance of CatAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java index 9d7c0e4a1cdc..d23447f518de 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Category */ @@ -125,5 +144,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Category + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Category.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Category is not found in the empty JSON string", Category.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Category.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Category` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Category.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Category.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Category' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Category.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Category value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Category read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Category given an JSON string + * + * @param jsonString JSON string + * @return An instance of Category + * @throws IOException if the JSON string is invalid with respect to Category + */ + public static Category fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Category.class); + } + + /** + * Convert an instance of Category to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java index eb1d43e00eb1..8fb1b2f83d15 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing model with \"_class\" property */ @@ -97,5 +116,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("_class"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClassModel + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ClassModel.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ClassModel is not found in the empty JSON string", ClassModel.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClassModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClassModel` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClassModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClassModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClassModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClassModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClassModel read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClassModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClassModel + * @throws IOException if the JSON string is invalid with respect to ClassModel + */ + public static ClassModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClassModel.class); + } + + /** + * Convert an instance of ClassModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java index 8e5e1694acee..a52cc0be31af 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Client */ @@ -96,5 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("client"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Client + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Client.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Client is not found in the empty JSON string", Client.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Client.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Client` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Client.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Client' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Client.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Client value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Client read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Client given an JSON string + * + * @param jsonString JSON string + * @return An instance of Client + * @throws IOException if the JSON string is invalid with respect to Client + */ + public static Client fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Client.class); + } + + /** + * Convert an instance of Client to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java index d4935b3df275..24062284ab56 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java @@ -26,6 +26,25 @@ import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Dog */ @@ -101,5 +120,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("breed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Dog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Dog.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Dog is not found in the empty JSON string", Dog.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Dog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Dog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Dog.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Dog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Dog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Dog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Dog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Dog read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Dog given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dog + * @throws IOException if the JSON string is invalid with respect to Dog + */ + public static Dog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Dog.class); + } + + /** + * Convert an instance of Dog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java index b1f42a5f6209..6053b9169b79 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * DogAllOf */ @@ -96,5 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("breed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DogAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DogAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DogAllOf is not found in the empty JSON string", DogAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DogAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DogAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DogAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DogAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DogAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DogAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DogAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DogAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of DogAllOf + * @throws IOException if the JSON string is invalid with respect to DogAllOf + */ + public static DogAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DogAllOf.class); + } + + /** + * Convert an instance of DogAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java index 2b249f35495e..6b64ece26660 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -26,6 +26,25 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * EnumArrays */ @@ -229,5 +248,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("just_symbol"); + openapiFields.add("array_enum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumArrays + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumArrays.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumArrays is not found in the empty JSON string", EnumArrays.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumArrays.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumArrays` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnumArrays.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnumArrays' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnumArrays.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnumArrays value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EnumArrays read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EnumArrays given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumArrays + * @throws IOException if the JSON string is invalid with respect to EnumArrays + */ + public static EnumArrays fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumArrays.class); + } + + /** + * Convert an instance of EnumArrays to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java index 55ddcb829be4..993d4a53c82c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java @@ -25,6 +25,25 @@ import java.io.IOException; import org.openapitools.client.model.OuterEnum; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * EnumTest */ @@ -405,5 +424,101 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enum_string"); + openapiFields.add("enum_string_required"); + openapiFields.add("enum_integer"); + openapiFields.add("enum_number"); + openapiFields.add("outerEnum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enum_string_required"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumTest is not found in the empty JSON string", EnumTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnumTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnumTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnumTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnumTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnumTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EnumTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EnumTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumTest + * @throws IOException if the JSON string is invalid with respect to EnumTest + */ + public static EnumTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumTest.class); + } + + /** + * Convert an instance of EnumTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4c0ebf716d9a..4bb4e340969d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -27,6 +27,25 @@ import java.util.List; import org.openapitools.client.model.ModelFile; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * FileSchemaTestClass */ @@ -136,5 +155,101 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("file"); + openapiFields.add("files"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FileSchemaTestClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FileSchemaTestClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FileSchemaTestClass is not found in the empty JSON string", FileSchemaTestClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FileSchemaTestClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileSchemaTestClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `file` + if (jsonObj.getAsJsonObject("file") != null) { + ModelFile.validateJsonObject(jsonObj.getAsJsonObject("file")); + } + JsonArray jsonArrayfiles = jsonObj.getAsJsonArray("files"); + // validate the optional field `files` (array) + if (jsonArrayfiles != null) { + for (int i = 0; i < jsonArrayfiles.size(); i++) { + ModelFile.validateJsonObject(jsonArrayfiles.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FileSchemaTestClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FileSchemaTestClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FileSchemaTestClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FileSchemaTestClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FileSchemaTestClass read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FileSchemaTestClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileSchemaTestClass + * @throws IOException if the JSON string is invalid with respect to FileSchemaTestClass + */ + public static FileSchemaTestClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FileSchemaTestClass.class); + } + + /** + * Convert an instance of FileSchemaTestClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java index 52900682b0f7..420e0d231559 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java @@ -29,6 +29,25 @@ import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * FormatTest */ @@ -488,5 +507,113 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("integer"); + openapiFields.add("int32"); + openapiFields.add("int64"); + openapiFields.add("number"); + openapiFields.add("float"); + openapiFields.add("double"); + openapiFields.add("string"); + openapiFields.add("byte"); + openapiFields.add("binary"); + openapiFields.add("date"); + openapiFields.add("dateTime"); + openapiFields.add("uuid"); + openapiFields.add("password"); + openapiFields.add("BigDecimal"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("byte"); + openapiRequiredFields.add("date"); + openapiRequiredFields.add("password"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FormatTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FormatTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FormatTest is not found in the empty JSON string", FormatTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FormatTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FormatTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FormatTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FormatTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FormatTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FormatTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FormatTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FormatTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FormatTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FormatTest + * @throws IOException if the JSON string is invalid with respect to FormatTest + */ + public static FormatTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FormatTest.class); + } + + /** + * Convert an instance of FormatTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index b8194dc1df6e..ff80990e36a7 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * HasOnlyReadOnly */ @@ -117,5 +136,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bar"); + openapiFields.add("foo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasOnlyReadOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HasOnlyReadOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HasOnlyReadOnly is not found in the empty JSON string", HasOnlyReadOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasOnlyReadOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasOnlyReadOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasOnlyReadOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasOnlyReadOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasOnlyReadOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasOnlyReadOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasOnlyReadOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasOnlyReadOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasOnlyReadOnly + * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly + */ + public static HasOnlyReadOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasOnlyReadOnly.class); + } + + /** + * Convert an instance of HasOnlyReadOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java index cc0b38f6c4d8..51fb198904fe 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java @@ -27,6 +27,25 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * MapTest */ @@ -265,5 +284,92 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("map_map_of_string"); + openapiFields.add("map_of_enum_string"); + openapiFields.add("direct_map"); + openapiFields.add("indirect_map"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MapTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MapTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MapTest is not found in the empty JSON string", MapTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MapTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MapTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MapTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MapTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MapTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MapTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MapTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MapTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MapTest + * @throws IOException if the JSON string is invalid with respect to MapTest + */ + public static MapTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MapTest.class); + } + + /** + * Convert an instance of MapTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1c705d4b1ee4..3bd9f59adbb8 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -30,6 +30,25 @@ import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * MixedPropertiesAndAdditionalPropertiesClass */ @@ -168,5 +187,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uuid"); + openapiFields.add("dateTime"); + openapiFields.add("map"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MixedPropertiesAndAdditionalPropertiesClass is not found in the empty JSON string", MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MixedPropertiesAndAdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MixedPropertiesAndAdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MixedPropertiesAndAdditionalPropertiesClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MixedPropertiesAndAdditionalPropertiesClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MixedPropertiesAndAdditionalPropertiesClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MixedPropertiesAndAdditionalPropertiesClass read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of MixedPropertiesAndAdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static MixedPropertiesAndAdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MixedPropertiesAndAdditionalPropertiesClass.class); + } + + /** + * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java index 46150911764a..a6f1720f9e57 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing model name starting with number */ @@ -126,5 +145,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("class"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Model200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Model200Response.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Model200Response is not found in the empty JSON string", Model200Response.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Model200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Model200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Model200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Model200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Model200Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Model200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Model200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Model200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Model200Response + * @throws IOException if the JSON string is invalid with respect to Model200Response + */ + public static Model200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Model200Response.class); + } + + /** + * Convert an instance of Model200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 93e9feb5b86b..9d4ee4fbdf4b 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ModelApiResponse */ @@ -154,5 +173,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("type"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelApiResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelApiResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelApiResponse is not found in the empty JSON string", ModelApiResponse.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelApiResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelApiResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelApiResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelApiResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelApiResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelApiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelApiResponse + * @throws IOException if the JSON string is invalid with respect to ModelApiResponse + */ + public static ModelApiResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelApiResponse.class); + } + + /** + * Convert an instance of ModelApiResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java index 111a748ceff8..4b0921084274 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Must be named `File` for test. */ @@ -97,5 +116,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceURI"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelFile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelFile.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelFile is not found in the empty JSON string", ModelFile.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelFile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelFile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelFile + * @throws IOException if the JSON string is invalid with respect to ModelFile + */ + public static ModelFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelFile.class); + } + + /** + * Convert an instance of ModelFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java index 2ba46fefd4fe..cffa7fb4f941 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ModelList */ @@ -96,5 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("123-list"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelList + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelList.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelList is not found in the empty JSON string", ModelList.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelList read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelList + * @throws IOException if the JSON string is invalid with respect to ModelList + */ + public static ModelList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelList.class); + } + + /** + * Convert an instance of ModelList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java index 4c0e74f87ebc..09a6be5b714a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing reserved words */ @@ -97,5 +116,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("return"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelReturn + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelReturn.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelReturn is not found in the empty JSON string", ModelReturn.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelReturn.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelReturn` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelReturn.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelReturn' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelReturn.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelReturn value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelReturn read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelReturn given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelReturn + * @throws IOException if the JSON string is invalid with respect to ModelReturn + */ + public static ModelReturn fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelReturn.class); + } + + /** + * Convert an instance of ModelReturn to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java index a0bd099370de..a9f5ca0e1508 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing model name same as property name */ @@ -176,5 +195,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("snake_case"); + openapiFields.add("property"); + openapiFields.add("123Number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Name + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Name.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Name is not found in the empty JSON string", Name.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Name.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Name.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Name.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Name' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Name.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Name value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Name read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws IOException if the JSON string is invalid with respect to Name + */ + public static Name fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Name.class); + } + + /** + * Convert an instance of Name to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java index 46830867289a..180a6db89aac 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -25,6 +25,25 @@ import java.io.IOException; import java.math.BigDecimal; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * NumberOnly */ @@ -97,5 +116,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("JustNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NumberOnly is not found in the empty JSON string", NumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NumberOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberOnly + * @throws IOException if the JSON string is invalid with respect to NumberOnly + */ + public static NumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NumberOnly.class); + } + + /** + * Convert an instance of NumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java index 530f0eefd41a..5e577e772049 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java @@ -25,6 +25,25 @@ import java.io.IOException; import org.threeten.bp.OffsetDateTime; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Order */ @@ -291,5 +310,94 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("petId"); + openapiFields.add("quantity"); + openapiFields.add("shipDate"); + openapiFields.add("status"); + openapiFields.add("complete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Order + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Order.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Order is not found in the empty JSON string", Order.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Order.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Order.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Order' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Order.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Order value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Order read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Order given an JSON string + * + * @param jsonString JSON string + * @return An instance of Order + * @throws IOException if the JSON string is invalid with respect to Order + */ + public static Order fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Order.class); + } + + /** + * Convert an instance of Order to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java index d8c60dcf97aa..e86d5bc5ff5e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -25,6 +25,25 @@ import java.io.IOException; import java.math.BigDecimal; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * OuterComposite */ @@ -155,5 +174,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("my_number"); + openapiFields.add("my_string"); + openapiFields.add("my_boolean"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OuterComposite + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (OuterComposite.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in OuterComposite is not found in the empty JSON string", OuterComposite.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OuterComposite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OuterComposite` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OuterComposite.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OuterComposite' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OuterComposite.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OuterComposite value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OuterComposite read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OuterComposite given an JSON string + * + * @param jsonString JSON string + * @return An instance of OuterComposite + * @throws IOException if the JSON string is invalid with respect to OuterComposite + */ + public static OuterComposite fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OuterComposite.class); + } + + /** + * Convert an instance of OuterComposite to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java index 1c1c47105f9d..f0b54cafc011 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java @@ -30,6 +30,25 @@ import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Pet */ @@ -309,5 +328,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("category"); + openapiFields.add("name"); + openapiFields.add("photoUrls"); + openapiFields.add("tags"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("photoUrls"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Pet.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Pet is not found in the empty JSON string", Pet.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Pet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Pet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `category` + if (jsonObj.getAsJsonObject("category") != null) { + Category.validateJsonObject(jsonObj.getAsJsonObject("category")); + } + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the optional field `tags` (array) + if (jsonArraytags != null) { + for (int i = 0; i < jsonArraytags.size(); i++) { + Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Pet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pet read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Pet given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pet + * @throws IOException if the JSON string is invalid with respect to Pet + */ + public static Pet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pet.class); + } + + /** + * Convert an instance of Pet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e452bf03a014..14b28a610665 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ReadOnlyFirst */ @@ -124,5 +143,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bar"); + openapiFields.add("baz"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReadOnlyFirst + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ReadOnlyFirst.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadOnlyFirst is not found in the empty JSON string", ReadOnlyFirst.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReadOnlyFirst.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadOnlyFirst` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadOnlyFirst.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadOnlyFirst' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadOnlyFirst.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadOnlyFirst value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadOnlyFirst read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReadOnlyFirst given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadOnlyFirst + * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst + */ + public static ReadOnlyFirst fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadOnlyFirst.class); + } + + /** + * Convert an instance of ReadOnlyFirst to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java index 271e41f83231..786f141637db 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * SpecialModelName */ @@ -96,5 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("$special[property.name]"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SpecialModelName + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SpecialModelName.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SpecialModelName is not found in the empty JSON string", SpecialModelName.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SpecialModelName.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SpecialModelName` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SpecialModelName.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpecialModelName' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SpecialModelName.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SpecialModelName value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SpecialModelName read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SpecialModelName given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecialModelName + * @throws IOException if the JSON string is invalid with respect to SpecialModelName + */ + public static SpecialModelName fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpecialModelName.class); + } + + /** + * Convert an instance of SpecialModelName to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java index 181b1e65048f..0aae4c29af96 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Tag */ @@ -125,5 +144,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Tag + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Tag.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Tag.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Tag.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Tag' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Tag.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Tag value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Tag read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Tag given an JSON string + * + * @param jsonString JSON string + * @return An instance of Tag + * @throws IOException if the JSON string is invalid with respect to Tag + */ + public static Tag fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Tag.class); + } + + /** + * Convert an instance of Tag to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f9fdaf50fe4c..b0760faa22b8 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -27,6 +27,25 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * TypeHolderDefault */ @@ -220,5 +239,105 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("string_item"); + openapiFields.add("number_item"); + openapiFields.add("integer_item"); + openapiFields.add("bool_item"); + openapiFields.add("array_item"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("string_item"); + openapiRequiredFields.add("number_item"); + openapiRequiredFields.add("integer_item"); + openapiRequiredFields.add("bool_item"); + openapiRequiredFields.add("array_item"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TypeHolderDefault + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TypeHolderDefault.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TypeHolderDefault is not found in the empty JSON string", TypeHolderDefault.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TypeHolderDefault.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TypeHolderDefault` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TypeHolderDefault.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TypeHolderDefault.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TypeHolderDefault' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TypeHolderDefault.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TypeHolderDefault value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TypeHolderDefault read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TypeHolderDefault given an JSON string + * + * @param jsonString JSON string + * @return An instance of TypeHolderDefault + * @throws IOException if the JSON string is invalid with respect to TypeHolderDefault + */ + public static TypeHolderDefault fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TypeHolderDefault.class); + } + + /** + * Convert an instance of TypeHolderDefault to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java index a19d60e90227..ba378dfa531a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -27,6 +27,25 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * TypeHolderExample */ @@ -249,5 +268,107 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("string_item"); + openapiFields.add("number_item"); + openapiFields.add("float_item"); + openapiFields.add("integer_item"); + openapiFields.add("bool_item"); + openapiFields.add("array_item"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("string_item"); + openapiRequiredFields.add("number_item"); + openapiRequiredFields.add("float_item"); + openapiRequiredFields.add("integer_item"); + openapiRequiredFields.add("bool_item"); + openapiRequiredFields.add("array_item"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TypeHolderExample + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TypeHolderExample.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TypeHolderExample is not found in the empty JSON string", TypeHolderExample.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TypeHolderExample.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TypeHolderExample` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TypeHolderExample.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TypeHolderExample.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TypeHolderExample' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TypeHolderExample.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TypeHolderExample value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TypeHolderExample read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TypeHolderExample given an JSON string + * + * @param jsonString JSON string + * @return An instance of TypeHolderExample + * @throws IOException if the JSON string is invalid with respect to TypeHolderExample + */ + public static TypeHolderExample fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TypeHolderExample.class); + } + + /** + * Convert an instance of TypeHolderExample to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java index 166fea9628ca..1b5bbd214544 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * User */ @@ -299,5 +318,96 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("username"); + openapiFields.add("firstName"); + openapiFields.add("lastName"); + openapiFields.add("email"); + openapiFields.add("password"); + openapiFields.add("phone"); + openapiFields.add("userStatus"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to User + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (User.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java index 197aac987bc6..3bdccb19d382 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java @@ -27,6 +27,25 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * XmlItem */ @@ -983,5 +1002,117 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("attribute_string"); + openapiFields.add("attribute_number"); + openapiFields.add("attribute_integer"); + openapiFields.add("attribute_boolean"); + openapiFields.add("wrapped_array"); + openapiFields.add("name_string"); + openapiFields.add("name_number"); + openapiFields.add("name_integer"); + openapiFields.add("name_boolean"); + openapiFields.add("name_array"); + openapiFields.add("name_wrapped_array"); + openapiFields.add("prefix_string"); + openapiFields.add("prefix_number"); + openapiFields.add("prefix_integer"); + openapiFields.add("prefix_boolean"); + openapiFields.add("prefix_array"); + openapiFields.add("prefix_wrapped_array"); + openapiFields.add("namespace_string"); + openapiFields.add("namespace_number"); + openapiFields.add("namespace_integer"); + openapiFields.add("namespace_boolean"); + openapiFields.add("namespace_array"); + openapiFields.add("namespace_wrapped_array"); + openapiFields.add("prefix_ns_string"); + openapiFields.add("prefix_ns_number"); + openapiFields.add("prefix_ns_integer"); + openapiFields.add("prefix_ns_boolean"); + openapiFields.add("prefix_ns_array"); + openapiFields.add("prefix_ns_wrapped_array"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to XmlItem + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (XmlItem.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in XmlItem is not found in the empty JSON string", XmlItem.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!XmlItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `XmlItem` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!XmlItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'XmlItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(XmlItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, XmlItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public XmlItem read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of XmlItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of XmlItem + * @throws IOException if the JSON string is invalid with respect to XmlItem + */ + public static XmlItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, XmlItem.class); + } + + /** + * Convert an instance of XmlItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.gitignore b/samples/client/petstore/java/okhttp-gson-nextgen/.gitignore deleted file mode 100644 index a530464afa1b..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear - -# exclude jar for gradle wrapper -!gradle/wrapper/*.jar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -# build files -**/target -target -.gradle -build diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator-ignore b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator-ignore deleted file mode 100644 index 6ba435b5655f..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator-ignore +++ /dev/null @@ -1,14 +0,0 @@ -# OpenAPI Generator Ignore -# These tests are "live" tests and should not be overwritten -src/test/java/org/openapitools/client/StringUtilTest.java -src/test/java/org/openapitools/client/ApiClientTest.java -src/test/java/org/openapitools/client/ConfigurationTest.java -src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java -src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java -src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java -src/test/java/org/openapitools/client/model/EnumValueTest.java -src/test/java/org/openapitools/client/model/PetTest.java -src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/client/JSONTest.java -src/test/java/org/openapitools/client/api/PetApiTest.java - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES deleted file mode 100644 index 7d6260c63b18..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES +++ /dev/null @@ -1,199 +0,0 @@ -.gitignore -.travis.yml -README.md -api/openapi.yaml -build.gradle -build.sbt -docs/AdditionalPropertiesClass.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/Apple.md -docs/AppleReq.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Banana.md -docs/BananaReq.md -docs/BasquePig.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/ComplexQuadrilateral.md -docs/DanishPig.md -docs/DefaultApi.md -docs/DeprecatedObject.md -docs/Dog.md -docs/DogAllOf.md -docs/Drawing.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/EquilateralTriangle.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/Foo.md -docs/FormatTest.md -docs/Fruit.md -docs/FruitReq.md -docs/GmFruit.md -docs/GrandparentAnimal.md -docs/HasOnlyReadOnly.md -docs/HealthCheckResult.md -docs/InlineResponseDefault.md -docs/IsoscelesTriangle.md -docs/Mammal.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelApiResponse.md -docs/ModelFile.md -docs/ModelList.md -docs/ModelReturn.md -docs/Name.md -docs/NullableClass.md -docs/NullableShape.md -docs/NumberOnly.md -docs/ObjectWithDeprecatedFields.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/OuterEnumDefaultValue.md -docs/OuterEnumInteger.md -docs/OuterEnumIntegerDefaultValue.md -docs/ParentPet.md -docs/Pet.md -docs/PetApi.md -docs/PetWithRequiredTags.md -docs/Pig.md -docs/Quadrilateral.md -docs/QuadrilateralInterface.md -docs/ReadOnlyFirst.md -docs/ScaleneTriangle.md -docs/Shape.md -docs/ShapeInterface.md -docs/ShapeOrNull.md -docs/SimpleQuadrilateral.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/Triangle.md -docs/TriangleInterface.md -docs/User.md -docs/UserApi.md -docs/Whale.md -docs/Zebra.md -git_push.sh -gradle.properties -gradle/wrapper/gradle-wrapper.jar -gradle/wrapper/gradle-wrapper.properties -gradlew -gradlew.bat -pom.xml -settings.gradle -src/main/AndroidManifest.xml -src/main/java/org/openapitools/client/ApiCallback.java -src/main/java/org/openapitools/client/ApiClient.java -src/main/java/org/openapitools/client/ApiException.java -src/main/java/org/openapitools/client/ApiResponse.java -src/main/java/org/openapitools/client/Configuration.java -src/main/java/org/openapitools/client/GzipRequestInterceptor.java -src/main/java/org/openapitools/client/JSON.java -src/main/java/org/openapitools/client/Pair.java -src/main/java/org/openapitools/client/ProgressRequestBody.java -src/main/java/org/openapitools/client/ProgressResponseBody.java -src/main/java/org/openapitools/client/ServerConfiguration.java -src/main/java/org/openapitools/client/ServerVariable.java -src/main/java/org/openapitools/client/StringUtil.java -src/main/java/org/openapitools/client/api/AnotherFakeApi.java -src/main/java/org/openapitools/client/api/DefaultApi.java -src/main/java/org/openapitools/client/api/FakeApi.java -src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java -src/main/java/org/openapitools/client/api/PetApi.java -src/main/java/org/openapitools/client/api/StoreApi.java -src/main/java/org/openapitools/client/api/UserApi.java -src/main/java/org/openapitools/client/auth/ApiKeyAuth.java -src/main/java/org/openapitools/client/auth/Authentication.java -src/main/java/org/openapitools/client/auth/HttpBasicAuth.java -src/main/java/org/openapitools/client/auth/HttpBearerAuth.java -src/main/java/org/openapitools/client/auth/OAuth.java -src/main/java/org/openapitools/client/auth/OAuthFlow.java -src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java -src/main/java/org/openapitools/client/auth/RetryingOAuth.java -src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java -src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/client/model/Animal.java -src/main/java/org/openapitools/client/model/Apple.java -src/main/java/org/openapitools/client/model/AppleReq.java -src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/client/model/ArrayTest.java -src/main/java/org/openapitools/client/model/Banana.java -src/main/java/org/openapitools/client/model/BananaReq.java -src/main/java/org/openapitools/client/model/BasquePig.java -src/main/java/org/openapitools/client/model/Capitalization.java -src/main/java/org/openapitools/client/model/Cat.java -src/main/java/org/openapitools/client/model/CatAllOf.java -src/main/java/org/openapitools/client/model/Category.java -src/main/java/org/openapitools/client/model/ClassModel.java -src/main/java/org/openapitools/client/model/Client.java -src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java -src/main/java/org/openapitools/client/model/DanishPig.java -src/main/java/org/openapitools/client/model/DeprecatedObject.java -src/main/java/org/openapitools/client/model/Dog.java -src/main/java/org/openapitools/client/model/DogAllOf.java -src/main/java/org/openapitools/client/model/Drawing.java -src/main/java/org/openapitools/client/model/EnumArrays.java -src/main/java/org/openapitools/client/model/EnumClass.java -src/main/java/org/openapitools/client/model/EnumTest.java -src/main/java/org/openapitools/client/model/EquilateralTriangle.java -src/main/java/org/openapitools/client/model/Foo.java -src/main/java/org/openapitools/client/model/FormatTest.java -src/main/java/org/openapitools/client/model/Fruit.java -src/main/java/org/openapitools/client/model/FruitReq.java -src/main/java/org/openapitools/client/model/GmFruit.java -src/main/java/org/openapitools/client/model/GrandparentAnimal.java -src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/client/model/HealthCheckResult.java -src/main/java/org/openapitools/client/model/InlineResponseDefault.java -src/main/java/org/openapitools/client/model/IsoscelesTriangle.java -src/main/java/org/openapitools/client/model/Mammal.java -src/main/java/org/openapitools/client/model/MapTest.java -src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/client/model/Model200Response.java -src/main/java/org/openapitools/client/model/ModelApiResponse.java -src/main/java/org/openapitools/client/model/ModelFile.java -src/main/java/org/openapitools/client/model/ModelList.java -src/main/java/org/openapitools/client/model/ModelReturn.java -src/main/java/org/openapitools/client/model/Name.java -src/main/java/org/openapitools/client/model/NullableClass.java -src/main/java/org/openapitools/client/model/NullableShape.java -src/main/java/org/openapitools/client/model/NumberOnly.java -src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java -src/main/java/org/openapitools/client/model/Order.java -src/main/java/org/openapitools/client/model/OuterComposite.java -src/main/java/org/openapitools/client/model/OuterEnum.java -src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java -src/main/java/org/openapitools/client/model/OuterEnumInteger.java -src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java -src/main/java/org/openapitools/client/model/ParentPet.java -src/main/java/org/openapitools/client/model/Pet.java -src/main/java/org/openapitools/client/model/PetWithRequiredTags.java -src/main/java/org/openapitools/client/model/Pig.java -src/main/java/org/openapitools/client/model/Quadrilateral.java -src/main/java/org/openapitools/client/model/QuadrilateralInterface.java -src/main/java/org/openapitools/client/model/ReadOnlyFirst.java -src/main/java/org/openapitools/client/model/ScaleneTriangle.java -src/main/java/org/openapitools/client/model/Shape.java -src/main/java/org/openapitools/client/model/ShapeInterface.java -src/main/java/org/openapitools/client/model/ShapeOrNull.java -src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java -src/main/java/org/openapitools/client/model/SpecialModelName.java -src/main/java/org/openapitools/client/model/Tag.java -src/main/java/org/openapitools/client/model/Triangle.java -src/main/java/org/openapitools/client/model/TriangleInterface.java -src/main/java/org/openapitools/client/model/User.java -src/main/java/org/openapitools/client/model/Whale.java -src/main/java/org/openapitools/client/model/Zebra.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION deleted file mode 100644 index 5f68295fc196..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.travis.yml b/samples/client/petstore/java/okhttp-gson-nextgen/.travis.yml deleted file mode 100644 index 1b6741c083c7..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -# -# Generated by OpenAPI Generator: https://openapi-generator.tech -# -# Ref: https://docs.travis-ci.com/user/languages/java/ -# -language: java -jdk: - - openjdk12 - - openjdk11 - - openjdk10 - - openjdk9 - - openjdk8 -before_install: - # ensure gradlew has proper permission - - chmod a+x ./gradlew -script: - # test using maven - #- mvn test - # test using gradle - - gradle test - # test using sbt - # - sbt test diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/README.md b/samples/client/petstore/java/okhttp-gson-nextgen/README.md deleted file mode 100644 index cebd6c204682..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/README.md +++ /dev/null @@ -1,278 +0,0 @@ -# petstore-okhttp-gson-nextgen - -OpenAPI Petstore -- API version: 1.0.0 - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - - -*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* - - -## Requirements - -Building the API client library requires: -1. Java 1.7+ -2. Maven (3.8.3+)/Gradle (7.2+) - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn clean install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn clean deploy -``` - -Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - org.openapitools - petstore-okhttp-gson-nextgen - 1.0.0 - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy - repositories { - mavenCentral() // Needed if the 'petstore-okhttp-gson-nextgen' jar has been published to maven central. - mavenLocal() // Needed if the 'petstore-okhttp-gson-nextgen' jar has been published to the local maven repo. - } - - dependencies { - implementation "org.openapitools:petstore-okhttp-gson-nextgen:1.0.0" - } -``` - -### Others - -At first generate the JAR by executing: - -```shell -mvn clean package -``` - -Then manually install the following JARs: - -* `target/petstore-okhttp-gson-nextgen-1.0.0.jar` -* `target/lib/*.jar` - -## Getting Started - -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java - -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.AnotherFakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); - Client client = new Client(); // Client | client model - try { - Client result = apiInstance.call123testSpecialTags(client); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags -*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | -*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | -*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | -*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums -*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | -*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - -## Documentation for Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [Apple](docs/Apple.md) - - [AppleReq](docs/AppleReq.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Banana](docs/Banana.md) - - [BananaReq](docs/BananaReq.md) - - [BasquePig](docs/BasquePig.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) - - [DanishPig](docs/DanishPig.md) - - [DeprecatedObject](docs/DeprecatedObject.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [Drawing](docs/Drawing.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [EquilateralTriangle](docs/EquilateralTriangle.md) - - [Foo](docs/Foo.md) - - [FormatTest](docs/FormatTest.md) - - [Fruit](docs/Fruit.md) - - [FruitReq](docs/FruitReq.md) - - [GmFruit](docs/GmFruit.md) - - [GrandparentAnimal](docs/GrandparentAnimal.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/HealthCheckResult.md) - - [InlineResponseDefault](docs/InlineResponseDefault.md) - - [IsoscelesTriangle](docs/IsoscelesTriangle.md) - - [Mammal](docs/Mammal.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelApiResponse](docs/ModelApiResponse.md) - - [ModelFile](docs/ModelFile.md) - - [ModelList](docs/ModelList.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NullableClass](docs/NullableClass.md) - - [NullableShape](docs/NullableShape.md) - - [NumberOnly](docs/NumberOnly.md) - - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [OuterEnumInteger](docs/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - - [ParentPet](docs/ParentPet.md) - - [Pet](docs/Pet.md) - - [PetWithRequiredTags](docs/PetWithRequiredTags.md) - - [Pig](docs/Pig.md) - - [Quadrilateral](docs/Quadrilateral.md) - - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [ScaleneTriangle](docs/ScaleneTriangle.md) - - [Shape](docs/Shape.md) - - [ShapeInterface](docs/ShapeInterface.md) - - [ShapeOrNull](docs/ShapeOrNull.md) - - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Tag](docs/Tag.md) - - [Triangle](docs/Triangle.md) - - [TriangleInterface](docs/TriangleInterface.md) - - [User](docs/User.md) - - [Whale](docs/Whale.md) - - [Zebra](docs/Zebra.md) - - -## Documentation for Authorization - -Authentication schemes defined for the API: -### 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 - -### bearer_test - -- **Type**: HTTP basic authentication - -### http_basic_test - -- **Type**: HTTP basic authentication - -### http_signature_test - -- **Type**: HTTP basic authentication - -### 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 - - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml deleted file mode 100644 index ecee30d7d093..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml +++ /dev/null @@ -1,2468 +0,0 @@ -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: - " \' - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- description: petstore server - url: http://{server}.swagger.io:{port}/v2 - variables: - server: - default: petstore - enum: - - petstore - - qa-petstore - - dev-petstore - port: - default: "80" - enum: - - "80" - - "8080" -- description: The local server - url: https://localhost:8080/{version} - variables: - version: - default: v2 - enum: - - v1 - - v2 -- description: The local server without variables - url: https://127.0.0.1/no_variable -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /foo: - get: - responses: - default: - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_default' - description: response - x-accepts: application/json - /pet: - post: - operationId: addPet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "405": - description: Invalid input - security: - - http_signature_test: [] - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-contentType: application/json - x-accepts: application/json - put: - operationId: updatePet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "400": - description: Invalid ID supplied - "404": - description: Pet not found - "405": - description: Validation exception - security: - - http_signature_test: [] - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-contentType: application/json - x-accepts: application/json - servers: - - url: http://petstore.swagger.io/v2 - - url: http://path-server-test.petstore.local/v2 - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - deprecated: true - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - description: Invalid status value - security: - - http_signature_test: [] - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-accepts: application/json - /pet/findByTags: - get: - deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - description: Invalid tag value - security: - - http_signature_test: [] - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-accepts: application/json - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - explode: false - in: header - name: api_key - required: false - schema: - type: string - style: simple - - description: Pet id to delete - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "400": - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - description: Invalid ID supplied - "404": - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-accepts: application/json - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object' - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - responses: - "405": - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object_1' - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - "200": - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - x-accepts: application/json - /store/order: - post: - operationId: placeOrder - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-contentType: application/json - x-accepts: application/json - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - explode: false - in: path - name: order_id - required: true - schema: - type: string - style: simple - responses: - "400": - description: Invalid ID supplied - "404": - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - explode: false - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - style: simple - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - description: Invalid ID supplied - "404": - description: Order not found - summary: Find purchase order by ID - tags: - - store - x-accepts: application/json - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - description: successful operation - summary: Create user - tags: - - user - x-contentType: application/json - x-accepts: application/json - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-contentType: application/json - x-accepts: application/json - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-contentType: application/json - x-accepts: application/json - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - explode: true - in: query - name: username - required: true - schema: - type: string - style: form - - description: The password for login in clear text - explode: true - in: query - name: password - required: true - schema: - type: string - style: form - responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - explode: false - schema: - format: int32 - type: integer - style: simple - X-Expires-After: - description: date in UTC when token expires - explode: false - schema: - format: date-time - type: string - style: simple - "400": - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - /user/logout: - get: - operationId: logoutUser - responses: - default: - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - "400": - description: Invalid username supplied - "404": - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - description: Invalid username supplied - "404": - description: User not found - summary: Get user by user name - tags: - - user - x-accepts: application/json - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - description: Invalid user supplied - "404": - description: User not found - summary: Updated user - tags: - - user - x-contentType: application/json - x-accepts: application/json - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-contentType: application/json - x-accepts: application/json - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - explode: true - in: query - name: required_string_group - required: true - schema: - type: integer - style: form - - description: Required Boolean in group parameters - explode: false - in: header - name: required_boolean_group - required: true - schema: - type: boolean - style: simple - - description: Required Integer in group parameters - explode: true - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - style: form - - description: String in group parameters - explode: true - in: query - name: string_group - required: false - schema: - type: integer - style: form - - description: Boolean in group parameters - explode: false - in: header - name: boolean_group - required: false - schema: - type: boolean - style: simple - - description: Integer in group parameters - explode: true - in: query - name: int64_group - required: false - schema: - format: int64 - type: integer - style: form - responses: - "400": - description: Someting wrong - security: - - bearer_test: [] - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - explode: false - in: header - name: enum_header_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: simple - - description: Query parameter enum test (string array) - explode: true - in: query - name: enum_query_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - explode: true - in: query - name: enum_query_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_integer - required: false - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_double - required: false - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - style: form - requestBody: - $ref: '#/components/requestBodies/inline_object_2' - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - responses: - "400": - description: Invalid request - "404": - description: Not found - summary: To test enum parameters - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-contentType: application/json - x-accepts: application/json - post: - description: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - $ref: '#/components/requestBodies/inline_object_3' - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - default: 2010-02-01T10:20:10.11111+01:00 - description: None - example: 2020-02-02T20:20:20.22222Z - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - responses: - "400": - description: Invalid username supplied - "404": - description: User not found - security: - - http_basic_test: [] - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-contentType: application/json - x-accepts: '*/*' - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-contentType: application/json - x-accepts: '*/*' - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-contentType: application/json - x-accepts: '*/*' - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-contentType: application/json - x-accepts: '*/*' - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - $ref: '#/components/requestBodies/inline_object_4' - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - responses: - "200": - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-contentType: application/json - x-accepts: application/json - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - explode: true - in: query - name: query - required: true - schema: - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - description: Success - tags: - - fake - x-contentType: application/json - x-accepts: application/json - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-contentType: application/json - x-accepts: application/json - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: true - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - description: Success - tags: - - fake - x-accepts: application/json - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object_5' - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - /fake/health: - get: - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/HealthCheckResult' - description: The instance started successfully - summary: Health check endpoint - tags: - - fake - x-accepts: application/json - /fake/array-of-enums: - get: - operationId: getArrayOfEnums - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ArrayOfEnums' - description: Got named array of enums - summary: Array of Enums - tags: - - fake - x-accepts: application/json -components: - requestBodies: - UserArray: - content: - application/json: - examples: - simple-list: - description: Should not get into code examples - summary: Simple list example - value: - - username: foo - - username: bar - schema: - items: - $ref: '#/components/schemas/User' - type: array - 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 - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' - schemas: - Foo: - example: - bar: bar - properties: - bar: - default: bar - type: string - type: object - Bar: - default: bar - type: string - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2020-02-02T20:20:20.000222Z - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - example: 2020-02-02T20:20:20.000222Z - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - objectWithNoDeclaredPropsNullable: '{}' - phone: phone - objectWithNoDeclaredProps: '{}' - id: 0 - anyTypePropNullable: "" - email: email - anyTypeProp: "" - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - objectWithNoDeclaredProps: - description: test code generation for objects Value must be a map of strings - to values. It cannot be the 'null' value. - type: object - objectWithNoDeclaredPropsNullable: - description: test code generation for nullable objects. Value must be a - map of strings to values or the 'null' value. - nullable: true - type: object - anyTypeProp: - description: test code generation for any type Here the 'type' attribute - is not specified, which means the value can be anything, including the - null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 - anyTypePropNullable: - description: test code generation for any type Here the 'type' attribute - is not specified, which means the value can be anything, including the - null value, string, number, boolean, array or object. The 'nullable' attribute - does not change the allowed values. - nullable: true - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - 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' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Address' - - $ref: '#/components/schemas/Cat_allOf' - Address: - additionalProperties: - type: integer - type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - multipleOf: 2 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - multipleOf: 32.5 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - decimal: - format: number - type: string - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - type: string - binary: - format: binary - type: string - date: - example: 2020-02-02 - format: date - type: string - dateTime: - example: 2007-12-03T10:15:30+01:00 - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - pattern_with_digits: - description: A string that is a 10 digit number. Can have leading zeros. - pattern: ^\d{10}$ - type: string - pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one - to three digits following i.e. Image_01. - pattern: /^image_\d{1,3}$/i - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_integer_only: - enum: - - 2 - - -2 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - outerEnumInteger: - $ref: '#/components/schemas/OuterEnumInteger' - outerEnumDefaultValue: - $ref: '#/components/schemas/OuterEnumDefaultValue' - outerEnumIntegerDefaultValue: - $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - anytype_1: {} - map_with_undeclared_properties_anytype_1: - type: object - map_with_undeclared_properties_anytype_2: - properties: {} - type: object - map_with_undeclared_properties_anytype_3: - additionalProperties: true - type: object - empty_map: - additionalProperties: false - description: an object with no declared properties and no undeclared properties, - hence it's an empty map. - type: object - map_with_undeclared_properties_string: - additionalProperties: - type: string - type: object - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - 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 - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - nullable: true - type: string - OuterEnumInteger: - enum: - - 0 - - 1 - - 2 - type: integer - OuterEnumDefaultValue: - default: placed - enum: - - placed - - approved - - delivered - type: string - OuterEnumIntegerDefaultValue: - default: 0 - enum: - - 0 - - 1 - - 2 - type: integer - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - File: - description: Must be named `File` for test. - properties: - sourceURI: - description: Test capitalization - type: string - type: object - _special_model.name_: - properties: - $special[property.name]: - format: int64 - type: integer - _special_model.name_: - type: string - xml: - name: $special[model.name] - HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable - in hope to get it as pointer in generated model. - example: - NullableMessage: NullableMessage - properties: - NullableMessage: - nullable: true - type: string - type: object - NullableClass: - additionalProperties: - nullable: true - type: object - properties: - integer_prop: - nullable: true - type: integer - number_prop: - nullable: true - type: number - boolean_prop: - nullable: true - type: boolean - string_prop: - nullable: true - type: string - date_prop: - format: date - nullable: true - type: string - datetime_prop: - format: date-time - nullable: true - type: string - array_nullable_prop: - items: - type: object - nullable: true - type: array - array_and_items_nullable_prop: - items: - nullable: true - type: object - nullable: true - type: array - array_items_nullable: - items: - nullable: true - type: object - type: array - object_nullable_prop: - additionalProperties: - type: object - nullable: true - type: object - object_and_items_nullable_prop: - additionalProperties: - nullable: true - type: object - nullable: true - type: object - object_items_nullable: - additionalProperties: - nullable: true - type: object - type: object - type: object - fruit: - additionalProperties: false - oneOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' - properties: - color: - type: string - apple: - nullable: true - properties: - cultivar: - pattern: ^[a-zA-Z\s]*$ - type: string - origin: - pattern: /^[A-Z\s]*$/i - type: string - type: object - banana: - properties: - lengthCm: - type: number - type: object - mammal: - discriminator: - propertyName: className - oneOf: - - $ref: '#/components/schemas/whale' - - $ref: '#/components/schemas/zebra' - - $ref: '#/components/schemas/Pig' - whale: - properties: - hasBaleen: - type: boolean - hasTeeth: - type: boolean - className: - type: string - required: - - className - type: object - zebra: - additionalProperties: true - properties: - type: - enum: - - plains - - mountain - - grevys - type: string - className: - type: string - required: - - className - type: object - Pig: - discriminator: - propertyName: className - oneOf: - - $ref: '#/components/schemas/BasquePig' - - $ref: '#/components/schemas/DanishPig' - BasquePig: - properties: - className: - type: string - required: - - className - type: object - DanishPig: - properties: - className: - type: string - required: - - className - type: object - gmFruit: - additionalProperties: false - anyOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' - properties: - color: - type: string - fruitReq: - additionalProperties: false - oneOf: - - type: "null" - - $ref: '#/components/schemas/appleReq' - - $ref: '#/components/schemas/bananaReq' - appleReq: - additionalProperties: false - properties: - cultivar: - type: string - mealy: - type: boolean - required: - - cultivar - type: object - bananaReq: - additionalProperties: false - properties: - lengthCm: - type: number - sweet: - type: boolean - required: - - lengthCm - type: object - Drawing: - additionalProperties: - $ref: '#/components/schemas/fruit' - properties: - mainShape: - $ref: '#/components/schemas/Shape' - shapeOrNull: - $ref: '#/components/schemas/ShapeOrNull' - nullableShape: - $ref: '#/components/schemas/NullableShape' - shapes: - items: - $ref: '#/components/schemas/Shape' - type: array - type: object - Shape: - discriminator: - propertyName: shapeType - oneOf: - - $ref: '#/components/schemas/Triangle' - - $ref: '#/components/schemas/Quadrilateral' - ShapeOrNull: - description: The value may be a shape or the 'null' value. This is introduced - in OAS schema >= 3.1. - discriminator: - propertyName: shapeType - oneOf: - - type: "null" - - $ref: '#/components/schemas/Triangle' - - $ref: '#/components/schemas/Quadrilateral' - NullableShape: - description: The value may be a shape or the 'null' value. The 'nullable' attribute - was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema - >= 3.1. - discriminator: - propertyName: shapeType - nullable: true - oneOf: - - $ref: '#/components/schemas/Triangle' - - $ref: '#/components/schemas/Quadrilateral' - ShapeInterface: - properties: - shapeType: - type: string - required: - - shapeType - TriangleInterface: - properties: - triangleType: - type: string - required: - - triangleType - Triangle: - discriminator: - propertyName: triangleType - oneOf: - - $ref: '#/components/schemas/EquilateralTriangle' - - $ref: '#/components/schemas/IsoscelesTriangle' - - $ref: '#/components/schemas/ScaleneTriangle' - EquilateralTriangle: - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/TriangleInterface' - IsoscelesTriangle: - additionalProperties: false - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/TriangleInterface' - ScaleneTriangle: - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/TriangleInterface' - QuadrilateralInterface: - properties: - quadrilateralType: - type: string - required: - - quadrilateralType - Quadrilateral: - discriminator: - propertyName: quadrilateralType - oneOf: - - $ref: '#/components/schemas/SimpleQuadrilateral' - - $ref: '#/components/schemas/ComplexQuadrilateral' - SimpleQuadrilateral: - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/QuadrilateralInterface' - ComplexQuadrilateral: - allOf: - - $ref: '#/components/schemas/ShapeInterface' - - $ref: '#/components/schemas/QuadrilateralInterface' - GrandparentAnimal: - discriminator: - propertyName: pet_type - properties: - pet_type: - type: string - required: - - pet_type - type: object - ParentPet: - allOf: - - $ref: '#/components/schemas/GrandparentAnimal' - type: object - ArrayOfEnums: - items: - $ref: '#/components/schemas/OuterEnum' - type: array - DateTimeTest: - default: 2010-01-01T10:10:10.000111+01:00 - example: 2010-01-01T10:10:10.000111+01:00 - format: date-time - type: string - DeprecatedObject: - deprecated: true - properties: - name: - type: string - type: object - ObjectWithDeprecatedFields: - properties: - uuid: - type: string - id: - deprecated: true - type: number - deprecatedRef: - $ref: '#/components/schemas/DeprecatedObject' - bars: - deprecated: true - items: - $ref: '#/components/schemas/Bar' - type: array - type: object - PetWithRequiredTags: - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - - tags - type: object - xml: - name: Pet - inline_response_default: - example: - string: - bar: bar - properties: - string: - $ref: '#/components/schemas/Foo' - type: object - inline_object: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - inline_object_1: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - inline_object_2: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - inline_object_3: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - default: 2010-02-01T10:20:10.11111+01:00 - description: None - example: 2020-02-02T20:20:20.22222Z - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - inline_object_4: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - inline_object_5: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http - bearer_test: - bearerFormat: JWT - scheme: bearer - type: http - http_signature_test: - scheme: signature - type: http - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/build.gradle b/samples/client/petstore/java/okhttp-gson-nextgen/build.gradle deleted file mode 100644 index e73647ffcb63..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/build.gradle +++ /dev/null @@ -1,153 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' -apply plugin: 'java' -apply plugin: 'com.diffplug.spotless' - -group = 'org.openapitools' -version = '1.0.0' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' - } -} - -repositories { - mavenCentral() -} -sourceSets { - main.java.srcDirs = ['src/main/java'] -} - -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven-publish' - - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - - publishing { - publications { - maven(MavenPublication) { - artifactId = 'petstore-okhttp-gson-nextgen' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - jakarta_annotation_version = "1.3.5" -} - -dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' - implementation 'org.openapitools:jackson-databind-nullable:0.2.1' - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - implementation 'org.threeten:threetenbp:1.4.3' - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:3.11.2' -} - -javadoc { - options.tags = [ "http.response.details:a:Http Response Details" ] -} - -// Use spotless plugin to automatically format code, remove unused import, etc -// To apply changes directly to the file, run `gradlew spotlessApply` -// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle -spotless { - // comment out below to run spotless as part of the `check` task - enforceCheck false - - format 'misc', { - // define the files (e.g. '*.gradle', '*.md') to apply `misc` to - target '.gitignore' - - // define the steps to apply to those files - trimTrailingWhitespace() - indentWithSpaces() // Takes an integer argument if you don't like 4 - endWithNewline() - } - java { - // don't need to set target, it is inferred from java - - // apply a specific flavor of google-java-format - googleJavaFormat('1.8').aosp().reflowLongStrings() - - removeUnusedImports() - importOrder() - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt b/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt deleted file mode 100644 index 504c16ccb001..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt +++ /dev/null @@ -1,27 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "org.openapitools", - name := "petstore-okhttp-gson-nextgen", - version := "1.0.0", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index 7bbe63d23f80..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AdditionalPropertiesAnyType - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesArray.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesArray.md deleted file mode 100644 index bdbf2962f201..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AdditionalPropertiesArray - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index 81aeb9ae1e78..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AdditionalPropertiesBoolean - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 3d032d4504ad..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# AdditionalPropertiesClass - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **Map<String, String>** | | [optional] -**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] -**anytype1** | **Object** | | [optional] -**mapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] -**mapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] -**mapWithUndeclaredPropertiesAnytype3** | **Map<String, Object>** | | [optional] -**emptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] -**mapWithUndeclaredPropertiesString** | **Map<String, String>** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index ae3391237145..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AdditionalPropertiesInteger - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 8f414ad02fdc..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AdditionalPropertiesNumber - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesObject.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesObject.md deleted file mode 100644 index 41892793f0b0..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AdditionalPropertiesObject - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesString.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesString.md deleted file mode 100644 index a2dfbc116f9b..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AdditionalPropertiesString - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Animal.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Animal.md deleted file mode 100644 index 7edc25cd2b04..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Animal.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# Animal - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnimalFarm.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce6..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md deleted file mode 100644 index af82f73feb62..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md +++ /dev/null @@ -1,67 +0,0 @@ -# AnotherFakeApi - -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** -> Client call123testSpecialTags(client) - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.AnotherFakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); - Client client = new Client(); // Client | client model - try { - Client result = apiInstance.call123testSpecialTags(client); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 9b1f85869990..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# ArrayOfArrayOfNumberOnly - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 4e95f1ae74ef..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# ArrayOfNumberOnly - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **List<BigDecimal>** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayTest.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayTest.md deleted file mode 100644 index 9b90810fc286..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayTest.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# ArrayTest - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **List<String>** | | [optional] -**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] -**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCat.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCat.md deleted file mode 100644 index 020fbc787d81..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCat.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# BigCat - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | [**KindEnum**](#KindEnum) | | [optional] - - - -## Enum: KindEnum - -Name | Value ----- | ----- -LIONS | "lions" -TIGERS | "tigers" -LEOPARDS | "leopards" -JAGUARS | "jaguars" - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCatAllOf.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCatAllOf.md deleted file mode 100644 index 2bcace910ec8..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCatAllOf.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# BigCatAllOf - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | [**KindEnum**](#KindEnum) | | [optional] - - - -## Enum: KindEnum - -Name | Value ----- | ----- -LIONS | "lions" -TIGERS | "tigers" -LEOPARDS | "leopards" -JAGUARS | "jaguars" - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Capitalization.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Capitalization.md deleted file mode 100644 index ad8939b744cd..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Capitalization.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# Capitalization - - -## 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] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Cat.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Cat.md deleted file mode 100644 index 87a3ab44a396..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Cat.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# Cat - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Boolean** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/CatAllOf.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/CatAllOf.md deleted file mode 100644 index 3fd01aaebfc9..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/CatAllOf.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CatAllOf - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Boolean** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Category.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Category.md deleted file mode 100644 index d03ffbfd06f9..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Category.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# Category - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ClassModel.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ClassModel.md deleted file mode 100644 index 04beba3384a1..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ClassModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ClassModel - -Model for testing model with \"_class\" property - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertyClass** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Client.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Client.md deleted file mode 100644 index 125a20b3fcee..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Client.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# Client - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Dog.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Dog.md deleted file mode 100644 index f4ba57fa3b86..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Dog.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# Dog - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DogAllOf.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DogAllOf.md deleted file mode 100644 index 1f7e23d981b7..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DogAllOf.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# DogAllOf - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumArrays.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumArrays.md deleted file mode 100644 index 94505276726b..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumArrays.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# EnumArrays - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] -**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] - - - -## Enum: JustSymbolEnum - -Name | Value ----- | ----- -GREATER_THAN_OR_EQUAL_TO | ">=" -DOLLAR | "$" - - - -## Enum: List<ArrayEnumEnum> - -Name | Value ----- | ----- -FISH | "fish" -CRAB | "crab" - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumClass.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumClass.md deleted file mode 100644 index b314590a7591..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumClass.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# EnumClass - -## Enum - - -* `_ABC` (value: `"_abc"`) - -* `_EFG` (value: `"-efg"`) - -* `_XYZ_` (value: `"(xyz)"`) - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumTest.md deleted file mode 100644 index 342b462ccc06..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumTest.md +++ /dev/null @@ -1,68 +0,0 @@ - - -# EnumTest - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] -**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | -**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] -**enumIntegerOnly** | [**EnumIntegerOnlyEnum**](#EnumIntegerOnlyEnum) | | [optional] -**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | **OuterEnum** | | [optional] -**outerEnumInteger** | **OuterEnumInteger** | | [optional] -**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] -**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] - - - -## Enum: EnumStringEnum - -Name | Value ----- | ----- -UPPER | "UPPER" -LOWER | "lower" -EMPTY | "" - - - -## Enum: EnumStringRequiredEnum - -Name | Value ----- | ----- -UPPER | "UPPER" -LOWER | "lower" -EMPTY | "" - - - -## Enum: EnumIntegerEnum - -Name | Value ----- | ----- -NUMBER_1 | 1 -NUMBER_MINUS_1 | -1 - - - -## Enum: EnumIntegerOnlyEnum - -Name | Value ----- | ----- -NUMBER_2 | 2 -NUMBER_MINUS_2 | -2 - - - -## Enum: EnumNumberEnum - -Name | Value ----- | ----- -NUMBER_1_DOT_1 | 1.1 -NUMBER_MINUS_1_DOT_2 | -1.2 - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md deleted file mode 100644 index 505117ba63fa..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md +++ /dev/null @@ -1,888 +0,0 @@ -# FakeApi - -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 -[**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 | -[**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums -[**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 -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - try { - HealthCheckResult result = apiInstance.fakeHealthGet(); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### 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 - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The instance started successfully | - | - - -# **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) - - - -Test serialization of outer boolean types - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - Boolean body = true; // Boolean | Input boolean as post body - try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Boolean**| Input boolean as post body | [optional] - -### Return type - -**Boolean** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output boolean | - | - - -# **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(outerComposite) - - - -Test serialization of object with outer number type - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body - try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### 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**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output composite | - | - - -# **fakeOuterNumberSerialize** -> BigDecimal fakeOuterNumberSerialize(body) - - - -Test serialization of outer number types - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body - try { - BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **BigDecimal**| Input number as post body | [optional] - -### Return type - -[**BigDecimal**](BigDecimal.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output number | - | - - -# **fakeOuterStringSerialize** -> String fakeOuterStringSerialize(body) - - - -Test serialization of outer string types - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - String body = "body_example"; // String | Input string as post body - try { - String result = apiInstance.fakeOuterStringSerialize(body); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### 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**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output string | - | - - -# **getArrayOfEnums** -> List<OuterEnum> getArrayOfEnums() - -Array of Enums - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - try { - List result = apiInstance.getArrayOfEnums(); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List<OuterEnum>**](OuterEnum.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Got named array of enums | - | - - -# **testBodyWithQueryParams** -> testBodyWithQueryParams(query, user) - - - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - String query = "query_example"; // String | - User user = new User(); // User | - try { - apiInstance.testBodyWithQueryParams(query, user); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String**| | - **user** | [**User**](User.md)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - - -# **testClientModel** -> Client testClientModel(client) - -To test \"client\" model - -To test \"client\" model - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - Client client = new Client(); // Client | client model - try { - Client result = apiInstance.testClientModel(client); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - - -# **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure HTTP basic authorization: http_basic_test - HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); - http_basic_test.setUsername("YOUR USERNAME"); - http_basic_test.setPassword("YOUR PASSWORD"); - - FakeApi apiInstance = new FakeApi(defaultClient); - BigDecimal number = new BigDecimal(78); // BigDecimal | None - Double _double = 3.4D; // Double | None - String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None - byte[] _byte = null; // byte[] | None - Integer integer = 56; // Integer | None - Integer int32 = 56; // Integer | None - Long int64 = 56L; // Long | None - Float _float = 3.4F; // Float | None - String string = "string_example"; // String | None - File binary = new File("/path/to/file"); // File | None - LocalDate date = LocalDate.now(); // LocalDate | None - OffsetDateTime dateTime = OffsetDateTime.parse("OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))"); // OffsetDateTime | None - String password = "password_example"; // String | None - String paramCallback = "paramCallback_example"; // String | None - try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **File**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] [default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] - -### Return type - -null (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 - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - - -# **testEnumParameters** -> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) - -To test enum parameters - -To test enum parameters - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "_abc"; // String | Header parameter enum test (string) - List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "_abc"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) - List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) - String enumFormString = "_abc"; // String | Form parameter enum test (string) - try { - apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid request | - | -**404** | Not found | - | - - -# **testGroupParameters** -> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute(); - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure HTTP bearer authorization: bearer_test - HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); - bearer_test.setBearerToken("BEARER TOKEN"); - - FakeApi apiInstance = new FakeApi(defaultClient); - Integer requiredStringGroup = 56; // Integer | Required String in group parameters - Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters - Long requiredInt64Group = 56L; // Long | Required Integer in group parameters - Integer stringGroup = 56; // Integer | String in group parameters - Boolean booleanGroup = true; // Boolean | Boolean in group parameters - Long int64Group = 56L; // Long | Integer in group parameters - try { - apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) - .stringGroup(stringGroup) - .booleanGroup(booleanGroup) - .int64Group(int64Group) - .execute(); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **Integer**| Required String in group parameters | - **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | - **requiredInt64Group** | **Long**| Required Integer in group parameters | - **stringGroup** | **Integer**| String in group parameters | [optional] - **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] - **int64Group** | **Long**| Integer in group parameters | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Someting wrong | - | - - -# **testInlineAdditionalProperties** -> testInlineAdditionalProperties(requestBody) - -test inline additionalProperties - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - Map requestBody = new HashMap(); // Map | request body - try { - apiInstance.testInlineAdditionalProperties(requestBody); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requestBody** | [**Map<String, String>**](String.md)| request body | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - - -# **testJsonFormData** -> testJsonFormData(param, param2) - -test json serialization of form data - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - String param = "param_example"; // String | field1 - String param2 = "param2_example"; // String | field2 - try { - apiInstance.testJsonFormData(param, param2); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - - -# **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - List pipe = Arrays.asList(); // List | - List ioutil = Arrays.asList(); // List | - List http = Arrays.asList(); // List | - List url = Arrays.asList(); // List | - List context = Arrays.asList(); // List | - try { - apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - } catch (ApiException e) { - - } - } -} -``` - -### 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)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 5212d7c77810..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,74 +0,0 @@ -# FakeClassnameTags123Api - -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** -> Client testClassname(client) - -To test class name in snake case - -To test class name in snake case - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeClassnameTags123Api; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure API key authorization: api_key_query - ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); - api_key_query.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key_query.setApiKeyPrefix("Token"); - - FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); - Client client = new Client(); // Client | client model - try { - Client result = apiInstance.testClassname(client); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FileSchemaTestClass.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FileSchemaTestClass.md deleted file mode 100644 index 2602dc746104..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# FileSchemaTestClass - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**java.io.File**](java.io.File.md) | | [optional] -**files** | [**List<java.io.File>**](java.io.File.md) | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FormatTest.md deleted file mode 100644 index 91da637f0880..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FormatTest.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# FormatTest - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Integer** | | [optional] -**int32** | **Integer** | | [optional] -**int64** | **Long** | | [optional] -**number** | **BigDecimal** | | -**_float** | **Float** | | [optional] -**_double** | **Double** | | [optional] -**decimal** | **BigDecimal** | | [optional] -**string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **File** | | [optional] -**date** | **LocalDate** | | -**dateTime** | **OffsetDateTime** | | [optional] -**uuid** | **UUID** | | [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] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/HasOnlyReadOnly.md deleted file mode 100644 index 6416f8f37158..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# HasOnlyReadOnly - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/MapTest.md deleted file mode 100644 index 16f3ab934496..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/MapTest.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# MapTest - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] -**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] -**directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | **Map<String, Boolean>** | | [optional] - - - -## Enum: Map<String, InnerEnum> - -Name | Value ----- | ----- -UPPER | "UPPER" -LOWER | "lower" - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index 8bc2ed1571fe..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# MixedPropertiesAndAdditionalPropertiesClass - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **UUID** | | [optional] -**dateTime** | **OffsetDateTime** | | [optional] -**map** | [**Map<String, Animal>**](Animal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Model200Response.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Model200Response.md deleted file mode 100644 index 91c45e494210..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Model200Response.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# Model200Response - -Model for testing model name starting with number - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | [optional] -**propertyClass** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelApiResponse.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelApiResponse.md deleted file mode 100644 index aca98405e375..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelApiResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# ModelApiResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md deleted file mode 100644 index 1282785e329d..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ModelFile - -Must be named `File` for test. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md deleted file mode 100644 index c838a6a72e4f..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# ModelList - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123list** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelReturn.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelReturn.md deleted file mode 100644 index 3684358a040f..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelReturn.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ModelReturn - -Model for testing reserved words - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Integer** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Name.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Name.md deleted file mode 100644 index 219628217ca1..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Name.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# Name - -Model for testing model name same as property name - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | -**snakeCase** | **Integer** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123number** | **Integer** | | [optional] [readonly] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/NumberOnly.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/NumberOnly.md deleted file mode 100644 index 26c0b18032ef..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/NumberOnly.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# NumberOnly - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **BigDecimal** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Order.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Order.md deleted file mode 100644 index fa708e882413..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Order.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# Order - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**petId** | **Long** | | [optional] -**quantity** | **Integer** | | [optional] -**shipDate** | **OffsetDateTime** | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] -**complete** | **Boolean** | | [optional] - - - -## Enum: StatusEnum - -Name | Value ----- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterComposite.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterComposite.md deleted file mode 100644 index 7274cb075938..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterComposite.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OuterComposite - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **BigDecimal** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Boolean** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnum.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnum.md deleted file mode 100644 index 1f9b723eb8e7..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnum.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OuterEnum - -## Enum - - -* `PLACED` (value: `"placed"`) - -* `APPROVED` (value: `"approved"`) - -* `DELIVERED` (value: `"delivered"`) - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pet.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pet.md deleted file mode 100644 index 8aab74536872..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pet.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# Pet - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **List<String>** | | -**tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - - - -## Enum: StatusEnum - -Name | Value ----- | ----- -AVAILABLE | "available" -PENDING | "pending" -SOLD | "sold" - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md deleted file mode 100644 index 35781873666d..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md +++ /dev/null @@ -1,594 +0,0 @@ -# PetApi - -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 -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store - try { - apiInstance.addPet(pet); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - Long petId = 56L; // Long | Pet id to delete - String apiKey = "apiKey_example"; // String | - try { - apiInstance.deletePet(petId, apiKey); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid pet value | - | - - -# **findPetsByStatus** -> List<Pet> findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - List status = Arrays.asList("available"); // List | Status values that need to be considered for filter - try { - List result = apiInstance.findPetsByStatus(status); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid status value | - | - - -# **findPetsByTags** -> List<Pet> findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by - try { - List result = apiInstance.findPetsByTags(tags); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid tag value | - | - - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); - - PetApi apiInstance = new PetApi(defaultClient); - Long petId = 56L; // Long | ID of pet to return - try { - Pet result = apiInstance.getPetById(petId); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| 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 - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | - - -# **updatePet** -> updatePet(pet) - -Update an existing pet - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store - try { - apiInstance.updatePet(pet); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | -**405** | Validation exception | - | - - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - Long petId = 56L; // Long | ID of pet that needs to be updated - String name = "name_example"; // String | Updated name of the pet - String status = "status_example"; // String | Updated status of the pet - try { - apiInstance.updatePetWithForm(petId, name, status); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| 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 - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - - -# **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, _file) - -uploads an image - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - Long petId = 56L; // Long | ID of pet to update - String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server - File _file = new File("/path/to/file"); // File | file to upload - try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **_file** | **File**| file to upload | [optional] - -### Return type - -[**ModelApiResponse**](ModelApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - - -# **uploadFileWithRequiredFile** -> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) - -uploads an image (required) - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - Long petId = 56L; // Long | ID of pet to update - File requiredFile = new File("/path/to/file"); // File | file to upload - String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server - try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **requiredFile** | **File**| file to upload | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - -### Return type - -[**ModelApiResponse**](ModelApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ReadOnlyFirst.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ReadOnlyFirst.md deleted file mode 100644 index a329bf4419a2..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ReadOnlyFirst - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/SpecialModelName.md deleted file mode 100644 index 352611142df0..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/SpecialModelName.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# SpecialModelName - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**$specialPropertyName** | **Long** | | [optional] -**specialModelName** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md deleted file mode 100644 index 8d9dee8e68fc..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md +++ /dev/null @@ -1,248 +0,0 @@ -# StoreApi - -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 -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.StoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - StoreApi apiInstance = new StoreApi(defaultClient); - String orderId = "orderId_example"; // String | ID of the order that needs to be deleted - try { - apiInstance.deleteOrder(orderId); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - - -# **getInventory** -> Map<String, Integer> getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; -import org.openapitools.client.api.StoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); - - StoreApi apiInstance = new StoreApi(defaultClient); - try { - Map result = apiInstance.getInventory(); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map<String, Integer>** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.StoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - StoreApi apiInstance = new StoreApi(defaultClient); - Long orderId = 56L; // Long | ID of pet that needs to be fetched - try { - Order result = apiInstance.getOrderById(orderId); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| 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 - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - - -# **placeOrder** -> Order placeOrder(order) - -Place an order for a pet - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.StoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - StoreApi apiInstance = new StoreApi(defaultClient); - Order order = new Order(); // Order | order placed for purchasing the pet - try { - Order result = apiInstance.placeOrder(order); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### 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 - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid Order | - | - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StringBooleanMap.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StringBooleanMap.md deleted file mode 100644 index cac7afc80e07..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StringBooleanMap.md +++ /dev/null @@ -1,9 +0,0 @@ - -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Tag.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Tag.md deleted file mode 100644 index 70d36f5d0d4d..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Tag.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# Tag - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderDefault.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderDefault.md deleted file mode 100644 index 8340befcae5c..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderDefault.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# TypeHolderDefault - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | -**numberItem** | **BigDecimal** | | -**integerItem** | **Integer** | | -**boolItem** | **Boolean** | | -**arrayItem** | **List<Integer>** | | - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderExample.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderExample.md deleted file mode 100644 index 2396fdf17653..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderExample.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# TypeHolderExample - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | -**numberItem** | **BigDecimal** | | -**floatItem** | **Float** | | -**integerItem** | **Integer** | | -**boolItem** | **Boolean** | | -**arrayItem** | **List<Integer>** | | - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/User.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/User.md deleted file mode 100644 index c29bce5c1261..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/User.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# User - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Integer** | User Status | [optional] -**objectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] -**objectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] -**anyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] -**anyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md deleted file mode 100644 index 5c8ee4c6f5eb..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md +++ /dev/null @@ -1,469 +0,0 @@ -# UserApi - -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 -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.UserApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - UserApi apiInstance = new UserApi(defaultClient); - User user = new User(); // User | Created user object - try { - apiInstance.createUser(user); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) - -Creates list of users with given input array - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.UserApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - UserApi apiInstance = new UserApi(defaultClient); - List user = Arrays.asList(); // List | List of user object - try { - apiInstance.createUsersWithArrayInput(user); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - - -# **createUsersWithListInput** -> createUsersWithListInput(user) - -Creates list of users with given input array - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.UserApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - UserApi apiInstance = new UserApi(defaultClient); - List user = Arrays.asList(); // List | List of user object - try { - apiInstance.createUsersWithListInput(user); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.UserApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - UserApi apiInstance = new UserApi(defaultClient); - String username = "username_example"; // String | The name that needs to be deleted - try { - apiInstance.deleteUser(username); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.UserApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - UserApi apiInstance = new UserApi(defaultClient); - String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. - try { - User result = apiInstance.getUserByName(username); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### 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 - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid username supplied | - | -**404** | User not found | - | - - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.UserApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - UserApi apiInstance = new UserApi(defaultClient); - String username = "username_example"; // String | The user name for login - String password = "password_example"; // String | The password for login in clear text - try { - String result = apiInstance.loginUser(username, password); - System.out.println(result); - } catch (ApiException e) { - - } - } -} -``` - -### 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 - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | -**400** | Invalid username/password supplied | - | - - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.UserApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - UserApi apiInstance = new UserApi(defaultClient); - try { - apiInstance.logoutUser(); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - - -# **updateUser** -> updateUser(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.UserApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - UserApi apiInstance = new UserApi(defaultClient); - String username = "username_example"; // String | name that need to be deleted - User user = new User(); // User | Updated user object - try { - apiInstance.updateUser(username, user); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid user supplied | - | -**404** | User not found | - | - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/XmlItem.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/XmlItem.md deleted file mode 100644 index 8c184da283df..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/XmlItem.md +++ /dev/null @@ -1,41 +0,0 @@ - - -# XmlItem - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributeString** | **String** | | [optional] -**attributeNumber** | **BigDecimal** | | [optional] -**attributeInteger** | **Integer** | | [optional] -**attributeBoolean** | **Boolean** | | [optional] -**wrappedArray** | **List<Integer>** | | [optional] -**nameString** | **String** | | [optional] -**nameNumber** | **BigDecimal** | | [optional] -**nameInteger** | **Integer** | | [optional] -**nameBoolean** | **Boolean** | | [optional] -**nameArray** | **List<Integer>** | | [optional] -**nameWrappedArray** | **List<Integer>** | | [optional] -**prefixString** | **String** | | [optional] -**prefixNumber** | **BigDecimal** | | [optional] -**prefixInteger** | **Integer** | | [optional] -**prefixBoolean** | **Boolean** | | [optional] -**prefixArray** | **List<Integer>** | | [optional] -**prefixWrappedArray** | **List<Integer>** | | [optional] -**namespaceString** | **String** | | [optional] -**namespaceNumber** | **BigDecimal** | | [optional] -**namespaceInteger** | **Integer** | | [optional] -**namespaceBoolean** | **Boolean** | | [optional] -**namespaceArray** | **List<Integer>** | | [optional] -**namespaceWrappedArray** | **List<Integer>** | | [optional] -**prefixNsString** | **String** | | [optional] -**prefixNsNumber** | **BigDecimal** | | [optional] -**prefixNsInteger** | **Integer** | | [optional] -**prefixNsBoolean** | **Boolean** | | [optional] -**prefixNsArray** | **List<Integer>** | | [optional] -**prefixNsWrappedArray** | **List<Integer>** | | [optional] - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/git_push.sh b/samples/client/petstore/java/okhttp-gson-nextgen/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/git_push.sh +++ /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="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - 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/samples/client/petstore/java/okhttp-gson-nextgen/gradle.properties b/samples/client/petstore/java/okhttp-gson-nextgen/gradle.properties deleted file mode 100644 index a3408578278a..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/gradle.properties +++ /dev/null @@ -1,6 +0,0 @@ -# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). -# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. -# -# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties -# For example, uncomment below to build for Android -#target = android diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7454180f2ae8848c63b8b4dea2cb829da983f2fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59536 zcma&NbC71ylI~qywr$(CZQJHswz}-9F59+k+g;UV+cs{`J?GrGXYR~=-ydruB3JCa zB64N^cILAcWk5iofq)<(fq;O7{th4@;QxID0)qN`mJ?GIqLY#rX8-|G{5M0pdVW5^ zzXk$-2kQTAC?_N@B`&6-N-rmVFE=$QD?>*=4<|!MJu@}isLc4AW#{m2if&A5T5g&~ ziuMQeS*U5sL6J698wOd)K@oK@1{peP5&Esut<#VH^u)gp`9H4)`uE!2$>RTctN+^u z=ASkePDZA-X8)rp%D;p*~P?*a_=*Kwc<^>QSH|^<0>o37lt^+Mj1;4YvJ(JR-Y+?%Nu}JAYj5 z_Qc5%Ao#F?q32i?ZaN2OSNhWL;2oDEw_({7ZbgUjna!Fqn3NzLM@-EWFPZVmc>(fZ z0&bF-Ch#p9C{YJT9Rcr3+Y_uR^At1^BxZ#eo>$PLJF3=;t_$2|t+_6gg5(j{TmjYU zK12c&lE?Eh+2u2&6Gf*IdKS&6?rYbSEKBN!rv{YCm|Rt=UlPcW9j`0o6{66#y5t9C zruFA2iKd=H%jHf%ypOkxLnO8#H}#Zt{8p!oi6)7#NqoF({t6|J^?1e*oxqng9Q2Cc zg%5Vu!em)}Yuj?kaP!D?b?(C*w!1;>R=j90+RTkyEXz+9CufZ$C^umX^+4|JYaO<5 zmIM3#dv`DGM;@F6;(t!WngZSYzHx?9&$xEF70D1BvfVj<%+b#)vz)2iLCrTeYzUcL z(OBnNoG6Le%M+@2oo)&jdOg=iCszzv59e zDRCeaX8l1hC=8LbBt|k5?CXgep=3r9BXx1uR8!p%Z|0+4Xro=xi0G!e{c4U~1j6!) zH6adq0}#l{%*1U(Cb%4AJ}VLWKBPi0MoKFaQH6x?^hQ!6em@993xdtS%_dmevzeNl z(o?YlOI=jl(`L9^ z0O+H9k$_@`6L13eTT8ci-V0ljDMD|0ifUw|Q-Hep$xYj0hTO@0%IS^TD4b4n6EKDG z??uM;MEx`s98KYN(K0>c!C3HZdZ{+_53DO%9k5W%pr6yJusQAv_;IA}925Y%;+!tY z%2k!YQmLLOr{rF~!s<3-WEUs)`ix_mSU|cNRBIWxOox_Yb7Z=~Q45ZNe*u|m^|)d* zog=i>`=bTe!|;8F+#H>EjIMcgWcG2ORD`w0WD;YZAy5#s{65~qfI6o$+Ty&-hyMyJ z3Ra~t>R!p=5ZpxA;QkDAoPi4sYOP6>LT+}{xp}tk+<0k^CKCFdNYG(Es>p0gqD)jP zWOeX5G;9(m@?GOG7g;e74i_|SmE?`B2i;sLYwRWKLy0RLW!Hx`=!LH3&k=FuCsM=9M4|GqzA)anEHfxkB z?2iK-u(DC_T1};KaUT@3nP~LEcENT^UgPvp!QC@Dw&PVAhaEYrPey{nkcn(ro|r7XUz z%#(=$7D8uP_uU-oPHhd>>^adbCSQetgSG`e$U|7mr!`|bU0aHl_cmL)na-5x1#OsVE#m*+k84Y^+UMeSAa zbrVZHU=mFwXEaGHtXQq`2ZtjfS!B2H{5A<3(nb-6ARVV8kEmOkx6D2x7~-6hl;*-*}2Xz;J#a8Wn;_B5=m zl3dY;%krf?i-Ok^Pal-}4F`{F@TYPTwTEhxpZK5WCpfD^UmM_iYPe}wpE!Djai6_{ z*pGO=WB47#Xjb7!n2Ma)s^yeR*1rTxp`Mt4sfA+`HwZf%!7ZqGosPkw69`Ix5Ku6G z@Pa;pjzV&dn{M=QDx89t?p?d9gna*}jBly*#1!6}5K<*xDPJ{wv4& zM$17DFd~L*Te3A%yD;Dp9UGWTjRxAvMu!j^Tbc}2v~q^59d4bz zvu#!IJCy(BcWTc`;v$9tH;J%oiSJ_i7s;2`JXZF+qd4C)vY!hyCtl)sJIC{ebI*0> z@x>;EzyBv>AI-~{D6l6{ST=em*U( z(r$nuXY-#CCi^8Z2#v#UXOt`dbYN1z5jzNF2 z411?w)whZrfA20;nl&C1Gi+gk<`JSm+{|*2o<< zqM#@z_D`Cn|0H^9$|Tah)0M_X4c37|KQ*PmoT@%xHc3L1ZY6(p(sNXHa&49Frzto& zR`c~ClHpE~4Z=uKa5S(-?M8EJ$zt0&fJk~p$M#fGN1-y$7!37hld`Uw>Urri(DxLa;=#rK0g4J)pXMC zxzraOVw1+kNWpi#P=6(qxf`zSdUC?D$i`8ZI@F>k6k zz21?d+dw7b&i*>Kv5L(LH-?J%@WnqT7j#qZ9B>|Zl+=> z^U-pV@1y_ptHo4hl^cPRWewbLQ#g6XYQ@EkiP z;(=SU!yhjHp%1&MsU`FV1Z_#K1&(|5n(7IHbx&gG28HNT)*~-BQi372@|->2Aw5It z0CBpUcMA*QvsPy)#lr!lIdCi@1k4V2m!NH)%Px(vu-r(Q)HYc!p zJ^$|)j^E#q#QOgcb^pd74^JUi7fUmMiNP_o*lvx*q%_odv49Dsv$NV;6J z9GOXKomA{2Pb{w}&+yHtH?IkJJu~}Z?{Uk++2mB8zyvh*xhHKE``99>y#TdD z&(MH^^JHf;g(Tbb^&8P*;_i*2&fS$7${3WJtV7K&&(MBV2~)2KB3%cWg#1!VE~k#C z!;A;?p$s{ihyojEZz+$I1)L}&G~ml=udD9qh>Tu(ylv)?YcJT3ihapi!zgPtWb*CP zlLLJSRCj-^w?@;RU9aL2zDZY1`I3d<&OMuW=c3$o0#STpv_p3b9Wtbql>w^bBi~u4 z3D8KyF?YE?=HcKk!xcp@Cigvzy=lnFgc^9c%(^F22BWYNAYRSho@~*~S)4%AhEttv zvq>7X!!EWKG?mOd9&n>vvH1p4VzE?HCuxT-u+F&mnsfDI^}*-d00-KAauEaXqg3k@ zy#)MGX!X;&3&0s}F3q40ZmVM$(H3CLfpdL?hB6nVqMxX)q=1b}o_PG%r~hZ4gUfSp zOH4qlEOW4OMUc)_m)fMR_rl^pCfXc{$fQbI*E&mV77}kRF z&{<06AJyJ!e863o-V>FA1a9Eemx6>^F$~9ppt()ZbPGfg_NdRXBWoZnDy2;#ODgf! zgl?iOcF7Meo|{AF>KDwTgYrJLb$L2%%BEtO>T$C?|9bAB&}s;gI?lY#^tttY&hfr# zKhC+&b-rpg_?~uVK%S@mQleU#_xCsvIPK*<`E0fHE1&!J7!xD#IB|SSPW6-PyuqGn3^M^Rz%WT{e?OI^svARX&SAdU77V(C~ zM$H{Kg59op{<|8ry9ecfP%=kFm(-!W&?U0@<%z*+!*<e0XesMxRFu9QnGqun6R_%T+B%&9Dtk?*d$Q zb~>84jEAPi@&F@3wAa^Lzc(AJz5gsfZ7J53;@D<;Klpl?sK&u@gie`~vTsbOE~Cd4 z%kr56mI|#b(Jk&;p6plVwmNB0H@0SmgdmjIn5Ne@)}7Vty(yb2t3ev@22AE^s!KaN zyQ>j+F3w=wnx7w@FVCRe+`vUH)3gW%_72fxzqX!S&!dchdkRiHbXW1FMrIIBwjsai8`CB2r4mAbwp%rrO>3B$Zw;9=%fXI9B{d(UzVap7u z6piC-FQ)>}VOEuPpuqznpY`hN4dGa_1Xz9rVg(;H$5Te^F0dDv*gz9JS<|>>U0J^# z6)(4ICh+N_Q`Ft0hF|3fSHs*?a=XC;e`sJaU9&d>X4l?1W=|fr!5ShD|nv$GK;j46@BV6+{oRbWfqOBRb!ir88XD*SbC(LF}I1h#6@dvK%Toe%@ zhDyG$93H8Eu&gCYddP58iF3oQH*zLbNI;rN@E{T9%A8!=v#JLxKyUe}e}BJpB{~uN zqgxRgo0*-@-iaHPV8bTOH(rS(huwK1Xg0u+e!`(Irzu@Bld&s5&bWgVc@m7;JgELd zimVs`>vQ}B_1(2#rv#N9O`fJpVfPc7V2nv34PC);Dzbb;p!6pqHzvy?2pD&1NE)?A zt(t-ucqy@wn9`^MN5apa7K|L=9>ISC>xoc#>{@e}m#YAAa1*8-RUMKwbm|;5p>T`Z zNf*ph@tnF{gmDa3uwwN(g=`Rh)4!&)^oOy@VJaK4lMT&5#YbXkl`q?<*XtsqD z9PRK6bqb)fJw0g-^a@nu`^?71k|m3RPRjt;pIkCo1{*pdqbVs-Yl>4E>3fZx3Sv44grW=*qdSoiZ9?X0wWyO4`yDHh2E!9I!ZFi zVL8|VtW38}BOJHW(Ax#KL_KQzarbuE{(%TA)AY)@tY4%A%P%SqIU~8~-Lp3qY;U-} z`h_Gel7;K1h}7$_5ZZT0&%$Lxxr-<89V&&TCsu}LL#!xpQ1O31jaa{U34~^le*Y%L za?7$>Jk^k^pS^_M&cDs}NgXlR>16AHkSK-4TRaJSh#h&p!-!vQY%f+bmn6x`4fwTp z$727L^y`~!exvmE^W&#@uY!NxJi`g!i#(++!)?iJ(1)2Wk;RN zFK&O4eTkP$Xn~4bB|q8y(btx$R#D`O@epi4ofcETrx!IM(kWNEe42Qh(8*KqfP(c0 zouBl6>Fc_zM+V;F3znbo{x#%!?mH3`_ANJ?y7ppxS@glg#S9^MXu|FM&ynpz3o&Qh z2ujAHLF3($pH}0jXQsa#?t--TnF1P73b?4`KeJ9^qK-USHE)4!IYgMn-7z|=ALF5SNGkrtPG@Y~niUQV2?g$vzJN3nZ{7;HZHzWAeQ;5P|@Tl3YHpyznGG4-f4=XflwSJY+58-+wf?~Fg@1p1wkzuu-RF3j2JX37SQUc? zQ4v%`V8z9ZVZVqS8h|@@RpD?n0W<=hk=3Cf8R?d^9YK&e9ZybFY%jdnA)PeHvtBe- zhMLD+SSteHBq*q)d6x{)s1UrsO!byyLS$58WK;sqip$Mk{l)Y(_6hEIBsIjCr5t>( z7CdKUrJTrW%qZ#1z^n*Lb8#VdfzPw~OIL76aC+Rhr<~;4Tl!sw?Rj6hXj4XWa#6Tp z@)kJ~qOV)^Rh*-?aG>ic2*NlC2M7&LUzc9RT6WM%Cpe78`iAowe!>(T0jo&ivn8-7 zs{Qa@cGy$rE-3AY0V(l8wjI^uB8Lchj@?L}fYal^>T9z;8juH@?rG&g-t+R2dVDBe zq!K%{e-rT5jX19`(bP23LUN4+_zh2KD~EAYzhpEO3MUG8@}uBHH@4J zd`>_(K4q&>*k82(dDuC)X6JuPrBBubOg7qZ{?x!r@{%0);*`h*^F|%o?&1wX?Wr4b z1~&cy#PUuES{C#xJ84!z<1tp9sfrR(i%Tu^jnXy;4`Xk;AQCdFC@?V%|; zySdC7qS|uQRcH}EFZH%mMB~7gi}a0utE}ZE_}8PQH8f;H%PN41Cb9R%w5Oi5el^fd z$n{3SqLCnrF##x?4sa^r!O$7NX!}&}V;0ZGQ&K&i%6$3C_dR%I7%gdQ;KT6YZiQrW zk%q<74oVBV>@}CvJ4Wj!d^?#Zwq(b$E1ze4$99DuNg?6t9H}k_|D7KWD7i0-g*EO7 z;5{hSIYE4DMOK3H%|f5Edx+S0VI0Yw!tsaRS2&Il2)ea^8R5TG72BrJue|f_{2UHa z@w;^c|K3da#$TB0P3;MPlF7RuQeXT$ zS<<|C0OF(k)>fr&wOB=gP8!Qm>F41u;3esv7_0l%QHt(~+n; zf!G6%hp;Gfa9L9=AceiZs~tK+Tf*Wof=4!u{nIO90jH@iS0l+#%8=~%ASzFv7zqSB^?!@N7)kp0t&tCGLmzXSRMRyxCmCYUD2!B`? zhs$4%KO~m=VFk3Buv9osha{v+mAEq=ik3RdK@;WWTV_g&-$U4IM{1IhGX{pAu%Z&H zFfwCpUsX%RKg);B@7OUzZ{Hn{q6Vv!3#8fAg!P$IEx<0vAx;GU%}0{VIsmFBPq_mb zpe^BChDK>sc-WLKl<6 zwbW|e&d&dv9Wu0goueyu>(JyPx1mz0v4E?cJjFuKF71Q1)AL8jHO$!fYT3(;U3Re* zPPOe%*O+@JYt1bW`!W_1!mN&=w3G9ru1XsmwfS~BJ))PhD(+_J_^N6j)sx5VwbWK| zwRyC?W<`pOCY)b#AS?rluxuuGf-AJ=D!M36l{ua?@SJ5>e!IBr3CXIxWw5xUZ@Xrw z_R@%?{>d%Ld4p}nEsiA@v*nc6Ah!MUs?GA7e5Q5lPpp0@`%5xY$C;{%rz24$;vR#* zBP=a{)K#CwIY%p} zXVdxTQ^HS@O&~eIftU+Qt^~(DGxrdi3k}DdT^I7Iy5SMOp$QuD8s;+93YQ!OY{eB24%xY7ml@|M7I(Nb@K_-?F;2?et|CKkuZK_>+>Lvg!>JE~wN`BI|_h6$qi!P)+K-1Hh(1;a`os z55)4Q{oJiA(lQM#;w#Ta%T0jDNXIPM_bgESMCDEg6rM33anEr}=|Fn6)|jBP6Y}u{ zv9@%7*#RI9;fv;Yii5CI+KrRdr0DKh=L>)eO4q$1zmcSmglsV`*N(x=&Wx`*v!!hn6X-l0 zP_m;X??O(skcj+oS$cIdKhfT%ABAzz3w^la-Ucw?yBPEC+=Pe_vU8nd-HV5YX6X8r zZih&j^eLU=%*;VzhUyoLF;#8QsEfmByk+Y~caBqSvQaaWf2a{JKB9B>V&r?l^rXaC z8)6AdR@Qy_BxQrE2Fk?ewD!SwLuMj@&d_n5RZFf7=>O>hzVE*seW3U?_p|R^CfoY`?|#x9)-*yjv#lo&zP=uI`M?J zbzC<^3x7GfXA4{FZ72{PE*-mNHyy59Q;kYG@BB~NhTd6pm2Oj=_ zizmD?MKVRkT^KmXuhsk?eRQllPo2Ubk=uCKiZ&u3Xjj~<(!M94c)Tez@9M1Gfs5JV z->@II)CDJOXTtPrQudNjE}Eltbjq>6KiwAwqvAKd^|g!exgLG3;wP+#mZYr`cy3#39e653d=jrR-ulW|h#ddHu(m9mFoW~2yE zz5?dB%6vF}+`-&-W8vy^OCxm3_{02royjvmwjlp+eQDzFVEUiyO#gLv%QdDSI#3W* z?3!lL8clTaNo-DVJw@ynq?q!%6hTQi35&^>P85G$TqNt78%9_sSJt2RThO|JzM$iL zg|wjxdMC2|Icc5rX*qPL(coL!u>-xxz-rFiC!6hD1IR%|HSRsV3>Kq~&vJ=s3M5y8SG%YBQ|{^l#LGlg!D?E>2yR*eV%9m$_J6VGQ~AIh&P$_aFbh zULr0Z$QE!QpkP=aAeR4ny<#3Fwyw@rZf4?Ewq`;mCVv}xaz+3ni+}a=k~P+yaWt^L z@w67!DqVf7D%7XtXX5xBW;Co|HvQ8WR1k?r2cZD%U;2$bsM%u8{JUJ5Z0k= zZJARv^vFkmWx15CB=rb=D4${+#DVqy5$C%bf`!T0+epLJLnh1jwCdb*zuCL}eEFvE z{rO1%gxg>1!W(I!owu*mJZ0@6FM(?C+d*CeceZRW_4id*D9p5nzMY&{mWqrJomjIZ z97ZNnZ3_%Hx8dn;H>p8m7F#^2;T%yZ3H;a&N7tm=Lvs&lgJLW{V1@h&6Vy~!+Ffbb zv(n3+v)_D$}dqd!2>Y2B)#<+o}LH#%ogGi2-?xRIH)1!SD)u-L65B&bsJTC=LiaF+YOCif2dUX6uAA|#+vNR z>U+KQekVGon)Yi<93(d!(yw1h3&X0N(PxN2{%vn}cnV?rYw z$N^}_o!XUB!mckL`yO1rnUaI4wrOeQ(+&k?2mi47hzxSD`N#-byqd1IhEoh!PGq>t z_MRy{5B0eKY>;Ao3z$RUU7U+i?iX^&r739F)itdrTpAi-NN0=?^m%?{A9Ly2pVv>Lqs6moTP?T2-AHqFD-o_ znVr|7OAS#AEH}h8SRPQ@NGG47dO}l=t07__+iK8nHw^(AHx&Wb<%jPc$$jl6_p(b$ z)!pi(0fQodCHfM)KMEMUR&UID>}m^(!{C^U7sBDOA)$VThRCI0_+2=( zV8mMq0R(#z;C|7$m>$>`tX+T|xGt(+Y48@ZYu#z;0pCgYgmMVbFb!$?%yhZqP_nhn zy4<#3P1oQ#2b51NU1mGnHP$cf0j-YOgAA}A$QoL6JVLcmExs(kU{4z;PBHJD%_=0F z>+sQV`mzijSIT7xn%PiDKHOujX;n|M&qr1T@rOxTdxtZ!&u&3HHFLYD5$RLQ=heur zb>+AFokUVQeJy-#LP*^)spt{mb@Mqe=A~-4p0b+Bt|pZ+@CY+%x}9f}izU5;4&QFE zO1bhg&A4uC1)Zb67kuowWY4xbo&J=%yoXlFB)&$d*-}kjBu|w!^zbD1YPc0-#XTJr z)pm2RDy%J3jlqSMq|o%xGS$bPwn4AqitC6&e?pqWcjWPt{3I{>CBy;hg0Umh#c;hU3RhCUX=8aR>rmd` z7Orw(5tcM{|-^J?ZAA9KP|)X6n9$-kvr#j5YDecTM6n z&07(nD^qb8hpF0B^z^pQ*%5ePYkv&FabrlI61ntiVp!!C8y^}|<2xgAd#FY=8b*y( zuQOuvy2`Ii^`VBNJB&R!0{hABYX55ooCAJSSevl4RPqEGb)iy_0H}v@vFwFzD%>#I>)3PsouQ+_Kkbqy*kKdHdfkN7NBcq%V{x^fSxgXpg7$bF& zj!6AQbDY(1u#1_A#1UO9AxiZaCVN2F0wGXdY*g@x$ByvUA?ePdide0dmr#}udE%K| z3*k}Vv2Ew2u1FXBaVA6aerI36R&rzEZeDDCl5!t0J=ug6kuNZzH>3i_VN`%BsaVB3 zQYw|Xub_SGf{)F{$ZX5`Jc!X!;eybjP+o$I{Z^Hsj@D=E{MnnL+TbC@HEU2DjG{3-LDGIbq()U87x4eS;JXnSh;lRlJ z>EL3D>wHt-+wTjQF$fGyDO$>d+(fq@bPpLBS~xA~R=3JPbS{tzN(u~m#Po!?H;IYv zE;?8%^vle|%#oux(Lj!YzBKv+Fd}*Ur-dCBoX*t{KeNM*n~ZPYJ4NNKkI^MFbz9!v z4(Bvm*Kc!-$%VFEewYJKz-CQN{`2}KX4*CeJEs+Q(!kI%hN1!1P6iOq?ovz}X0IOi z)YfWpwW@pK08^69#wSyCZkX9?uZD?C^@rw^Y?gLS_xmFKkooyx$*^5#cPqntNTtSG zlP>XLMj2!VF^0k#ole7`-c~*~+_T5ls?x4)ah(j8vo_ zwb%S8qoaZqY0-$ZI+ViIA_1~~rAH7K_+yFS{0rT@eQtTAdz#8E5VpwnW!zJ_^{Utv zlW5Iar3V5t&H4D6A=>?mq;G92;1cg9a2sf;gY9pJDVKn$DYdQlvfXq}zz8#LyPGq@ z+`YUMD;^-6w&r-82JL7mA8&M~Pj@aK!m{0+^v<|t%APYf7`}jGEhdYLqsHW-Le9TL z_hZZ1gbrz7$f9^fAzVIP30^KIz!!#+DRLL+qMszvI_BpOSmjtl$hh;&UeM{ER@INV zcI}VbiVTPoN|iSna@=7XkP&-4#06C};8ajbxJ4Gcq8(vWv4*&X8bM^T$mBk75Q92j z1v&%a;OSKc8EIrodmIiw$lOES2hzGDcjjB`kEDfJe{r}yE6`eZL zEB`9u>Cl0IsQ+t}`-cx}{6jqcANucqIB>Qmga_&<+80E2Q|VHHQ$YlAt{6`Qu`HA3 z03s0-sSlwbvgi&_R8s={6<~M^pGvBNjKOa>tWenzS8s zR>L7R5aZ=mSU{f?ib4Grx$AeFvtO5N|D>9#)ChH#Fny2maHWHOf2G=#<9Myot#+4u zWVa6d^Vseq_0=#AYS(-m$Lp;*8nC_6jXIjEM`omUmtH@QDs3|G)i4j*#_?#UYVZvJ z?YjT-?!4Q{BNun;dKBWLEw2C-VeAz`%?A>p;)PL}TAZn5j~HK>v1W&anteARlE+~+ zj>c(F;?qO3pXBb|#OZdQnm<4xWmn~;DR5SDMxt0UK_F^&eD|KZ=O;tO3vy4@4h^;2 zUL~-z`-P1aOe?|ZC1BgVsL)2^J-&vIFI%q@40w0{jjEfeVl)i9(~bt2z#2Vm)p`V_ z1;6$Ae7=YXk#=Qkd24Y23t&GvRxaOoad~NbJ+6pxqzJ>FY#Td7@`N5xp!n(c!=RE& z&<<@^a$_Ys8jqz4|5Nk#FY$~|FPC0`*a5HH!|Gssa9=~66&xG9)|=pOOJ2KE5|YrR zw!w6K2aC=J$t?L-;}5hn6mHd%hC;p8P|Dgh6D>hGnXPgi;6r+eA=?f72y9(Cf_ho{ zH6#)uD&R=73^$$NE;5piWX2bzR67fQ)`b=85o0eOLGI4c-Tb@-KNi2pz=Ke@SDcPn za$AxXib84`!Sf;Z3B@TSo`Dz7GM5Kf(@PR>Ghzi=BBxK8wRp>YQoXm+iL>H*Jo9M3 z6w&E?BC8AFTFT&Tv8zf+m9<&S&%dIaZ)Aoqkak_$r-2{$d~0g2oLETx9Y`eOAf14QXEQw3tJne;fdzl@wV#TFXSLXM2428F-Q}t+n2g%vPRMUzYPvzQ9f# zu(liiJem9P*?0%V@RwA7F53r~|I!Ty)<*AsMX3J{_4&}{6pT%Tpw>)^|DJ)>gpS~1rNEh z0$D?uO8mG?H;2BwM5a*26^7YO$XjUm40XmBsb63MoR;bJh63J;OngS5sSI+o2HA;W zdZV#8pDpC9Oez&L8loZO)MClRz!_!WD&QRtQxnazhT%Vj6Wl4G11nUk8*vSeVab@N#oJ}`KyJv+8Mo@T1-pqZ1t|?cnaVOd;1(h9 z!$DrN=jcGsVYE-0-n?oCJ^4x)F}E;UaD-LZUIzcD?W^ficqJWM%QLy6QikrM1aKZC zi{?;oKwq^Vsr|&`i{jIphA8S6G4)$KGvpULjH%9u(Dq247;R#l&I0{IhcC|oBF*Al zvLo7Xte=C{aIt*otJD}BUq)|_pdR>{zBMT< z(^1RpZv*l*m*OV^8>9&asGBo8h*_4q*)-eCv*|Pq=XNGrZE)^(SF7^{QE_~4VDB(o zVcPA_!G+2CAtLbl+`=Q~9iW`4ZRLku!uB?;tWqVjB0lEOf}2RD7dJ=BExy=<9wkb- z9&7{XFA%n#JsHYN8t5d~=T~5DcW4$B%3M+nNvC2`0!#@sckqlzo5;hhGi(D9=*A4` z5ynobawSPRtWn&CDLEs3Xf`(8^zDP=NdF~F^s&={l7(aw&EG}KWpMjtmz7j_VLO;@ zM2NVLDxZ@GIv7*gzl1 zjq78tv*8#WSY`}Su0&C;2F$Ze(q>F(@Wm^Gw!)(j;dk9Ad{STaxn)IV9FZhm*n+U} zi;4y*3v%A`_c7a__DJ8D1b@dl0Std3F||4Wtvi)fCcBRh!X9$1x!_VzUh>*S5s!oq z;qd{J_r79EL2wIeiGAqFstWtkfIJpjVh%zFo*=55B9Zq~y0=^iqHWfQl@O!Ak;(o*m!pZqe9 z%U2oDOhR)BvW8&F70L;2TpkzIutIvNQaTjjs5V#8mV4!NQ}zN=i`i@WI1z0eN-iCS z;vL-Wxc^Vc_qK<5RPh(}*8dLT{~GzE{w2o$2kMFaEl&q zP{V=>&3kW7tWaK-Exy{~`v4J0U#OZBk{a9{&)&QG18L@6=bsZ1zC_d{{pKZ-Ey>I> z;8H0t4bwyQqgu4hmO`3|4K{R*5>qnQ&gOfdy?z`XD%e5+pTDzUt3`k^u~SaL&XMe= z9*h#kT(*Q9jO#w2Hd|Mr-%DV8i_1{J1MU~XJ3!WUplhXDYBpJH><0OU`**nIvPIof z|N8@I=wA)sf45SAvx||f?Z5uB$kz1qL3Ky_{%RPdP5iN-D2!p5scq}buuC00C@jom zhfGKm3|f?Z0iQ|K$Z~!`8{nmAS1r+fp6r#YDOS8V*;K&Gs7Lc&f^$RC66O|)28oh`NHy&vq zJh+hAw8+ybTB0@VhWN^0iiTnLsCWbS_y`^gs!LX!Lw{yE``!UVzrV24tP8o;I6-65 z1MUiHw^{bB15tmrVT*7-#sj6cs~z`wk52YQJ*TG{SE;KTm#Hf#a~|<(|ImHH17nNM z`Ub{+J3dMD!)mzC8b(2tZtokKW5pAwHa?NFiso~# z1*iaNh4lQ4TS)|@G)H4dZV@l*Vd;Rw;-;odDhW2&lJ%m@jz+Panv7LQm~2Js6rOW3 z0_&2cW^b^MYW3)@o;neZ<{B4c#m48dAl$GCc=$>ErDe|?y@z`$uq3xd(%aAsX)D%l z>y*SQ%My`yDP*zof|3@_w#cjaW_YW4BdA;#Glg1RQcJGY*CJ9`H{@|D+*e~*457kd z73p<%fB^PV!Ybw@)Dr%(ZJbX}xmCStCYv#K3O32ej{$9IzM^I{6FJ8!(=azt7RWf4 z7ib0UOPqN40X!wOnFOoddd8`!_IN~9O)#HRTyjfc#&MCZ zZAMzOVB=;qwt8gV?{Y2?b=iSZG~RF~uyx18K)IDFLl})G1v@$(s{O4@RJ%OTJyF+Cpcx4jmy|F3euCnMK!P2WTDu5j z{{gD$=M*pH!GGzL%P)V2*ROm>!$Y=z|D`!_yY6e7SU$~a5q8?hZGgaYqaiLnkK%?0 zs#oI%;zOxF@g*@(V4p!$7dS1rOr6GVs6uYCTt2h)eB4?(&w8{#o)s#%gN@BBosRUe z)@P@8_Zm89pr~)b>e{tbPC~&_MR--iB{=)y;INU5#)@Gix-YpgP<-c2Ms{9zuCX|3 z!p(?VaXww&(w&uBHzoT%!A2=3HAP>SDxcljrego7rY|%hxy3XlODWffO_%g|l+7Y_ zqV(xbu)s4lV=l7M;f>vJl{`6qBm>#ZeMA}kXb97Z)?R97EkoI?x6Lp0yu1Z>PS?2{ z0QQ(8D)|lc9CO3B~e(pQM&5(1y&y=e>C^X$`)_&XuaI!IgDTVqt31wX#n+@!a_A0ZQkA zCJ2@M_4Gb5MfCrm5UPggeyh)8 zO9?`B0J#rkoCx(R0I!ko_2?iO@|oRf1;3r+i)w-2&j?=;NVIdPFsB)`|IC0zk6r9c zRrkfxWsiJ(#8QndNJj@{@WP2Ackr|r1VxV{7S&rSU(^)-M8gV>@UzOLXu9K<{6e{T zXJ6b92r$!|lwjhmgqkdswY&}c)KW4A)-ac%sU;2^fvq7gfUW4Bw$b!i@duy1CAxSn z(pyh$^Z=&O-q<{bZUP+$U}=*#M9uVc>CQVgDs4swy5&8RAHZ~$)hrTF4W zPsSa~qYv_0mJnF89RnnJTH`3}w4?~epFl=D(35$ zWa07ON$`OMBOHgCmfO(9RFc<)?$x)N}Jd2A(<*Ll7+4jrRt9w zwGxExUXd9VB#I|DwfxvJ;HZ8Q{37^wDhaZ%O!oO(HpcqfLH%#a#!~;Jl7F5>EX_=8 z{()l2NqPz>La3qJR;_v+wlK>GsHl;uRA8%j`A|yH@k5r%55S9{*Cp%uw6t`qc1!*T za2OeqtQj7sAp#Q~=5Fs&aCR9v>5V+s&RdNvo&H~6FJOjvaj--2sYYBvMq;55%z8^o z|BJDA4vzfow#DO#ZQHh;Oq_{r+qP{R9ox2TOgwQiv7Ow!zjN+A@BN;0tA2lUb#+zO z(^b89eV)D7UVE+h{mcNc6&GtpOqDn_?VAQ)Vob$hlFwW%xh>D#wml{t&Ofmm_d_+; zKDxzdr}`n2Rw`DtyIjrG)eD0vut$}dJAZ0AohZ+ZQdWXn_Z@dI_y=7t3q8x#pDI-K z2VVc&EGq445Rq-j0=U=Zx`oBaBjsefY;%)Co>J3v4l8V(T8H?49_@;K6q#r~Wwppc z4XW0(4k}cP=5ex>-Xt3oATZ~bBWKv)aw|I|Lx=9C1s~&b77idz({&q3T(Y(KbWO?+ zmcZ6?WeUsGk6>km*~234YC+2e6Zxdl~<_g2J|IE`GH%n<%PRv-50; zH{tnVts*S5*_RxFT9eM0z-pksIb^drUq4>QSww=u;UFCv2AhOuXE*V4z?MM`|ABOC4P;OfhS(M{1|c%QZ=!%rQTDFx`+}?Kdx$&FU?Y<$x;j7z=(;Lyz+?EE>ov!8vvMtSzG!nMie zsBa9t8as#2nH}n8xzN%W%U$#MHNXmDUVr@GX{?(=yI=4vks|V)!-W5jHsU|h_&+kY zS_8^kd3jlYqOoiI`ZqBVY!(UfnAGny!FowZWY_@YR0z!nG7m{{)4OS$q&YDyw6vC$ zm4!$h>*|!2LbMbxS+VM6&DIrL*X4DeMO!@#EzMVfr)e4Tagn~AQHIU8?e61TuhcKD zr!F4(kEebk(Wdk-?4oXM(rJwanS>Jc%<>R(siF+>+5*CqJLecP_we33iTFTXr6W^G z7M?LPC-qFHK;E!fxCP)`8rkxZyFk{EV;G-|kwf4b$c1k0atD?85+|4V%YATWMG|?K zLyLrws36p%Qz6{}>7b>)$pe>mR+=IWuGrX{3ZPZXF3plvuv5Huax86}KX*lbPVr}L z{C#lDjdDeHr~?l|)Vp_}T|%$qF&q#U;ClHEPVuS+Jg~NjC1RP=17=aQKGOcJ6B3mp z8?4*-fAD~}sX*=E6!}^u8)+m2j<&FSW%pYr_d|p_{28DZ#Cz0@NF=gC-o$MY?8Ca8 zr5Y8DSR^*urS~rhpX^05r30Ik#2>*dIOGxRm0#0YX@YQ%Mg5b6dXlS!4{7O_kdaW8PFSdj1=ryI-=5$fiieGK{LZ+SX(1b=MNL!q#lN zv98?fqqTUH8r8C7v(cx#BQ5P9W>- zmW93;eH6T`vuJ~rqtIBg%A6>q>gnWb3X!r0wh_q;211+Om&?nvYzL1hhtjB zK_7G3!n7PL>d!kj){HQE zE8(%J%dWLh1_k%gVXTZt zEdT09XSKAx27Ncaq|(vzL3gm83q>6CAw<$fTnMU05*xAe&rDfCiu`u^1)CD<>sx0i z*hr^N_TeN89G(nunZoLBf^81#pmM}>JgD@Nn1l*lN#a=B=9pN%tmvYFjFIoKe_(GF z-26x{(KXdfsQL7Uv6UtDuYwV`;8V3w>oT_I<`Ccz3QqK9tYT5ZQzbop{=I=!pMOCb zCU68`n?^DT%^&m>A%+-~#lvF!7`L7a{z<3JqIlk1$<||_J}vW1U9Y&eX<}l8##6i( zZcTT@2`9(Mecptm@{3A_Y(X`w9K0EwtPq~O!16bq{7c0f7#(3wn-^)h zxV&M~iiF!{-6A@>o;$RzQ5A50kxXYj!tcgme=Qjrbje~;5X2xryU;vH|6bE(8z^<7 zQ>BG7_c*JG8~K7Oe68i#0~C$v?-t@~@r3t2inUnLT(c=URpA9kA8uq9PKU(Ps(LVH zqgcqW>Gm?6oV#AldDPKVRcEyQIdTT`Qa1j~vS{<;SwyTdr&3*t?J)y=M7q*CzucZ&B0M=joT zBbj@*SY;o2^_h*>R0e({!QHF0=)0hOj^B^d*m>SnRrwq>MolNSgl^~r8GR#mDWGYEIJA8B<|{{j?-7p zVnV$zancW3&JVDtVpIlI|5djKq0(w$KxEFzEiiL=h5Jw~4Le23@s(mYyXWL9SX6Ot zmb)sZaly_P%BeX_9 zw&{yBef8tFm+%=--m*J|o~+Xg3N+$IH)t)=fqD+|fEk4AAZ&!wcN5=mi~Vvo^i`}> z#_3ahR}Ju)(Px7kev#JGcSwPXJ2id9%Qd2A#Uc@t8~egZ8;iC{e! z%=CGJOD1}j!HW_sgbi_8suYnn4#Ou}%9u)dXd3huFIb!ytlX>Denx@pCS-Nj$`VO&j@(z!kKSP0hE4;YIP#w9ta=3DO$7f*x zc9M4&NK%IrVmZAe=r@skWD`AEWH=g+r|*13Ss$+{c_R!b?>?UaGXlw*8qDmY#xlR= z<0XFbs2t?8i^G~m?b|!Hal^ZjRjt<@a? z%({Gn14b4-a|#uY^=@iiKH+k?~~wTj5K1A&hU z2^9-HTC)7zpoWK|$JXaBL6C z#qSNYtY>65T@Zs&-0cHeu|RX(Pxz6vTITdzJdYippF zC-EB+n4}#lM7`2Ry~SO>FxhKboIAF#Z{1wqxaCb{#yEFhLuX;Rx(Lz%T`Xo1+a2M}7D+@wol2)OJs$TwtRNJ={( zD@#zTUEE}#Fz#&(EoD|SV#bayvr&E0vzmb%H?o~46|FAcx?r4$N z&67W3mdip-T1RIxwSm_&(%U|+WvtGBj*}t69XVd&ebn>KOuL(7Y8cV?THd-(+9>G7*Nt%T zcH;`p={`SOjaf7hNd(=37Lz3-51;58JffzIPgGs_7xIOsB5p2t&@v1mKS$2D$*GQ6 zM(IR*j4{nri7NMK9xlDy-hJW6sW|ZiDRaFiayj%;(%51DN!ZCCCXz+0Vm#};70nOx zJ#yA0P3p^1DED;jGdPbQWo0WATN=&2(QybbVdhd=Vq*liDk`c7iZ?*AKEYC#SY&2g z&Q(Ci)MJ{mEat$ZdSwTjf6h~roanYh2?9j$CF@4hjj_f35kTKuGHvIs9}Re@iKMxS-OI*`0S z6s)fOtz}O$T?PLFVSeOjSO26$@u`e<>k(OSP!&YstH3ANh>)mzmKGNOwOawq-MPXe zy4xbeUAl6tamnx))-`Gi2uV5>9n(73yS)Ukma4*7fI8PaEwa)dWHs6QA6>$}7?(L8 ztN8M}?{Tf!Zu22J5?2@95&rQ|F7=FK-hihT-vDp!5JCcWrVogEnp;CHenAZ)+E+K5 z$Cffk5sNwD_?4+ymgcHR(5xgt20Z8M`2*;MzOM#>yhk{r3x=EyM226wb&!+j`W<%* zSc&|`8!>dn9D@!pYow~(DsY_naSx7(Z4i>cu#hA5=;IuI88}7f%)bRkuY2B;+9Uep zpXcvFWkJ!mQai63BgNXG26$5kyhZ2&*3Q_tk)Ii4M>@p~_~q_cE!|^A;_MHB;7s#9 zKzMzK{lIxotjc};k67^Xsl-gS!^*m*m6kn|sbdun`O?dUkJ{0cmI0-_2y=lTAfn*Y zKg*A-2sJq)CCJgY0LF-VQvl&6HIXZyxo2#!O&6fOhbHXC?%1cMc6y^*dOS{f$=137Ds1m01qs`>iUQ49JijsaQ( zksqV9@&?il$|4Ua%4!O15>Zy&%gBY&wgqB>XA3!EldQ%1CRSM(pp#k~-pkcCg4LAT zXE=puHbgsw)!xtc@P4r~Z}nTF=D2~j(6D%gTBw$(`Fc=OOQ0kiW$_RDd=hcO0t97h zb86S5r=>(@VGy1&#S$Kg_H@7G^;8Ue)X5Y+IWUi`o;mpvoV)`fcVk4FpcT|;EG!;? zHG^zrVVZOm>1KFaHlaogcWj(v!S)O(Aa|Vo?S|P z5|6b{qkH(USa*Z7-y_Uvty_Z1|B{rTS^qmEMLEYUSk03_Fg&!O3BMo{b^*`3SHvl0 zhnLTe^_vVIdcSHe)SQE}r~2dq)VZJ!aSKR?RS<(9lzkYo&dQ?mubnWmgMM37Nudwo z3Vz@R{=m2gENUE3V4NbIzAA$H1z0pagz94-PTJyX{b$yndsdKptmlKQKaaHj@3=ED zc7L?p@%ui|RegVYutK$64q4pe9+5sv34QUpo)u{1ci?)_7gXQd{PL>b0l(LI#rJmN zGuO+%GO`xneFOOr4EU(Wg}_%bhzUf;d@TU+V*2#}!2OLwg~%D;1FAu=Un>OgjPb3S z7l(riiCwgghC=Lm5hWGf5NdGp#01xQ59`HJcLXbUR3&n%P(+W2q$h2Qd z*6+-QXJ*&Kvk9ht0f0*rO_|FMBALen{j7T1l%=Q>gf#kma zQlg#I9+HB+z*5BMxdesMND`_W;q5|FaEURFk|~&{@qY32N$G$2B=&Po{=!)x5b!#n zxLzblkq{yj05#O7(GRuT39(06FJlalyv<#K4m}+vs>9@q-&31@1(QBv82{}Zkns~K ze{eHC_RDX0#^A*JQTwF`a=IkE6Ze@j#-8Q`tTT?k9`^ZhA~3eCZJ-Jr{~7Cx;H4A3 zcZ+Zj{mzFZbVvQ6U~n>$U2ZotGsERZ@}VKrgGh0xM;Jzt29%TX6_&CWzg+YYMozrM z`nutuS)_0dCM8UVaKRj804J4i%z2BA_8A4OJRQ$N(P9Mfn-gF;4#q788C@9XR0O3< zsoS4wIoyt046d+LnSCJOy@B@Uz*#GGd#+Ln1ek5Dv>(ZtD@tgZlPnZZJGBLr^JK+!$$?A_fA3LOrkoDRH&l7 zcMcD$Hsjko3`-{bn)jPL6E9Ds{WskMrivsUu5apD z?grQO@W7i5+%X&E&p|RBaEZ(sGLR@~(y^BI@lDMot^Ll?!`90KT!JXUhYS`ZgX3jnu@Ja^seA*M5R@f`=`ynQV4rc$uT1mvE?@tz)TN<=&H1%Z?5yjxcpO+6y_R z6EPuPKM5uxKpmZfT(WKjRRNHs@ib)F5WAP7QCADvmCSD#hPz$V10wiD&{NXyEwx5S z6NE`3z!IS^$s7m}PCwQutVQ#~w+V z=+~->DI*bR2j0^@dMr9`p>q^Ny~NrAVxrJtX2DUveic5vM%#N*XO|?YAWwNI$Q)_) zvE|L(L1jP@F%gOGtnlXtIv2&1i8q<)Xfz8O3G^Ea~e*HJsQgBxWL(yuLY+jqUK zRE~`-zklrGog(X}$9@ZVUw!8*=l`6mzYLtsg`AvBYz(cxmAhr^j0~(rzXdiOEeu_p zE$sf2(w(BPAvO5DlaN&uQ$4@p-b?fRs}d7&2UQ4Fh?1Hzu*YVjcndqJLw0#q@fR4u zJCJ}>_7-|QbvOfylj+e^_L`5Ep9gqd>XI3-O?Wp z-gt*P29f$Tx(mtS`0d05nHH=gm~Po_^OxxUwV294BDKT>PHVlC5bndncxGR!n(OOm znsNt@Q&N{TLrmsoKFw0&_M9$&+C24`sIXGWgQaz=kY;S{?w`z^Q0JXXBKFLj0w0U6P*+jPKyZHX9F#b0D1$&(- zrm8PJd?+SrVf^JlfTM^qGDK&-p2Kdfg?f>^%>1n8bu&byH(huaocL>l@f%c*QkX2i znl}VZ4R1en4S&Bcqw?$=Zi7ohqB$Jw9x`aM#>pHc0x z0$!q7iFu zZ`tryM70qBI6JWWTF9EjgG@>6SRzsd}3h+4D8d~@CR07P$LJ}MFsYi-*O%XVvD@yT|rJ+Mk zDllJ7$n0V&A!0flbOf)HE6P_afPWZmbhpliqJuw=-h+r;WGk|ntkWN(8tKlYpq5Ow z(@%s>IN8nHRaYb*^d;M(D$zGCv5C|uqmsDjwy4g=Lz>*OhO3z=)VD}C<65;`89Ye} zSCxrv#ILzIpEx1KdLPlM&%Cctf@FqTKvNPXC&`*H9=l=D3r!GLM?UV zOxa(8ZsB`&+76S-_xuj?G#wXBfDY@Z_tMpXJS7^mp z@YX&u0jYw2A+Z+bD#6sgVK5ZgdPSJV3>{K^4~%HV?rn~4D)*2H!67Y>0aOmzup`{D zzDp3c9yEbGCY$U<8biJ_gB*`jluz1ShUd!QUIQJ$*1;MXCMApJ^m*Fiv88RZ zFopLViw}{$Tyhh_{MLGIE2~sZ)t0VvoW%=8qKZ>h=adTe3QM$&$PO2lfqH@brt!9j ziePM8$!CgE9iz6B<6_wyTQj?qYa;eC^{x_0wuwV~W+^fZmFco-o%wsKSnjXFEx02V zF5C2t)T6Gw$Kf^_c;Ei3G~uC8SM-xyycmXyC2hAVi-IfXqhu$$-C=*|X?R0~hu z8`J6TdgflslhrmDZq1f?GXF7*ALeMmOEpRDg(s*H`4>_NAr`2uqF;k;JQ+8>A|_6ZNsNLECC%NNEb1Y1dP zbIEmNpK)#XagtL4R6BC{C5T(+=yA-(Z|Ap}U-AfZM#gwVpus3(gPn}Q$CExObJ5AC z)ff9Yk?wZ}dZ-^)?cbb9Fw#EjqQ8jxF4G3=L?Ra zg_)0QDMV1y^A^>HRI$x?Op@t;oj&H@1xt4SZ9(kifQ zb59B*`M99Td7@aZ3UWvj1rD0sE)d=BsBuW*KwkCds7ay(7*01_+L}b~7)VHI>F_!{ zyxg-&nCO?v#KOUec0{OOKy+sjWA;8rTE|Lv6I9H?CI?H(mUm8VXGwU$49LGpz&{nQp2}dinE1@lZ1iox6{ghN&v^GZv9J${7WaXj)<0S4g_uiJ&JCZ zr8-hsu`U%N;+9N^@&Q0^kVPB3)wY(rr}p7{p0qFHb3NUUHJb672+wRZs`gd1UjKPX z4o6zljKKA+Kkj?H>Ew63o%QjyBk&1!P22;MkD>sM0=z_s-G{mTixJCT9@_|*(p^bz zJ8?ZZ&;pzV+7#6Mn`_U-)k8Pjg?a;|Oe^us^PoPY$Va~yi8|?+&=y$f+lABT<*pZr zP}D{~Pq1Qyni+@|aP;ixO~mbEW9#c0OU#YbDZIaw=_&$K%Ep2f%hO^&P67hApZe`x zv8b`Mz@?M_7-)b!lkQKk)JXXUuT|B8kJlvqRmRpxtQDgvrHMXC1B$M@Y%Me!BSx3P z#2Eawl$HleZhhTS6Txm>lN_+I`>eV$&v9fOg)%zVn3O5mI*lAl>QcHuW6!Kixmq`X zBCZ*Ck6OYtDiK!N47>jxI&O2a9x7M|i^IagRr-fmrmikEQGgw%J7bO|)*$2FW95O4 zeBs>KR)izRG1gRVL;F*sr8A}aRHO0gc$$j&ds8CIO1=Gwq1%_~E)CWNn9pCtBE}+`Jelk4{>S)M)`Ll=!~gnn1yq^EX(+y*ik@3Ou0qU`IgYi3*doM+5&dU!cho$pZ zn%lhKeZkS72P?Cf68<#kll_6OAO26bIbueZx**j6o;I0cS^XiL`y+>{cD}gd%lux} z)3N>MaE24WBZ}s0ApfdM;5J_Ny}rfUyxfkC``Awo2#sgLnGPewK};dORuT?@I6(5~ z?kE)Qh$L&fwJXzK){iYx!l5$Tt|^D~MkGZPA}(o6f7w~O2G6Vvzdo*a;iXzk$B66$ zwF#;wM7A+(;uFG4+UAY(2`*3XXx|V$K8AYu#ECJYSl@S=uZW$ksfC$~qrrbQj4??z-)uz0QL}>k^?fPnJTPw% zGz)~?B4}u0CzOf@l^um}HZzbaIwPmb<)< zi_3@E9lc)Qe2_`*Z^HH;1CXOceL=CHpHS{HySy3T%<^NrWQ}G0i4e1xm_K3(+~oi$ zoHl9wzb?Z4j#90DtURtjtgvi7uw8DzHYmtPb;?%8vb9n@bszT=1qr)V_>R%s!92_` zfnHQPANx z<#hIjIMm#*(v*!OXtF+w8kLu`o?VZ5k7{`vw{Yc^qYclpUGIM_PBN1+c{#Vxv&E*@ zxg=W2W~JuV{IuRYw3>LSI1)a!thID@R=bU+cU@DbR^_SXY`MC7HOsCN z!dO4OKV7(E_Z8T#8MA1H`99?Z!r0)qKW_#|29X3#Jb+5+>qUidbeP1NJ@)(qi2S-X zao|f0_tl(O+$R|Qwd$H{_ig|~I1fbp_$NkI!0E;Y z6JrnU{1Ra6^on{9gUUB0mwzP3S%B#h0fjo>JvV~#+X0P~JV=IG=yHG$O+p5O3NUgG zEQ}z6BTp^Fie)Sg<){Z&I8NwPR(=mO4joTLHkJ>|Tnk23E(Bo`FSbPc05lF2-+)X? z6vV3*m~IBHTy*^E!<0nA(tCOJW2G4DsH7)BxLV8kICn5lu6@U*R`w)o9;Ro$i8=Q^V%uH8n3q=+Yf;SFRZu z!+F&PKcH#8cG?aSK_Tl@K9P#8o+jry@gdexz&d(Q=47<7nw@e@FFfIRNL9^)1i@;A z28+$Z#rjv-wj#heI|<&J_DiJ*s}xd-f!{J8jfqOHE`TiHHZVIA8CjkNQ_u;Ery^^t zl1I75&u^`1_q)crO+JT4rx|z2ToSC>)Or@-D zy3S>jW*sNIZR-EBsfyaJ+Jq4BQE4?SePtD2+jY8*%FsSLZ9MY>+wk?}}}AFAw)vr{ml)8LUG-y9>^t!{~|sgpxYc0Gnkg`&~R z-pilJZjr@y5$>B=VMdZ73svct%##v%wdX~9fz6i3Q-zOKJ9wso+h?VME7}SjL=!NUG{J?M&i!>ma`eoEa@IX`5G>B1(7;%}M*%-# zfhJ(W{y;>MRz!Ic8=S}VaBKqh;~7KdnGEHxcL$kA-6E~=!hrN*zw9N+_=odt<$_H_8dbo;0=42wcAETPCVGUr~v(`Uai zb{=D!Qc!dOEU6v)2eHSZq%5iqK?B(JlCq%T6av$Cb4Rko6onlG&?CqaX7Y_C_cOC3 zYZ;_oI(}=>_07}Oep&Ws7x7-R)cc8zfe!SYxJYP``pi$FDS)4Fvw5HH=FiU6xfVqIM!hJ;Rx8c0cB7~aPtNH(Nmm5Vh{ibAoU#J6 zImRCr?(iyu_4W_6AWo3*vxTPUw@vPwy@E0`(>1Qi=%>5eSIrp^`` zK*Y?fK_6F1W>-7UsB)RPC4>>Ps9)f+^MqM}8AUm@tZ->j%&h1M8s*s!LX5&WxQcAh z8mciQej@RPm?660%>{_D+7er>%zX_{s|$Z+;G7_sfNfBgY(zLB4Ey}J9F>zX#K0f6 z?dVNIeEh?EIShmP6>M+d|0wMM85Sa4diw1hrg|ITJ}JDg@o8y>(rF9mXk5M z2@D|NA)-7>wD&wF;S_$KS=eE84`BGw3g0?6wGxu8ys4rwI?9U=*^VF22t3%mbGeOh z`!O-OpF7#Vceu~F`${bW0nYVU9ecmk31V{tF%iv&5hWofC>I~cqAt@u6|R+|HLMMX zVxuSlMFOK_EQ86#E8&KwxIr8S9tj_goWtLv4f@!&h8;Ov41{J~496vp9vX=(LK#j! zAwi*21RAV-LD>9Cw3bV_9X(X3)Kr0-UaB*7Y>t82EQ%!)(&(XuAYtTsYy-dz+w=$ir)VJpe!_$ z6SGpX^i(af3{o=VlFPC);|J8#(=_8#vdxDe|Cok+ANhYwbE*FO`Su2m1~w+&9<_9~ z-|tTU_ACGN`~CNW5WYYBn^B#SwZ(t4%3aPp z;o)|L6Rk569KGxFLUPx@!6OOa+5OjQLK5w&nAmwxkC5rZ|m&HT8G%GVZxB_@ME z>>{rnXUqyiJrT(8GMj_ap#yN_!9-lO5e8mR3cJiK3NE{_UM&=*vIU`YkiL$1%kf+1 z4=jk@7EEj`u(jy$HnzE33ZVW_J4bj}K;vT?T91YlO(|Y0FU4r+VdbmQ97%(J5 zkK*Bed8+C}FcZ@HIgdCMioV%A<*4pw_n}l*{Cr4}a(lq|injK#O?$tyvyE`S%(1`H z_wwRvk#13ElkZvij2MFGOj`fhy?nC^8`Zyo%yVcUAfEr8x&J#A{|moUBAV_^f$hpaUuyQeY3da^ zS9iRgf87YBwfe}>BO+T&Fl%rfpZh#+AM?Dq-k$Bq`vG6G_b4z%Kbd&v>qFjow*mBl z-OylnqOpLg}or7_VNwRg2za3VBK6FUfFX{|TD z`Wt0Vm2H$vdlRWYQJqDmM?JUbVqL*ZQY|5&sY*?!&%P8qhA~5+Af<{MaGo(dl&C5t zE%t!J0 zh6jqANt4ABdPxSTrVV}fLsRQal*)l&_*rFq(Ez}ClEH6LHv{J#v?+H-BZ2)Wy{K@9 z+ovXHq~DiDvm>O~r$LJo!cOuwL+Oa--6;UFE2q@g3N8Qkw5E>ytz^(&($!O47+i~$ zKM+tkAd-RbmP{s_rh+ugTD;lriL~`Xwkad#;_aM?nQ7L_muEFI}U_4$phjvYgleK~`Fo`;GiC07&Hq1F<%p;9Q;tv5b?*QnR%8DYJH3P>Svmv47Y>*LPZJy8_{9H`g6kQpyZU{oJ`m%&p~D=K#KpfoJ@ zn-3cqmHsdtN!f?~w+(t+I`*7GQA#EQC^lUA9(i6=i1PqSAc|ha91I%X&nXzjYaM{8$s&wEx@aVkQ6M{E2 zfzId#&r(XwUNtPcq4Ngze^+XaJA1EK-%&C9j>^9(secqe{}z>hR5CFNveMsVA)m#S zk)_%SidkY-XmMWlVnQ(mNJ>)ooszQ#vaK;!rPmGKXV7am^_F!Lz>;~{VrIO$;!#30XRhE1QqO_~#+Ux;B_D{Nk=grn z8Y0oR^4RqtcYM)7a%@B(XdbZCOqnX#fD{BQTeLvRHd(irHKq=4*jq34`6@VAQR8WG z^%)@5CXnD_T#f%@-l${>y$tfb>2LPmc{~5A82|16mH)R?&r#KKLs7xpN-D`=&Cm^R zvMA6#Ahr<3X>Q7|-qfTY)}32HkAz$_mibYV!I)u>bmjK`qwBe(>za^0Kt*HnFbSdO z1>+ryKCNxmm^)*$XfiDOF2|{-v3KKB?&!(S_Y=Ht@|ir^hLd978xuI&N{k>?(*f8H z=ClxVJK_%_z1TH0eUwm2J+2To7FK4o+n_na)&#VLn1m;!+CX+~WC+qg1?PA~KdOlC zW)C@pw75_xoe=w7i|r9KGIvQ$+3K?L{7TGHwrQM{dCp=Z*D}3kX7E-@sZnup!BImw z*T#a=+WcTwL78exTgBn|iNE3#EsOorO z*kt)gDzHiPt07fmisA2LWN?AymkdqTgr?=loT7z@d`wnlr6oN}@o|&JX!yPzC*Y8d zu6kWlTzE1)ckyBn+0Y^HMN+GA$wUO_LN6W>mxCo!0?oiQvT`z$jbSEu&{UHRU0E8# z%B^wOc@S!yhMT49Y)ww(Xta^8pmPCe@eI5C*ed96)AX9<>))nKx0(sci8gwob_1}4 z0DIL&vsJ1_s%<@y%U*-eX z5rN&(zef-5G~?@r79oZGW1d!WaTqQn0F6RIOa9tJ=0(kdd{d1{<*tHT#cCvl*i>YY zH+L7jq8xZNcTUBqj(S)ztTU!TM!RQ}In*n&Gn<>(60G7}4%WQL!o>hbJqNDSGwl#H z`4k+twp0cj%PsS+NKaxslAEu9!#U3xT1|_KB6`h=PI0SW`P9GTa7caD1}vKEglV8# zjKZR`pluCW19c2fM&ZG)c3T3Um;ir3y(tSCJ7Agl6|b524dy5El{^EQBG?E61H0XY z`bqg!;zhGhyMFl&(o=JWEJ8n~z)xI}A@C0d2hQGvw7nGv)?POU@(kS1m=%`|+^ika zXl8zjS?xqW$WlO?Ewa;vF~XbybHBor$f<%I&*t$F5fynwZlTGj|IjZtVfGa7l&tK} zW>I<69w(cZLu)QIVG|M2xzW@S+70NinQzk&Y0+3WT*cC)rx~04O-^<{JohU_&HL5XdUKW!uFy|i$FB|EMu0eUyW;gsf`XfIc!Z0V zeK&*hPL}f_cX=@iv>K%S5kL;cl_$v?n(Q9f_cChk8Lq$glT|=e+T*8O4H2n<=NGmn z+2*h+v;kBvF>}&0RDS>)B{1!_*XuE8A$Y=G8w^qGMtfudDBsD5>T5SB;Qo}fSkkiV ze^K^M(UthkwrD!&*tTsu>Dacdj_q`~V%r_twr$(Ct&_dKeeXE?fA&4&yASJWJ*}~- zel=@W)tusynfC_YqH4ll>4Eg`Xjs5F7Tj>tTLz<0N3)X<1px_d2yUY>X~y>>93*$) z5PuNMQLf9Bu?AAGO~a_|J2akO1M*@VYN^VxvP0F$2>;Zb9;d5Yfd8P%oFCCoZE$ z4#N$^J8rxYjUE_6{T%Y>MmWfHgScpuGv59#4u6fpTF%~KB^Ae`t1TD_^Ud#DhL+Dm zbY^VAM#MrAmFj{3-BpVSWph2b_Y6gCnCAombVa|1S@DU)2r9W<> zT5L8BB^er3zxKt1v(y&OYk!^aoQisqU zH(g@_o)D~BufUXcPt!Ydom)e|aW{XiMnes2z&rE?og>7|G+tp7&^;q?Qz5S5^yd$i z8lWr4g5nctBHtigX%0%XzIAB8U|T6&JsC4&^hZBw^*aIcuNO47de?|pGXJ4t}BB`L^d8tD`H`i zqrP8?#J@8T#;{^B!KO6J=@OWKhAerih(phML`(Rg7N1XWf1TN>=Z3Do{l_!d~DND&)O)D>ta20}@Lt77qSnVsA7>)uZAaT9bsB>u&aUQl+7GiY2|dAEg@%Al3i316y;&IhQL^8fw_nwS>f60M_-m+!5)S_6EPM7Y)(Nq^8gL7(3 zOiot`6Wy6%vw~a_H?1hLVzIT^i1;HedHgW9-P#)}Y6vF%C=P70X0Tk^z9Te@kPILI z_(gk!k+0%CG)%!WnBjjw*kAKs_lf#=5HXC00s-}oM-Q1aXYLj)(1d!_a7 z*Gg4Fe6F$*ujVjI|79Z5+Pr`us%zW@ln++2l+0hsngv<{mJ%?OfSo_3HJXOCys{Ug z00*YR-(fv<=&%Q!j%b-_ppA$JsTm^_L4x`$k{VpfLI(FMCap%LFAyq;#ns5bR7V+x zO!o;c5y~DyBPqdVQX)8G^G&jWkBy2|oWTw>)?5u}SAsI$RjT#)lTV&Rf8;>u*qXnb z8F%Xb=7#$m)83z%`E;49)t3fHInhtc#kx4wSLLms!*~Z$V?bTyUGiS&m>1P(952(H zuHdv=;o*{;5#X-uAyon`hP}d#U{uDlV?W?_5UjJvf%11hKwe&(&9_~{W)*y1nR5f_ z!N(R74nNK`y8>B!0Bt_Vr!;nc3W>~RiKtGSBkNlsR#-t^&;$W#)f9tTlZz>n*+Fjz z3zXZ;jf(sTM(oDzJt4FJS*8c&;PLTW(IQDFs_5QPy+7yhi1syPCarvqrHFcf&yTy)^O<1EBx;Ir`5W{TIM>{8w&PB>ro4;YD<5LF^TjTb0!zAP|QijA+1Vg>{Afv^% zmrkc4o6rvBI;Q8rj4*=AZacy*n8B{&G3VJc)so4$XUoie0)vr;qzPZVbb<#Fc=j+8CGBWe$n|3K& z_@%?{l|TzKSlUEO{U{{%Fz_pVDxs7i9H#bnbCw7@4DR=}r_qV!Zo~CvD4ZI*+j3kO zW6_=|S`)(*gM0Z;;}nj`73OigF4p6_NPZQ-Od~e$c_);;4-7sR>+2u$6m$Gf%T{aq zle>e3(*Rt(TPD}03n5)!Ca8Pu!V}m6v0o1;5<1h$*|7z|^(3$Y&;KHKTT}hV056wuF0Xo@mK-52~r=6^SI1NC%c~CC?n>yX6wPTgiWYVz!Sx^atLby9YNn1Rk{g?|pJaxD4|9cUf|V1_I*w zzxK)hRh9%zOl=*$?XUjly5z8?jPMy%vEN)f%T*|WO|bp5NWv@B(K3D6LMl!-6dQg0 zXNE&O>Oyf%K@`ngCvbGPR>HRg5!1IV$_}m@3dWB7x3t&KFyOJn9pxRXCAzFr&%37wXG;z^xaO$ekR=LJG ztIHpY8F5xBP{mtQidqNRoz= z@){+N3(VO5bD+VrmS^YjG@+JO{EOIW)9=F4v_$Ed8rZtHvjpiEp{r^c4F6Ic#ChlC zJX^DtSK+v(YdCW)^EFcs=XP7S>Y!4=xgmv>{S$~@h=xW-G4FF9?I@zYN$e5oF9g$# zb!eVU#J+NjLyX;yb)%SY)xJdvGhsnE*JEkuOVo^k5PyS=o#vq!KD46UTW_%R=Y&0G zFj6bV{`Y6)YoKgqnir2&+sl+i6foAn-**Zd1{_;Zb7Ki=u394C5J{l^H@XN`_6XTKY%X1AgQM6KycJ+= zYO=&t#5oSKB^pYhNdzPgH~aEGW2=ec1O#s-KG z71}LOg@4UEFtp3GY1PBemXpNs6UK-ax*)#$J^pC_me;Z$Je(OqLoh|ZrW*mAMBFn< zHttjwC&fkVfMnQeen8`Rvy^$pNRFVaiEN4Pih*Y3@jo!T0nsClN)pdrr9AYLcZxZ| zJ5Wlj+4q~($hbtuY zVQ7hl>4-+@6g1i`1a)rvtp-;b0>^`Dloy(#{z~ytgv=j4q^Kl}wD>K_Y!l~ zp(_&7sh`vfO(1*MO!B%<6E_bx1)&s+Ae`O)a|X=J9y~XDa@UB`m)`tSG4AUhoM=5& znWoHlA-(z@3n0=l{E)R-p8sB9XkV zZ#D8wietfHL?J5X0%&fGg@MH~(rNS2`GHS4xTo7L$>TPme+Is~!|79=^}QbPF>m%J zFMkGzSndiPO|E~hrhCeo@&Ea{M(ieIgRWMf)E}qeTxT8Q#g-!Lu*x$v8W^M^>?-g= zwMJ$dThI|~M06rG$Sv@C@tWR>_YgaG&!BAbkGggVQa#KdtDB)lMLNVLN|51C@F^y8 zCRvMB^{GO@j=cHfmy}_pCGbP%xb{pNN>? z?7tBz$1^zVaP|uaatYaIN+#xEN4jBzwZ|YI_)p(4CUAz1ZEbDk>J~Y|63SZaak~#0 zoYKruYsWHoOlC1(MhTnsdUOwQfz5p6-D0}4;DO$B;7#M{3lSE^jnTT;ns`>!G%i*F?@pR1JO{QTuD0U+~SlZxcc8~>IB{)@8p`P&+nDxNj`*gh|u?yrv$phpQcW)Us)bi`kT%qLj(fi{dWRZ%Es2!=3mI~UxiW0$-v3vUl?#g{p6eF zMEUAqo5-L0Ar(s{VlR9g=j7+lt!gP!UN2ICMokAZ5(Agd>})#gkA2w|5+<%-CuEP# zqgcM}u@3(QIC^Gx<2dbLj?cFSws_f3e%f4jeR?4M^M3cx1f+Qr6ydQ>n)kz1s##2w zk}UyQc+Z5G-d-1}{WzjkLXgS-2P7auWSJ%pSnD|Uivj5u!xk0 z_^-N9r9o;(rFDt~q1PvE#iJZ_f>J3gcP$)SOqhE~pD2|$=GvpL^d!r z6u=sp-CrMoF7;)}Zd7XO4XihC4ji?>V&(t^?@3Q&t9Mx=qex6C9d%{FE6dvU6%d94 zIE;hJ1J)cCqjv?F``7I*6bc#X)JW2b4f$L^>j{*$R`%5VHFi*+Q$2;nyieduE}qdS{L8y8F08yLs?w}{>8>$3236T-VMh@B zq-nujsb_1aUv_7g#)*rf9h%sFj*^mIcImRV*k~Vmw;%;YH(&ylYpy!&UjUVqqtfG` zox3esju?`unJJA_zKXRJP)rA3nXc$m^{S&-p|v|-0x9LHJm;XIww7C#R$?00l&Yyj z=e}gKUOpsImwW?N)+E(awoF@HyP^EhL+GlNB#k?R<2>95hz!h9sF@U20DHSB3~WMa zk90+858r@-+vWwkawJ)8ougd(i#1m3GLN{iSTylYz$brAsP%=&m$mQQrH$g%3-^VR zE%B`Vi&m8f3T~&myTEK28BDWCVzfWir1I?03;pX))|kY5ClO^+bae z*7E?g=3g7EiisYOrE+lA)2?Ln6q2*HLNpZEWMB|O-JI_oaHZB%CvYB(%=tU= zE*OY%QY58fW#RG5=gm0NR#iMB=EuNF@)%oZJ}nmm=tsJ?eGjia{e{yuU0l3{d^D@)kVDt=1PE)&tf_hHC%0MB znL|CRCPC}SeuVTdf>-QV70`0(EHizc21s^sU>y%hW0t!0&y<7}Wi-wGy>m%(-jsDj zP?mF|>p_K>liZ6ZP(w5(|9Ga%>tLgb$|doDDfkdW>Z z`)>V2XC?NJT26mL^@ zf+IKr27TfM!UbZ@?zRddC7#6ss1sw%CXJ4FWC+t3lHZupzM77m^=9 z&(a?-LxIq}*nvv)y?27lZ{j zifdl9hyJudyP2LpU$-kXctshbJDKS{WfulP5Dk~xU4Le4c#h^(YjJit4#R8_khheS z|8(>2ibaHES4+J|DBM7I#QF5u-*EdN{n=Kt@4Zt?@Tv{JZA{`4 zU#kYOv{#A&gGPwT+$Ud}AXlK3K7hYzo$(fBSFjrP{QQ zeaKg--L&jh$9N}`pu{Bs>?eDFPaWY4|9|foN%}i;3%;@4{dc+iw>m}{3rELqH21G! z`8@;w-zsJ1H(N3%|1B@#ioLOjib)j`EiJqPQVSbPSPVHCj6t5J&(NcWzBrzCiDt{4 zdlPAUKldz%6x5II1H_+jv)(xVL+a;P+-1hv_pM>gMRr%04@k;DTokASSKKhU1Qms| zrWh3a!b(J3n0>-tipg{a?UaKsP7?+|@A+1WPDiQIW1Sf@qDU~M_P65_s}7(gjTn0X zucyEm)o;f8UyshMy&>^SC3I|C6jR*R_GFwGranWZe*I>K+0k}pBuET&M~ z;Odo*ZcT?ZpduHyrf8E%IBFtv;JQ!N_m>!sV6ly$_1D{(&nO~w)G~Y`7sD3#hQk%^ zp}ucDF_$!6DAz*PM8yE(&~;%|=+h(Rn-=1Wykas_-@d&z#=S}rDf`4w(rVlcF&lF! z=1)M3YVz7orwk^BXhslJ8jR);sh^knJW(Qmm(QdSgIAIdlN4Te5KJisifjr?eB{FjAX1a0AB>d?qY4Wx>BZ8&}5K0fA+d{l8 z?^s&l8#j7pR&ijD?0b%;lL9l$P_mi2^*_OL+b}4kuLR$GAf85sOo02?Y#90}CCDiS zZ%rbCw>=H~CBO=C_JVV=xgDe%b4FaEFtuS7Q1##y686r%F6I)s-~2(}PWK|Z8M+Gu zl$y~5@#0Ka%$M<&Cv%L`a8X^@tY&T7<0|(6dNT=EsRe0%kp1Qyq!^43VAKYnr*A5~ zsI%lK1ewqO;0TpLrT9v}!@vJK{QoVa_+N4FYT#h?Y8rS1S&-G+m$FNMP?(8N`MZP zels(*?kK{{^g9DOzkuZXJ2;SrOQsp9T$hwRB1(phw1c7`!Q!by?Q#YsSM#I12RhU{$Q+{xj83axHcftEc$mNJ8_T7A-BQc*k(sZ+~NsO~xAA zxnbb%dam_fZlHvW7fKXrB~F&jS<4FD2FqY?VG?ix*r~MDXCE^WQ|W|WM;gsIA4lQP zJ2hAK@CF*3*VqPr2eeg6GzWFlICi8S>nO>5HvWzyZTE)hlkdC_>pBej*>o0EOHR|) z$?};&I4+_?wvL*g#PJ9)!bc#9BJu1(*RdNEn>#Oxta(VWeM40ola<0aOe2kSS~{^P zDJBd}0L-P#O-CzX*%+$#v;(x%<*SPgAje=F{Zh-@ucd2DA(yC|N_|ocs*|-!H%wEw z@Q!>siv2W;C^^j^59OAX03&}&D*W4EjCvfi(ygcL#~t8XGa#|NPO+*M@Y-)ctFA@I z-p7npT1#5zOLo>7q?aZpCZ=iecn3QYklP;gF0bq@>oyBq94f6C=;Csw3PkZ|5q=(c zfs`aw?II0e(h=|7o&T+hq&m$; zBrE09Twxd9BJ2P+QPN}*OdZ-JZV7%av@OM7v!!NL8R;%WFq*?{9T3{ct@2EKgc8h) zMxoM$SaF#p<`65BwIDfmXG6+OiK0e)`I=!A3E`+K@61f}0e z!2a*FOaDrOe>U`q%K!QN`&=&0C~)CaL3R4VY(NDt{Xz(Xpqru5=r#uQN1L$Je1*dkdqQ*=lofQaN%lO!<5z9ZlHgxt|`THd>2 zsWfU$9=p;yLyJyM^t zS2w9w?Bpto`@H^xJpZDKR1@~^30Il6oFGfk5%g6w*C+VM)+%R@gfIwNprOV5{F^M2 zO?n3DEzpT+EoSV-%OdvZvNF+pDd-ZVZ&d8 zKeIyrrfPN=EcFRCPEDCVflX#3-)Ik_HCkL(ejmY8vzcf-MTA{oHk!R2*36`O68$7J zf}zJC+bbQk--9Xm!u#lgLvx8TXx2J258E5^*IZ(FXMpq$2LUUvhWQPs((z1+2{Op% z?J}9k5^N=z;7ja~zi8a_-exIqWUBJwohe#4QJ`|FF*$C{lM18z^#hX6!5B8KAkLUX ziP=oti-gpV(BsLD{0(3*dw}4JxK23Y7M{BeFPucw!sHpY&l%Ws4pSm`+~V7;bZ%Dx zeI)MK=4vC&5#;2MT7fS?^ch9?2;%<8Jlu-IB&N~gg8t;6S-#C@!NU{`p7M8@2iGc& zg|JPg%@gCoCQ&s6JvDU&`X2S<57f(k8nJ1wvBu{8r?;q3_kpZZ${?|( z+^)UvR33sjSd)aT!UPkA;ylO6{aE3MQa{g%Mcf$1KONcjO@&g5zPHWtzM1rYC{_K> zgQNcs<{&X{OA=cEWw5JGqpr0O>x*Tfak2PE9?FuWtz^DDNI}rwAaT0(bdo-<+SJ6A z&}S%boGMWIS0L}=S>|-#kRX;e^sUsotry(MjE|3_9duvfc|nwF#NHuM-w7ZU!5ei8 z6Mkf>2)WunY2eU@C-Uj-A zG(z0Tz2YoBk>zCz_9-)4a>T46$(~kF+Y{#sA9MWH%5z#zNoz)sdXq7ZR_+`RZ%0(q zC7&GyS_|BGHNFl8Xa%@>iWh%Gr?=J5<(!OEjauj5jyrA-QXBjn0OAhJJ9+v=!LK`` z@g(`^*84Q4jcDL`OA&ZV60djgwG`|bcD*i50O}Q{9_noRg|~?dj%VtKOnyRs$Uzqg z191aWoR^rDX#@iSq0n z?9Sg$WSRPqSeI<}&n1T3!6%Wj@5iw5`*`Btni~G=&;J+4`7g#OQTa>u`{4ZZ(c@s$ zK0y;ySOGD-UTjREKbru{QaS>HjN<2)R%Nn-TZiQ(Twe4p@-saNa3~p{?^V9Nixz@a zykPv~<@lu6-Ng9i$Lrk(xi2Tri3q=RW`BJYOPC;S0Yly%77c727Yj-d1vF!Fuk{Xh z)lMbA69y7*5ufET>P*gXQrxsW+ zz)*MbHZv*eJPEXYE<6g6_M7N%#%mR{#awV3i^PafNv(zyI)&bH?F}2s8_rR(6%!V4SOWlup`TKAb@ee>!9JKPM=&8g#BeYRH9FpFybxBXQI2|g}FGJfJ+ zY-*2hB?o{TVL;Wt_ek;AP5PBqfDR4@Z->_182W z{P@Mc27j6jE*9xG{R$>6_;i=y{qf(c`5w9fa*`rEzX6t!KJ(p1H|>J1pC-2zqWENF zmm=Z5B4u{cY2XYl(PfrInB*~WGWik3@1oRhiMOS|D;acnf-Bs(QCm#wR;@Vf!hOPJ zgjhDCfDj$HcyVLJ=AaTbQ{@vIv14LWWF$=i-BDoC11}V;2V8A`S>_x)vIq44-VB-v z*w-d}$G+Ql?En8j!~ZkCpQ$|cA0|+rrY>tiCeWxkRGPoarxlGU2?7%k#F693RHT24 z-?JsiXlT2PTqZqNb&sSc>$d;O4V@|b6VKSWQb~bUaWn1Cf0+K%`Q&Wc<>mQ>*iEGB zbZ;aYOotBZ{vH3y<0A*L0QVM|#rf*LIsGx(O*-7)r@yyBIzJnBFSKBUSl1e|8lxU* zzFL+YDVVkIuzFWeJ8AbgN&w(4-7zbiaMn{5!JQXu)SELk*CNL+Fro|2v|YO)1l15t zs(0^&EB6DPMyaqvY>=KL>)tEpsn;N5Q#yJj<9}ImL((SqErWN3Q=;tBO~ExTCs9hB z2E$7eN#5wX4<3m^5pdjm#5o>s#eS_Q^P)tm$@SawTqF*1dj_i#)3};JslbLKHXl_N z)Fxzf>FN)EK&Rz&*|6&%Hs-^f{V|+_vL1S;-1K-l$5xiC@}%uDuwHYhmsV?YcOUlk zOYkG5v2+`+UWqpn0aaaqrD3lYdh0*!L`3FAsNKu=Q!vJu?Yc8n|CoYyDo_`r0mPoo z8>XCo$W4>l(==h?2~PoRR*kEe)&IH{1sM41mO#-36`02m#nTX{r*r`Q5rZ2-sE|nA zhnn5T#s#v`52T5|?GNS`%HgS2;R(*|^egNPDzzH_z^W)-Q98~$#YAe)cEZ%vge965AS_am#DK#pjPRr-!^za8>`kksCAUj(Xr*1NW5~e zpypt_eJpD&4_bl_y?G%>^L}=>xAaV>KR6;^aBytqpiHe%!j;&MzI_>Sx7O%F%D*8s zSN}cS^<{iiK)=Ji`FpO#^zY!_|D)qeRNAtgmH)m;qC|mq^j(|hL`7uBz+ULUj37gj zksdbnU+LSVo35riSX_4z{UX=%n&}7s0{WuZYoSfwAP`8aKN9P@%e=~1`~1ASL-z%# zw>DO&ixr}c9%4InGc*_y42bdEk)ZdG7-mTu0bD@_vGAr*NcFoMW;@r?@LUhRI zCUJgHb`O?M3!w)|CPu~ej%fddw20lod?Ufp8Dmt0PbnA0J%KE^2~AIcnKP()025V> zG>noSM3$5Btmc$GZoyP^v1@Poz0FD(6YSTH@aD0}BXva?LphAiSz9f&Y(aDAzBnUh z?d2m``~{z;{}kZJ>a^wYI?ry(V9hIoh;|EFc0*-#*`$T0DRQ1;WsqInG;YPS+I4{g zJGpKk%%Sdc5xBa$Q^_I~(F97eqDO7AN3EN0u)PNBAb+n+ zWBTxQx^;O9o0`=g+Zrt_{lP!sgWZHW?8bLYS$;1a@&7w9rD9|Ge;Gb?sEjFoF9-6v z#!2)t{DMHZ2@0W*fCx;62d#;jouz`R5Y(t{BT=$N4yr^^o$ON8d{PQ=!O zX17^CrdM~7D-;ZrC!||<+FEOxI_WI3CA<35va%4v>gc zEX-@h8esj=a4szW7x{0g$hwoWRQG$yK{@3mqd-jYiVofJE!Wok1* znV7Gm&Ssq#hFuvj1sRyHg(6PFA5U*Q8Rx>-blOs=lb`qa{zFy&n4xY;sd$fE+<3EI z##W$P9M{B3c3Si9gw^jlPU-JqD~Cye;wr=XkV7BSv#6}DrsXWFJ3eUNrc%7{=^sP> zrp)BWKA9<}^R9g!0q7yWlh;gr_TEOD|#BmGq<@IV;ueg+D2}cjpp+dPf&Q(36sFU&K8}hA85U61faW&{ zlB`9HUl-WWCG|<1XANN3JVAkRYvr5U4q6;!G*MTdSUt*Mi=z_y3B1A9j-@aK{lNvx zK%p23>M&=KTCgR!Ee8c?DAO2_R?B zkaqr6^BSP!8dHXxj%N1l+V$_%vzHjqvu7p@%Nl6;>y*S}M!B=pz=aqUV#`;h%M0rU zHfcog>kv3UZAEB*g7Er@t6CF8kHDmKTjO@rejA^ULqn!`LwrEwOVmHx^;g|5PHm#B zZ+jjWgjJ!043F+&#_;D*mz%Q60=L9Ove|$gU&~As5^uz@2-BfQ!bW)Khn}G+Wyjw- z19qI#oB(RSNydn0t~;tAmK!P-d{b-@@E5|cdgOS#!>%#Rj6ynkMvaW@37E>@hJP^8 z2zk8VXx|>#R^JCcWdBCy{0nPmYFOxN55#^-rlqobe0#L6)bi?E?SPymF*a5oDDeSd zO0gx?#KMoOd&G(2O@*W)HgX6y_aa6iMCl^~`{@UR`nMQE`>n_{_aY5nA}vqU8mt8H z`oa=g0SyiLd~BxAj2~l$zRSDHxvDs;I4>+M$W`HbJ|g&P+$!U7-PHX4RAcR0szJ*( ze-417=bO2q{492SWrqDK+L3#ChUHtz*@MP)e^%@>_&#Yk^1|tv@j4%3T)diEX zATx4K*hcO`sY$jk#jN5WD<=C3nvuVsRh||qDHnc~;Kf59zr0;c7VkVSUPD%NnnJC_ zl3F^#f_rDu8l}l8qcAz0FFa)EAt32IUy_JLIhU_J^l~FRH&6-ivSpG2PRqzDdMWft>Zc(c)#tb%wgmWN%>IOPm zZi-noqS!^Ftb81pRcQi`X#UhWK70hy4tGW1mz|+vI8c*h@ zfFGJtW3r>qV>1Z0r|L>7I3un^gcep$AAWfZHRvB|E*kktY$qQP_$YG60C@X~tTQjB3%@`uz!qxtxF+LE!+=nrS^07hn` zEgAp!h|r03h7B!$#OZW#ACD+M;-5J!W+{h|6I;5cNnE(Y863%1(oH}_FTW})8zYb$7czP zg~Szk1+_NTm6SJ0MS_|oSz%e(S~P-&SFp;!k?uFayytV$8HPwuyELSXOs^27XvK-D zOx-Dl!P|28DK6iX>p#Yb%3`A&CG0X2S43FjN%IB}q(!hC$fG}yl1y9W&W&I@KTg6@ zK^kpH8=yFuP+vI^+59|3%Zqnb5lTDAykf z9S#X`3N(X^SpdMyWQGOQRjhiwlj!0W-yD<3aEj^&X%=?`6lCy~?`&WSWt z?U~EKFcCG_RJ(Qp7j=$I%H8t)Z@6VjA#>1f@EYiS8MRHZphp zMA_5`znM=pzUpBPO)pXGYpQ6gkine{6u_o!P@Q+NKJ}k!_X7u|qfpAyIJb$_#3@wJ z<1SE2Edkfk9C!0t%}8Yio09^F`YGzpaJHGk*-ffsn85@)%4@`;Fv^8q(-Wk7r=Q8p zT&hD`5(f?M{gfzGbbwh8(}G#|#fDuk7v1W)5H9wkorE0ZZjL0Q1=NRGY>zwgfm81DdoaVwNH;or{{eSyybt)m<=zXoA^RALYG-2t zouH|L*BLvmm9cdMmn+KGopyR@4*=&0&4g|FLoreZOhRmh=)R0bg~ zT2(8V_q7~42-zvb)+y959OAv!V$u(O3)%Es0M@CRFmG{5sovIq4%8Ahjk#*5w{+)+ zMWQoJI_r$HxL5km1#6(e@{lK3Udc~n0@g`g$s?VrnQJ$!oPnb?IHh-1qA`Rz$)Ai< z6w$-MJW-gKNvOhL+XMbE7&mFt`x1KY>k4(!KbbpZ`>`K@1J<(#vVbjx@Z@(6Q}MF# zMnbr-f55(cTa^q4+#)=s+ThMaV~E`B8V=|W_fZWDwiso8tNMTNse)RNBGi=gVwgg% zbOg8>mbRN%7^Um-7oj4=6`$|(K7!+t^90a{$18Z>}<#!bm%ZEFQ{X(yBZMc>lCz0f1I2w9Sq zuGh<9<=AO&g6BZte6hn>Qmvv;Rt)*cJfTr2=~EnGD8P$v3R|&1RCl&7)b+`=QGapi zPbLg_pxm`+HZurtFZ;wZ=`Vk*do~$wB zxoW&=j0OTbQ=Q%S8XJ%~qoa3Ea|au5o}_(P;=!y-AjFrERh%8la!z6Fn@lR?^E~H12D?8#ht=1F;7@o4$Q8GDj;sSC%Jfn01xgL&%F2 zwG1|5ikb^qHv&9hT8w83+yv&BQXOQyMVJSBL(Ky~p)gU3#%|blG?IR9rP^zUbs7rOA0X52Ao=GRt@C&zlyjNLv-} z9?*x{y(`509qhCV*B47f2hLrGl^<@SuRGR!KwHei?!CM10Tq*YDIoBNyRuO*>3FU? zHjipIE#B~y3FSfOsMfj~F9PNr*H?0oHyYB^G(YyNh{SxcE(Y-`x5jFMKb~HO*m+R% zrq|ic4fzJ#USpTm;X7K+E%xsT_3VHKe?*uc4-FsILUH;kL>_okY(w`VU*8+l>o>Jm ziU#?2^`>arnsl#)*R&nf_%>A+qwl%o{l(u)M?DK1^mf260_oteV3#E_>6Y4!_hhVD zM8AI6MM2V*^_M^sQ0dmHu11fy^kOqXqzpr?K$`}BKWG`=Es(9&S@K@)ZjA{lj3ea7_MBP zk(|hBFRjHVMN!sNUkrB;(cTP)T97M$0Dtc&UXSec<+q?y>5=)}S~{Z@ua;1xt@=T5 zI7{`Z=z_X*no8s>mY;>BvEXK%b`a6(DTS6t&b!vf_z#HM{Uoy_5fiB(zpkF{})ruka$iX*~pq1ZxD?q68dIo zIZSVls9kFGsTwvr4{T_LidcWtt$u{kJlW7moRaH6+A5hW&;;2O#$oKyEN8kx`LmG)Wfq4ykh+q{I3|RfVpkR&QH_x;t41Uw z`P+tft^E2B$domKT@|nNW`EHwyj>&}K;eDpe z1bNOh=fvIfk`&B61+S8ND<(KC%>y&?>opCnY*r5M+!UrWKxv0_QvTlJc>X#AaI^xo zaRXL}t5Ej_Z$y*|w*$6D+A?Lw-CO-$itm^{2Ct82-<0IW)0KMNvJHgBrdsIR0v~=H z?n6^}l{D``Me90`^o|q!olsF?UX3YSq^6Vu>Ijm>>PaZI8G@<^NGw{Cx&%|PwYrfw zR!gX_%AR=L3BFsf8LxI|K^J}deh0ZdV?$3r--FEX`#INxsOG6_=!v)DI>0q|BxT)z z-G6kzA01M?rba+G_mwNMQD1mbVbNTWmBi*{s_v_Ft9m2Avg!^78(QFu&n6mbRJ2bA zv!b;%yo{g*9l2)>tsZJOOp}U~8VUH`}$ z8p_}t*XIOehezolNa-a2x0BS})Y9}&*TPgua{Ewn-=wVrmJUeU39EKx+%w%=ixQWK zDLpwaNJs65#6o7Ln7~~X+p_o2BR1g~VCfxLzxA{HlWAI6^H;`juI=&r1jQrUv_q0Z z1Ja-tjdktrrP>GOC*#p?*xfQU5MqjMsBe!9lh(u8)w$e@Z|>aUHI5o;MGw*|Myiz3 z-f0;pHg~Q#%*Kx8MxH%AluVXjG2C$)WL-K63@Q`#y9_k_+}eR(x4~dp7oV-ek0H>I zgy8p#i4GN{>#v=pFYUQT(g&b$OeTy-X_#FDgNF8XyfGY6R!>inYn8IR2RDa&O!(6< znXs{W!bkP|s_YI*Yx%4stI`=ZO45IK6rBs`g7sP40ic}GZ58s?Mc$&i`kq_tfci>N zIHrC0H+Qpam1bNa=(`SRKjixBTtm&e`j9porEci!zdlg1RI0Jw#b(_Tb@RQK1Zxr_ z%7SUeH6=TrXt3J@js`4iDD0=IoHhK~I7^W8^Rcp~Yaf>2wVe|Hh1bUpX9ATD#moByY57-f2Ef1TP^lBi&p5_s7WGG9|0T}dlfxOx zXvScJO1Cnq`c`~{Dp;{;l<-KkCDE+pmexJkd}zCgE{eF=)K``-qC~IT6GcRog_)!X z?fK^F8UDz$(zFUrwuR$qro5>qqn>+Z%<5>;_*3pZ8QM|yv9CAtrAx;($>4l^_$_-L z*&?(77!-=zvnCVW&kUcZMb6;2!83si518Y%R*A3JZ8Is|kUCMu`!vxDgaWjs7^0j( ziTaS4HhQ)ldR=r)_7vYFUr%THE}cPF{0H45FJ5MQW^+W>P+eEX2kLp3zzFe*-pFVA zdDZRybv?H|>`9f$AKVjFWJ=wegO7hOOIYCtd?Vj{EYLT*^gl35|HQ`R=ti+ADm{jyQE7K@kdjuqJhWVSks>b^ zxha88-h3s;%3_5b1TqFCPTxVjvuB5U>v=HyZ$?JSk+&I%)M7KE*wOg<)1-Iy)8-K! z^XpIt|0ibmk9RtMmlUd7#Ap3Q!q9N4atQy)TmrhrFhfx1DAN`^vq@Q_SRl|V z#lU<~n67$mT)NvHh`%als+G-)x1`Y%4Bp*6Un5Ri9h=_Db zA-AdP!f>f0m@~>7X#uBM?diI@)Egjuz@jXKvm zJo+==juc9_<;CqeRaU9_Mz@;3e=E4=6TK+c`|uu#pIqhSyNm`G(X)&)B`8q0RBv#> z`gGlw(Q=1Xmf55VHj%C#^1lpc>LY8kfA@|rlC1EA<1#`iuyNO z(=;irt{_&K=i4)^x%;U(Xv<)+o=dczC5H3W~+e|f~{*ucxj@{Yi-cw^MqYr3fN zF5D+~!wd$#al?UfMnz(@K#wn`_5na@rRr8XqN@&M&FGEC@`+OEv}sI1hw>Up0qAWf zL#e4~&oM;TVfjRE+10B_gFlLEP9?Q-dARr3xi6nQqnw>k-S;~b z;!0s2VS4}W8b&pGuK=7im+t(`nz@FnT#VD|!)eQNp-W6)@>aA+j~K*H{$G`y2|QHY z|Hmy+CR@#jWY4~)lr1qBJB_RfHJFfP<}pK5(#ZZGSqcpyS&}01LnTWk5fzmXMGHkJ zTP6L^B+uj;lmB_W<~4=${+v0>z31M!-_O@o-O9GyW)j_mjx}!0@br_LE-7SIuPP84 z;5=O(U*g_um0tyG|61N@d9lEuOeiRd+#NY^{nd5;-CVlw&Ap7J?qwM^?E29wvS}2d zbzar4Fz&RSR(-|s!Z6+za&Z zY#D<5q_JUktIzvL0)yq_kLWG6DO{ri=?c!y!f(Dk%G{8)k`Gym%j#!OgXVDD3;$&v@qy#ISJfp=Vm>pls@9-mapVQChAHHd-x+OGx)(*Yr zC1qDUTZ6mM(b_hi!TuFF2k#8uI2;kD70AQ&di$L*4P*Y-@p`jdm%_c3f)XhYD^6M8&#Y$ZpzQMcR|6nsH>b=*R_Von!$BTRj7yGCXokoAQ z&ANvx0-Epw`QIEPgI(^cS2f(Y85yV@ygI{ewyv5Frng)e}KCZF7JbR(&W618_dcEh(#+^zZFY;o<815<5sOHQdeax9_!PyM&;{P zkBa5xymca0#)c#tke@3KNEM8a_mT&1gm;p&&JlMGH(cL(b)BckgMQ^9&vRwj!~3@l zY?L5}=Jzr080OGKb|y`ee(+`flQg|!lo6>=H)X4`$Gz~hLmu2a%kYW_Uu8x09Pa0J zKZ`E$BKJ=2GPj_3l*TEcZ*uYRr<*J^#5pILTT;k_cgto1ZL-%slyc16J~OH-(RgDA z%;EjEnoUkZ&acS{Q8`{i6T5^nywgqQI5bDIymoa7CSZG|WWVk>GM9)zy*bNih|QIm z%0+(Nnc*a_xo;$=!HQYaapLms>J1ToyjtFByY`C2H1wT#178#4+|{H0BBqtCdd$L% z_3Hc60j@{t9~MjM@LBalR&6@>B;9?r<7J~F+WXyYu*y3?px*=8MAK@EA+jRX8{CG?GI-< z54?Dc9CAh>QTAvyOEm0^+x;r2BWX|{3$Y7)L5l*qVE*y0`7J>l2wCmW zL1?|a`pJ-l{fb_N;R(Z9UMiSj6pQjOvQ^%DvhIJF!+Th7jO2~1f1N+(-TyCFYQZYw z4)>7caf^Ki_KJ^Zx2JUb z&$3zJy!*+rCV4%jqwyuNY3j1ZEiltS0xTzd+=itTb;IPYpaf?8Y+RSdVdpacB(bVQ zC(JupLfFp8y43%PMj2}T|VS@%LVp>hv4Y!RPMF?pp8U_$xCJ)S zQx!69>bphNTIb9yn*_yfj{N%bY)t{L1cs8<8|!f$;UQ*}IN=2<6lA;x^(`8t?;+ST zh)z4qeYYgZkIy{$4x28O-pugO&gauRh3;lti9)9Pvw+^)0!h~%m&8Q!AKX%urEMnl z?yEz?g#ODn$UM`+Q#$Q!6|zsq_`dLO5YK-6bJM6ya>}H+vnW^h?o$z;V&wvuM$dR& zeEq;uUUh$XR`TWeC$$c&Jjau2it3#%J-y}Qm>nW*s?En?R&6w@sDXMEr#8~$=b(gk zwDC3)NtAP;M2BW_lL^5ShpK$D%@|BnD{=!Tq)o(5@z3i7Z){} zGr}Exom_qDO{kAVkZ*MbLNHE666Kina#D{&>Jy%~w7yX$oj;cYCd^p9zy z8*+wgSEcj$4{WxKmCF(5o7U4jqwEvO&dm1H#7z}%VXAbW&W24v-tS6N3}qrm1OnE)fUkoE8yMMn9S$?IswS88tQWm4#Oid#ckgr6 zRtHm!mfNl-`d>O*1~d7%;~n+{Rph6BBy^95zqI{K((E!iFQ+h*C3EsbxNo_aRm5gj zKYug($r*Q#W9`p%Bf{bi6;IY0v`pB^^qu)gbg9QHQ7 zWBj(a1YSu)~2RK8Pi#C>{DMlrqFb9e_RehEHyI{n?e3vL_}L>kYJC z_ly$$)zFi*SFyNrnOt(B*7E$??s67EO%DgoZL2XNk8iVx~X_)o++4oaK1M|ou73vA0K^503j@uuVmLcHH4ya-kOIDfM%5%(E z+Xpt~#7y2!KB&)PoyCA+$~DXqxPxxALy!g-O?<9+9KTk4Pgq4AIdUkl`1<1#j^cJg zgU3`0hkHj_jxV>`Y~%LAZl^3o0}`Sm@iw7kwff{M%VwtN)|~!p{AsfA6vB5UolF~d zHWS%*uBDt<9y!9v2Xe|au&1j&iR1HXCdyCjxSgG*L{wmTD4(NQ=mFjpa~xooc6kju z`~+d{j7$h-;HAB04H!Zscu^hZffL#9!p$)9>sRI|Yovm)g@F>ZnosF2EgkU3ln0bR zTA}|+E(tt)!SG)-bEJi_0m{l+(cAz^pi}`9=~n?y&;2eG;d9{M6nj>BHGn(KA2n|O zt}$=FPq!j`p&kQ8>cirSzkU0c08%8{^Qyqi-w2LoO8)^E7;;I1;HQ6B$u0nNaX2CY zSmfi)F`m94zL8>#zu;8|{aBui@RzRKBlP1&mfFxEC@%cjl?NBs`cr^nm){>;$g?rhKr$AO&6qV_Wbn^}5tfFBry^e1`%du2~o zs$~dN;S_#%iwwA_QvmMjh%Qo?0?rR~6liyN5Xmej8(*V9ym*T`xAhHih-v$7U}8=dfXi2i*aAB!xM(Xekg*ix@r|ymDw*{*s0?dlVys2e)z62u1 z+k3esbJE=-P5S$&KdFp+2H7_2e=}OKDrf( z9-207?6$@f4m4B+9E*e((Y89!q?zH|mz_vM>kp*HGXldO0Hg#!EtFhRuOm$u8e~a9 z5(roy7m$Kh+zjW6@zw{&20u?1f2uP&boD}$#Zy)4o&T;vyBoqFiF2t;*g=|1=)PxB z8eM3Mp=l_obbc?I^xyLz?4Y1YDWPa+nm;O<$Cn;@ane616`J9OO2r=rZr{I_Kizyc zP#^^WCdIEp*()rRT+*YZK>V@^Zs=ht32x>Kwe zab)@ZEffz;VM4{XA6e421^h~`ji5r%)B{wZu#hD}f3$y@L0JV9f3g{-RK!A?vBUA}${YF(vO4)@`6f1 z-A|}e#LN{)(eXloDnX4Vs7eH|<@{r#LodP@Nz--$Dg_Par%DCpu2>2jUnqy~|J?eZ zBG4FVsz_A+ibdwv>mLp>P!(t}E>$JGaK$R~;fb{O3($y1ssQQo|5M;^JqC?7qe|hg zu0ZOqeFcp?qVn&Qu7FQJ4hcFi&|nR!*j)MF#b}QO^lN%5)4p*D^H+B){n8%VPUzi! zDihoGcP71a6!ab`l^hK&*dYrVYzJ0)#}xVrp!e;lI!+x+bfCN0KXwUAPU9@#l7@0& QuEJmfE|#`Dqx|px0L@K;Y5)KL diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index ffed3a254e91..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/gradlew b/samples/client/petstore/java/okhttp-gson-nextgen/gradlew deleted file mode 100644 index 005bcde04284..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/gradlew +++ /dev/null @@ -1,234 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/gradlew.bat b/samples/client/petstore/java/okhttp-gson-nextgen/gradlew.bat deleted file mode 100644 index 6a68175eb70f..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/hello.txt b/samples/client/petstore/java/okhttp-gson-nextgen/hello.txt deleted file mode 100644 index 6769dd60bdf5..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello world! \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml b/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml deleted file mode 100644 index e9f84b263ee9..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml +++ /dev/null @@ -1,349 +0,0 @@ - - 4.0.0 - org.openapitools - petstore-okhttp-gson-nextgen - jar - petstore-okhttp-gson-nextgen - 1.0.0 - https://github.com/openapitools/openapi-generator - OpenAPI Java - - scm:git:git@github.com:openapitools/openapi-generator.git - scm:git:git@github.com:openapitools/openapi-generator.git - https://github.com/openapitools/openapi-generator - - - - - Unlicense - https://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - OpenAPI-Generator Contributors - team@openapitools.org - OpenAPITools.org - http://openapitools.org - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - true - 128m - 512m - - -Xlint:all - -J-Xss4m - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M5 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - 10 - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - - test-jar - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.2.0 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.3.1 - - - attach-javadocs - - jar - - - - - none - - - http.response.details - a - Http Response Details: - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.0 - - - attach-sources - - jar-no-fork - - - - - - - com.diffplug.spotless - spotless-maven-plugin - ${spotless.version} - - - - - - - .gitignore - - - - - - true - 4 - - - - - - - - - - 1.8 - - true - - - - - - - - - - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.squareup.okhttp3 - okhttp - ${okhttp-version} - - - com.squareup.okhttp3 - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - 1.0.1 - - - org.apache.commons - commons-lang3 - ${commons-lang3-version} - - - org.threeten - threetenbp - ${threetenbp-version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - provided - - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - - javax.ws.rs - jsr311-api - 1.1.1 - - - javax.ws.rs - javax.ws.rs-api - 2.0 - - - - junit - junit - ${junit-version} - test - - - org.mockito - mockito-core - 3.12.4 - test - - - - 1.8 - ${java.version} - ${java.version} - 1.8.5 - 1.6.3 - 4.9.2 - 2.8.8 - 3.12.0 - 0.2.2 - 1.5.0 - 1.3.5 - 4.13.2 - UTF-8 - 2.17.3 - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/settings.gradle b/samples/client/petstore/java/okhttp-gson-nextgen/settings.gradle deleted file mode 100644 index db500510c406..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "petstore-okhttp-gson-nextgen" \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/AndroidManifest.xml b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/AndroidManifest.xml deleted file mode 100644 index 54fbcb3da1e8..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiCallback.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiCallback.java deleted file mode 100644 index e9ab7a8d7a60..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiCallback.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import java.io.IOException; - -import java.util.Map; -import java.util.List; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure(ApiException e, int statusCode, Map> responseHeaders); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess(T result, int statusCode, Map> responseHeaders); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API download processing. - * - * @param bytesRead bytes Read - * @param contentLength content length of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java deleted file mode 100644 index 5979da1e8958..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java +++ /dev/null @@ -1,1553 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.common.message.types.GrantType; - -import javax.net.ssl.*; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URI; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.openapitools.client.auth.Authentication; -import org.openapitools.client.auth.HttpBasicAuth; -import org.openapitools.client.auth.HttpBearerAuth; -import org.openapitools.client.auth.ApiKeyAuth; -import org.openapitools.client.auth.OAuth; -import org.openapitools.client.auth.RetryingOAuth; -import org.openapitools.client.auth.OAuthFlow; - -/** - *

    ApiClient class.

    - */ -public class ApiClient { - - private String basePath = "http://petstore.swagger.io:80/v2"; - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - /** - * Basic constructor for ApiClient - */ - public ApiClient() { - init(); - initHttpClient(); - - // Setup authentications (key: authentication name, value: authentication). - authentications.put("api_key", new ApiKeyAuth("header", "api_key")); - authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); - authentications.put("bearer_test", new HttpBearerAuth("bearer")); - authentications.put("http_basic_test", new HttpBasicAuth()); - authentications.put("http_signature_test", new HttpBearerAuth("signature")); - authentications.put("petstore_auth", new OAuth()); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Basic constructor with custom OkHttpClient - * - * @param client a {@link okhttp3.OkHttpClient} object - */ - public ApiClient(OkHttpClient client) { - init(); - - httpClient = client; - - // Setup authentications (key: authentication name, value: authentication). - authentications.put("api_key", new ApiKeyAuth("header", "api_key")); - authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); - authentications.put("bearer_test", new HttpBearerAuth("bearer")); - authentications.put("http_basic_test", new HttpBasicAuth()); - authentications.put("http_signature_test", new HttpBearerAuth("signature")); - authentications.put("petstore_auth", new OAuth()); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID - * - * @param clientId client ID - */ - public ApiClient(String clientId) { - this(clientId, null, null); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters - * - * @param clientId client ID - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, Map parameters) { - this(clientId, null, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters - * - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, String clientSecret, Map parameters) { - this(null, clientId, clientSecret, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters - * - * @param basePath base path - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { - init(); - if (basePath != null) { - this.basePath = basePath; - } - - String tokenUrl = ""; - if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { - URI uri = URI.create(getBasePath()); - tokenUrl = uri.getScheme() + ":" + - (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") + - tokenUrl; - if (!URI.create(tokenUrl).isAbsolute()) { - throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); - } - } - RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.IMPLICIT, clientSecret, parameters); - authentications.put( - "petstore_auth", - retryingOAuth - ); - initHttpClient(Collections.singletonList(retryingOAuth)); - // Setup authentications (key: authentication name, value: authentication). - authentications.put("api_key", new ApiKeyAuth("header", "api_key")); - authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); - authentications.put("bearer_test", new HttpBearerAuth("bearer")); - authentications.put("http_basic_test", new HttpBasicAuth()); - authentications.put("http_signature_test", new HttpBearerAuth("signature")); - - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - private void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - private void initHttpClient(List interceptors) { - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { - builder.addInterceptor(interceptor); - } - - httpClient = builder.build(); - } - - private void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.0.0/java"); - - authentications = new HashMap(); - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g http://petstore.swagger.io:80/v2 - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Set HTTP client, which must never be null. - * - * @param newHttpClient An instance of OkHttpClient - * @return Api Client - * @throws java.lang.NullPointerException when newHttpClient is null - */ - public ApiClient setHttpClient(OkHttpClient newHttpClient) { - this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); - return this; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - *

    Getter for the field keyManagers.

    - * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - *

    Getter for the field dateFormat.

    - * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - *

    Setter for the field dateFormat.

    - * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); - return this; - } - - /** - *

    Set SqlDateFormat.

    - * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); - return this; - } - - /** - *

    Set OffsetDateTimeFormat.

    - * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - *

    Set LocalDateFormat.

    - * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - /** - *

    Set LenientOnJson.

    - * - * @param lenientOnJson a boolean - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. - * - * @see
    createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * - * @return Token request builder - */ - public TokenRequestBuilder getTokenEndPoint() { - for (Authentication apiAuth : authentications.values()) { - if (apiAuth instanceof RetryingOAuth) { - RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; - return retryingOAuth.getTokenRequestBuilder(); - } - } - return null; - } - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(String collectionFormat, Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * returns null. If it matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if (contentTypes[0].equals("*/*")) { - return "application/json"; - } - - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; - } catch (IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws org.openapitools.client.ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = json.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - - final String url = buildUrl(path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - String contentType = headerParams.get("Content-Type"); - - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { - for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - for (Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws org.openapitools.client.ApiException If fails to update the parameters - */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RuntimeException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. - */ - private Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } - - /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; - } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); - } else { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); - } - trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { - try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); - } - } - - /** - * Convert the HTTP request body to a string. - * - * @param request The HTTP request object - * @return The string representation of the HTTP request body - * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string - */ - private String requestBodyToString(RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - // empty http request body - return ""; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java deleted file mode 100644 index 60e4f9a5e7e6..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import java.util.Map; -import java.util.List; - -import javax.ws.rs.core.GenericType; - -/** - *

    ApiException class.

    - */ -@SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ApiException extends Exception { - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - private Object errorObject = null; - private GenericType errorObjectType = null; - - /** - *

    Constructor for ApiException.

    - */ - public ApiException() {} - - /** - *

    Constructor for ApiException.

    - * - * @param throwable a {@link java.lang.Throwable} object - */ - public ApiException(Throwable throwable) { - super(throwable); - } - - /** - *

    Constructor for ApiException.

    - * - * @param message the error message - */ - public ApiException(String message) { - super(message); - } - - /** - *

    Constructor for ApiException.

    - * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - *

    Constructor for ApiException.

    - * - * @param message the error message - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

    Constructor for ApiException.

    - * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - /** - *

    Constructor for ApiException.

    - * - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

    Constructor for ApiException.

    - * - * @param code HTTP status code - * @param message a {@link java.lang.String} object - */ - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - /** - *

    Constructor for ApiException.

    - * - * @param code HTTP status code - * @param message the error message - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } - - /** - * Get the error object type. - * - * @return Error object type - */ - public GenericType getErrorObjectType() { - return errorObjectType; - } - - /** - * Set the error object type. - * - * @param errorObjectType object type - */ - public void setErrorObjectType(GenericType errorObjectType) { - this.errorObjectType = errorObjectType; - } - - /** - * Get the error object. - * - * @return Error object - */ - public Object getErrorObject() { - return errorObject; - } - - /** - * Get the error object. - * - * @param errorObject Error object - */ - public void setErrorObject(Object errorObject) { - this.errorObject = errorObject; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiResponse.java deleted file mode 100644 index fb13945bd775..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import java.util.List; -import java.util.Map; - -/** - * API response returned by API call. - */ -public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; - - /** - *

    Constructor for ApiResponse.

    - * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - *

    Constructor for ApiResponse.

    - * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - this.headers = headers; - this.data = data; - } - - /** - *

    Get the status code.

    - * - * @return the status code - */ - public int getStatusCode() { - return statusCode; - } - - /** - *

    Get the headers.

    - * - * @return a {@link java.util.Map} of headers - */ - public Map> getHeaders() { - return headers; - } - - /** - *

    Get the data.

    - * - * @return the data - */ - public T getData() { - return data; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Configuration.java deleted file mode 100644 index 476456fd4ed6..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Configuration.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Configuration { - private static ApiClient defaultApiClient = new ApiClient(); - - /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. - * - * @return Default API client - */ - public static ApiClient getDefaultApiClient() { - return defaultApiClient; - } - - /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. - * - * @param apiClient API client - */ - public static void setDefaultApiClient(ApiClient apiClient) { - defaultApiClient = apiClient; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/GzipRequestInterceptor.java deleted file mode 100644 index 63442a34f40a..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/GzipRequestInterceptor.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import okhttp3.*; -import okio.Buffer; -import okio.BufferedSink; -import okio.GzipSink; -import okio.Okio; - -import java.io.IOException; - -/** - * Encodes request bodies using gzip. - * - * Taken from https://github.com/square/okhttp/issues/350 - */ -class GzipRequestInterceptor implements Interceptor { - @Override - public Response intercept(Chain chain) throws IOException { - Request originalRequest = chain.request(); - if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { - return chain.proceed(originalRequest); - } - - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); - return chain.proceed(compressedRequest); - } - - private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return new RequestBody() { - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() { - return buffer.size(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - sink.write(buffer.snapshot()); - } - }; - } - - private RequestBody gzip(final RequestBody body) { - return new RequestBody() { - @Override - public MediaType contentType() { - return body.contentType(); - } - - @Override - public long contentLength() { - return -1; // We don't know the compressed length in advance! - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); - body.writeTo(gzipSink); - gzipSink.close(); - } - }; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java deleted file mode 100644 index 5618d3008d91..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java +++ /dev/null @@ -1,594 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonElement; -import io.gsonfire.GsonFireBuilder; -import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; - -import okio.ByteString; - -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.util.Date; -import java.util.Locale; -import java.util.Map; -import java.util.HashMap; - -/* - * A JSON utility class - * - * NOTE: in the future, this class may be converted to static, which may break - * backward-compatibility - */ -public class JSON { - private static Gson gson; - private static boolean isLenientOnJson = false; - private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - - @SuppressWarnings("unchecked") - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder() - .registerTypeSelector(org.openapitools.client.model.Animal.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); - classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); - classByDiscriminatorValue.put("Animal", org.openapitools.client.model.Animal.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); - } - }) - .registerTypeSelector(org.openapitools.client.model.Cat.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); - } - }) - .registerTypeSelector(org.openapitools.client.model.Dog.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); - } - }) - .registerTypeSelector(org.openapitools.client.model.GrandparentAnimal.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("ParentPet", org.openapitools.client.model.ParentPet.class); - classByDiscriminatorValue.put("GrandparentAnimal", org.openapitools.client.model.GrandparentAnimal.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "pet_type")); - } - }) - .registerTypeSelector(org.openapitools.client.model.Mammal.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Pig", org.openapitools.client.model.Pig.class); - classByDiscriminatorValue.put("whale", org.openapitools.client.model.Whale.class); - classByDiscriminatorValue.put("zebra", org.openapitools.client.model.Zebra.class); - classByDiscriminatorValue.put("mammal", org.openapitools.client.model.Mammal.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); - } - }) - .registerTypeSelector(org.openapitools.client.model.NullableShape.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); - classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); - classByDiscriminatorValue.put("NullableShape", org.openapitools.client.model.NullableShape.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "shapeType")); - } - }) - .registerTypeSelector(org.openapitools.client.model.ParentPet.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("ParentPet", org.openapitools.client.model.ParentPet.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "pet_type")); - } - }) - .registerTypeSelector(org.openapitools.client.model.Pig.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BasquePig", org.openapitools.client.model.BasquePig.class); - classByDiscriminatorValue.put("DanishPig", org.openapitools.client.model.DanishPig.class); - classByDiscriminatorValue.put("Pig", org.openapitools.client.model.Pig.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); - } - }) - .registerTypeSelector(org.openapitools.client.model.Quadrilateral.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("ComplexQuadrilateral", org.openapitools.client.model.ComplexQuadrilateral.class); - classByDiscriminatorValue.put("SimpleQuadrilateral", org.openapitools.client.model.SimpleQuadrilateral.class); - classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "quadrilateralType")); - } - }) - .registerTypeSelector(org.openapitools.client.model.Shape.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); - classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); - classByDiscriminatorValue.put("Shape", org.openapitools.client.model.Shape.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "shapeType")); - } - }) - .registerTypeSelector(org.openapitools.client.model.ShapeOrNull.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); - classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); - classByDiscriminatorValue.put("ShapeOrNull", org.openapitools.client.model.ShapeOrNull.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "shapeType")); - } - }) - .registerTypeSelector(org.openapitools.client.model.Triangle.class, new TypeSelector() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("EquilateralTriangle", org.openapitools.client.model.EquilateralTriangle.class); - classByDiscriminatorValue.put("IsoscelesTriangle", org.openapitools.client.model.IsoscelesTriangle.class); - classByDiscriminatorValue.put("ScaleneTriangle", org.openapitools.client.model.ScaleneTriangle.class); - classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "triangleType")); - } - }) - ; - GsonBuilder builder = fireBuilder.createGsonBuilder(); - return builder; - } - - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if (null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. - * - * @param classByDiscriminatorValue The map of discriminator values to Java classes. - * @param discriminatorValue The value of the OpenAPI discriminator in the input data. - * @return The Java class that implements the OpenAPI schema - */ - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); - if (null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - { - gson = createGson() - .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) - .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) - .registerTypeAdapter(byte[].class, byteArrayAdapter) - .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesClass.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Apple.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.AppleReq.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfArrayOfNumberOnly.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfNumberOnly.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayTest.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Banana.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.BananaReq.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.BasquePig.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Capitalization.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Cat.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.CatAllOf.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Category.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ClassModel.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Client.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ComplexQuadrilateral.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.DanishPig.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.DeprecatedObject.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Dog.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.DogAllOf.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Drawing.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.EnumArrays.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.EquilateralTriangle.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Foo.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.FormatTest.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Fruit.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.FruitReq.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.GmFruit.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.HasOnlyReadOnly.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.HealthCheckResult.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.InlineResponseDefault.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.IsoscelesTriangle.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Mammal.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.MapTest.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.MixedPropertiesAndAdditionalPropertiesClass.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Model200Response.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ModelApiResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ModelFile.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ModelList.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ModelReturn.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Name.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.NullableClass.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.NullableShape.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.NumberOnly.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ObjectWithDeprecatedFields.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Order.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.OuterComposite.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.PetWithRequiredTags.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ReadOnlyFirst.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ScaleneTriangle.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Shape.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ShapeInterface.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ShapeOrNull.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.SimpleQuadrilateral.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.SpecialModelName.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Triangle.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.TriangleInterface.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.User.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Whale.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Zebra.CustomTypeAdapterFactory()) - .create(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public static Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - */ - public static void setGson(Gson gson) { - JSON.gson = gson; - } - - public static void setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public static String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public static T deserialize(String body, Type returnType) { - try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType.equals(String.class)) { - return (T) body; - } else { - throw (e); - } - } - } - - /** - * Gson TypeAdapter for Byte Array type - */ - public static class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(ByteString.of(value).base64()); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - ByteString byteString = ByteString.decodeBase64(bytesAsBase64); - return byteString.toByteArray(); - } - } - } - - /** - * Gson TypeAdapter for JSR310 OffsetDateTime type - */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } - } - - /** - * Gson TypeAdapter for JSR310 LocalDate type - */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } - - public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - /** - * Gson TypeAdapter for java.sql.Date type - * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used - * (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() {} - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - - /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public static void setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - } - - public static void setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Pair.java deleted file mode 100644 index 25b5a1b08792..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Pair.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Pair { - private String name = ""; - private String value = ""; - - public Pair (String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) { - return; - } - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) { - return; - } - - this.value = value; - } - - public String getName() { - return this.name; - } - - public String getValue() { - return this.value; - } - - private boolean isValidString(String arg) { - if (arg == null) { - return false; - } - - return true; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressRequestBody.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressRequestBody.java deleted file mode 100644 index 924dd8668973..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressRequestBody.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import okhttp3.MediaType; -import okhttp3.RequestBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - private final RequestBody requestBody; - - private final ApiCallback callback; - - public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { - this.requestBody = requestBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); - } - }; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressResponseBody.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressResponseBody.java deleted file mode 100644 index eee56669a4a3..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressResponseBody.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import okhttp3.MediaType; -import okhttp3.ResponseBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ApiCallback callback; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { - this.responseBody = responseBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerConfiguration.java deleted file mode 100644 index ca5c1187edf2..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerConfiguration.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.client; - -import java.util.Map; - -/** - * Representing a Server configuration. - */ -public class ServerConfiguration { - public String URL; - public String description; - public Map variables; - - /** - * @param URL A URL to the target host. - * @param description A description of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ - public ServerConfiguration(String URL, String description, Map variables) { - this.URL = URL; - this.description = description; - this.variables = variables; - } - - /** - * Format URL template using given variables. - * - * @param variables A map between a variable name and its value. - * @return Formatted URL. - */ - public String URL(Map variables) { - String url = this.URL; - - // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { - String name = variable.getKey(); - ServerVariable serverVariable = variable.getValue(); - String value = serverVariable.defaultValue; - - if (variables != null && variables.containsKey(name)) { - value = variables.get(name); - if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); - } - } - url = url.replaceAll("\\{" + name + "\\}", value); - } - return url; - } - - /** - * Format URL template using default server variables. - * - * @return Formatted URL. - */ - public String URL() { - return URL(null); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerVariable.java deleted file mode 100644 index c2f13e216662..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerVariable.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client; - -import java.util.HashSet; - -/** - * Representing a Server Variable for server URL template substitution. - */ -public class ServerVariable { - public String description; - public String defaultValue; - public HashSet enumValues = null; - - /** - * @param description A description for the server variable. - * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. - */ - public ServerVariable(String description, String defaultValue, HashSet enumValues) { - this.description = description; - this.defaultValue = defaultValue; - this.enumValues = enumValues; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/StringUtil.java deleted file mode 100644 index 4dc60597910a..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/StringUtil.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client; - -import java.util.Collection; -import java.util.Iterator; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StringUtil { - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) { - return true; - } - if (value != null && value.equalsIgnoreCase(str)) { - return true; - } - } - return false; - } - - /** - * Join an array of strings with the given separator. - *

    - * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *

    - * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) { - return ""; - } - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); - } - return out.toString(); - } - - /** - * Join a list of strings with the given separator. - * - * @param list The list of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(Collection list, String separator) { - Iterator iterator = list.iterator(); - StringBuilder out = new StringBuilder(); - if (iterator.hasNext()) { - out.append(iterator.next()); - } - while (iterator.hasNext()) { - out.append(separator).append(iterator.next()); - } - return out.toString(); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java deleted file mode 100644 index 52c19920a970..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.api; - -import org.openapitools.client.ApiCallback; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; -import org.openapitools.client.ProgressRequestBody; -import org.openapitools.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.openapitools.client.model.Client; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.ws.rs.core.GenericType; - -public class AnotherFakeApi { - private ApiClient localVarApiClient; - - public AnotherFakeApi() { - this(Configuration.getDefaultApiClient()); - } - - public AnotherFakeApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for call123testSpecialTags - * @param client client model (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call call123testSpecialTagsCall(Client client, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = client; - - // create path and map variables - String localVarPath = "/another-fake/dummy"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'client' is set - if (client == null) { - throw new ApiException("Missing the required parameter 'client' when calling call123testSpecialTags(Async)"); - } - - - okhttp3.Call localVarCall = call123testSpecialTagsCall(client, _callback); - return localVarCall; - - } - - /** - * To test special tags - * To test special tags and operation ID starting with number - * @param client client model (required) - * @return Client - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public Client call123testSpecialTags(Client client) throws ApiException { - ApiResponse localVarResp = call123testSpecialTagsWithHttpInfo(client); - return localVarResp.getData(); - } - - /** - * To test special tags - * To test special tags and operation ID starting with number - * @param client client model (required) - * @return ApiResponse<Client> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { - okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(client, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * To test special tags (asynchronously) - * To test special tags and operation ID starting with number - * @param client client model (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call call123testSpecialTagsAsync(Client client, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(client, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java deleted file mode 100644 index d413cd3e8291..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java +++ /dev/null @@ -1,1998 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.api; - -import org.openapitools.client.ApiCallback; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; -import org.openapitools.client.ProgressRequestBody; -import org.openapitools.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import java.math.BigDecimal; -import org.openapitools.client.model.Client; -import java.io.File; -import org.openapitools.client.model.HealthCheckResult; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.openapitools.client.model.OuterComposite; -import org.openapitools.client.model.OuterEnum; -import org.openapitools.client.model.User; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.ws.rs.core.GenericType; - -public class FakeApi { - private ApiClient localVarApiClient; - - public FakeApi() { - this(Configuration.getDefaultApiClient()); - } - - public FakeApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for fakeHealthGet - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 The instance started successfully -
    - */ - public okhttp3.Call fakeHealthGetCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake/health"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call fakeHealthGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeHealthGetCall(_callback); - return localVarCall; - - } - - /** - * Health check endpoint - * - * @return HealthCheckResult - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 The instance started successfully -
    - */ - public HealthCheckResult fakeHealthGet() throws ApiException { - ApiResponse localVarResp = fakeHealthGetWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Health check endpoint - * - * @return ApiResponse<HealthCheckResult> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 The instance started successfully -
    - */ - public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = fakeHealthGetValidateBeforeCall(null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * Health check endpoint (asynchronously) - * - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 The instance started successfully -
    - */ - public okhttp3.Call fakeHealthGetAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = fakeHealthGetValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for fakeOuterBooleanSerialize - * @param body Input boolean as post body (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output boolean -
    - */ - public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/boolean"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterBooleanSerializeCall(body, _callback); - return localVarCall; - - } - - /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @return Boolean - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output boolean -
    - */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { - ApiResponse localVarResp = fakeOuterBooleanSerializeWithHttpInfo(body); - return localVarResp.getData(); - } - - /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @return ApiResponse<Boolean> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output boolean -
    - */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * (asynchronously) - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output boolean -
    - */ - public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for fakeOuterCompositeSerialize - * @param outerComposite Input composite as post body (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output composite -
    - */ - public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = outerComposite; - - // create path and map variables - String localVarPath = "/fake/outer/composite"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterCompositeSerializeCall(outerComposite, _callback); - return localVarCall; - - } - - /** - * - * Test serialization of object with outer number type - * @param outerComposite Input composite as post body (optional) - * @return OuterComposite - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output composite -
    - */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { - ApiResponse localVarResp = fakeOuterCompositeSerializeWithHttpInfo(outerComposite); - return localVarResp.getData(); - } - - /** - * - * Test serialization of object with outer number type - * @param outerComposite Input composite as post body (optional) - * @return ApiResponse<OuterComposite> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output composite -
    - */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { - okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * (asynchronously) - * Test serialization of object with outer number type - * @param outerComposite Input composite as post body (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output composite -
    - */ - public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for fakeOuterNumberSerialize - * @param body Input number as post body (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output number -
    - */ - public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/number"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterNumberSerializeCall(body, _callback); - return localVarCall; - - } - - /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @return BigDecimal - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output number -
    - */ - public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { - ApiResponse localVarResp = fakeOuterNumberSerializeWithHttpInfo(body); - return localVarResp.getData(); - } - - /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @return ApiResponse<BigDecimal> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output number -
    - */ - public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { - okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * (asynchronously) - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output number -
    - */ - public okhttp3.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for fakeOuterStringSerialize - * @param body Input string as post body (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output string -
    - */ - public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/string"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterStringSerializeCall(body, _callback); - return localVarCall; - - } - - /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @return String - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output string -
    - */ - public String fakeOuterStringSerialize(String body) throws ApiException { - ApiResponse localVarResp = fakeOuterStringSerializeWithHttpInfo(body); - return localVarResp.getData(); - } - - /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @return ApiResponse<String> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output string -
    - */ - public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { - okhttp3.Call localVarCall = fakeOuterStringSerializeValidateBeforeCall(body, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * (asynchronously) - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Output string -
    - */ - public okhttp3.Call fakeOuterStringSerializeAsync(String body, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = fakeOuterStringSerializeValidateBeforeCall(body, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getArrayOfEnums - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Got named array of enums -
    - */ - public okhttp3.Call getArrayOfEnumsCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake/array-of-enums"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getArrayOfEnumsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getArrayOfEnumsCall(_callback); - return localVarCall; - - } - - /** - * Array of Enums - * - * @return List<OuterEnum> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Got named array of enums -
    - */ - public List getArrayOfEnums() throws ApiException { - ApiResponse> localVarResp = getArrayOfEnumsWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Array of Enums - * - * @return ApiResponse<List<OuterEnum>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Got named array of enums -
    - */ - public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getArrayOfEnumsValidateBeforeCall(null); - try { - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); - e.setErrorObjectType(new GenericType>(){}); - throw e; - } - } - - /** - * Array of Enums (asynchronously) - * - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Got named array of enums -
    - */ - public okhttp3.Call getArrayOfEnumsAsync(final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getArrayOfEnumsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for testBodyWithQueryParams - * @param query (required) - * @param user (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Success -
    - */ - public okhttp3.Call testBodyWithQueryParamsCall(String query, User user, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = user; - - // create path and map variables - String localVarPath = "/fake/body-with-query-params"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (query != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("query", query)); - } - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, User user, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'query' is set - if (query == null) { - throw new ApiException("Missing the required parameter 'query' when calling testBodyWithQueryParams(Async)"); - } - - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException("Missing the required parameter 'user' when calling testBodyWithQueryParams(Async)"); - } - - - okhttp3.Call localVarCall = testBodyWithQueryParamsCall(query, user, _callback); - return localVarCall; - - } - - /** - * - * - * @param query (required) - * @param user (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Success -
    - */ - public void testBodyWithQueryParams(String query, User user) throws ApiException { - testBodyWithQueryParamsWithHttpInfo(query, user); - } - - /** - * - * - * @param query (required) - * @param user (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Success -
    - */ - public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { - okhttp3.Call localVarCall = testBodyWithQueryParamsValidateBeforeCall(query, user, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * (asynchronously) - * - * @param query (required) - * @param user (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Success -
    - */ - public okhttp3.Call testBodyWithQueryParamsAsync(String query, User user, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testBodyWithQueryParamsValidateBeforeCall(query, user, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for testClientModel - * @param client client model (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call testClientModelCall(Client client, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = client; - - // create path and map variables - String localVarPath = "/fake"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testClientModelValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'client' is set - if (client == null) { - throw new ApiException("Missing the required parameter 'client' when calling testClientModel(Async)"); - } - - - okhttp3.Call localVarCall = testClientModelCall(client, _callback); - return localVarCall; - - } - - /** - * To test \"client\" model - * To test \"client\" model - * @param client client model (required) - * @return Client - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public Client testClientModel(Client client) throws ApiException { - ApiResponse localVarResp = testClientModelWithHttpInfo(client); - return localVarResp.getData(); - } - - /** - * To test \"client\" model - * To test \"client\" model - * @param client client model (required) - * @return ApiResponse<Client> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { - okhttp3.Call localVarCall = testClientModelValidateBeforeCall(client, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * To test \"client\" model (asynchronously) - * To test \"client\" model - * @param client client model (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call testClientModelAsync(Client client, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testClientModelValidateBeforeCall(client, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for testEndpointParameters - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) - * @param password None (optional) - * @param paramCallback None (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    - */ - public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (integer != null) { - localVarFormParams.put("integer", integer); - } - - if (int32 != null) { - localVarFormParams.put("int32", int32); - } - - if (int64 != null) { - localVarFormParams.put("int64", int64); - } - - if (number != null) { - localVarFormParams.put("number", number); - } - - if (_float != null) { - localVarFormParams.put("float", _float); - } - - if (_double != null) { - localVarFormParams.put("double", _double); - } - - if (string != null) { - localVarFormParams.put("string", string); - } - - if (patternWithoutDelimiter != null) { - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); - } - - if (_byte != null) { - localVarFormParams.put("byte", _byte); - } - - if (binary != null) { - localVarFormParams.put("binary", binary); - } - - if (date != null) { - localVarFormParams.put("date", date); - } - - if (dateTime != null) { - localVarFormParams.put("dateTime", dateTime); - } - - if (password != null) { - localVarFormParams.put("password", password); - } - - if (paramCallback != null) { - localVarFormParams.put("callback", paramCallback); - } - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "http_basic_test" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'number' is set - if (number == null) { - throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)"); - } - - // verify the required parameter '_double' is set - if (_double == null) { - throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)"); - } - - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)"); - } - - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)"); - } - - - okhttp3.Call localVarCall = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); - return localVarCall; - - } - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) - * @param password None (optional) - * @param paramCallback None (optional) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    - */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) - * @param password None (optional) - * @param paramCallback None (optional) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    - */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - okhttp3.Call localVarCall = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 (asynchronously) - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) - * @param password None (optional) - * @param paramCallback None (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    - */ - public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for testEnumParameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    - */ - public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (enumFormStringArray != null) { - localVarFormParams.put("enum_form_string_array", enumFormStringArray); - } - - if (enumFormString != null) { - localVarFormParams.put("enum_form_string", enumFormString); - } - - if (enumQueryStringArray != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); - } - - if (enumQueryString != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("enum_query_string", enumQueryString)); - } - - if (enumQueryInteger != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("enum_query_integer", enumQueryInteger)); - } - - if (enumQueryDouble != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("enum_query_double", enumQueryDouble)); - } - - if (enumHeaderStringArray != null) { - localVarHeaderParams.put("enum_header_string_array", localVarApiClient.parameterToString(enumHeaderStringArray)); - } - - if (enumHeaderString != null) { - localVarHeaderParams.put("enum_header_string", localVarApiClient.parameterToString(enumHeaderString)); - } - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testEnumParametersValidateBeforeCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); - return localVarCall; - - } - - /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    - */ - public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - } - - /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    - */ - public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - okhttp3.Call localVarCall = testEnumParametersValidateBeforeCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * To test enum parameters (asynchronously) - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    - */ - public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testEnumParametersValidateBeforeCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (requiredStringGroup != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("required_string_group", requiredStringGroup)); - } - - if (requiredInt64Group != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("required_int64_group", requiredInt64Group)); - } - - if (stringGroup != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("string_group", stringGroup)); - } - - if (int64Group != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("int64_group", int64Group)); - } - - if (requiredBooleanGroup != null) { - localVarHeaderParams.put("required_boolean_group", localVarApiClient.parameterToString(requiredBooleanGroup)); - } - - if (booleanGroup != null) { - localVarHeaderParams.put("boolean_group", localVarApiClient.parameterToString(booleanGroup)); - } - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "bearer_test" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testGroupParametersValidateBeforeCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'requiredStringGroup' is set - if (requiredStringGroup == null) { - throw new ApiException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters(Async)"); - } - - // verify the required parameter 'requiredBooleanGroup' is set - if (requiredBooleanGroup == null) { - throw new ApiException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters(Async)"); - } - - // verify the required parameter 'requiredInt64Group' is set - if (requiredInt64Group == null) { - throw new ApiException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters(Async)"); - } - - - okhttp3.Call localVarCall = testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); - return localVarCall; - - } - - - private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - okhttp3.Call localVarCall = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null); - return localVarApiClient.execute(localVarCall); - } - - private okhttp3.Call testGroupParametersAsync(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - - public class APItestGroupParametersRequest { - private final Integer requiredStringGroup; - private final Boolean requiredBooleanGroup; - private final Long requiredInt64Group; - private Integer stringGroup; - private Boolean booleanGroup; - private Long int64Group; - - private APItestGroupParametersRequest(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group) { - this.requiredStringGroup = requiredStringGroup; - this.requiredBooleanGroup = requiredBooleanGroup; - this.requiredInt64Group = requiredInt64Group; - } - - /** - * Set stringGroup - * @param stringGroup String in group parameters (optional) - * @return APItestGroupParametersRequest - */ - public APItestGroupParametersRequest stringGroup(Integer stringGroup) { - this.stringGroup = stringGroup; - return this; - } - - /** - * Set booleanGroup - * @param booleanGroup Boolean in group parameters (optional) - * @return APItestGroupParametersRequest - */ - public APItestGroupParametersRequest booleanGroup(Boolean booleanGroup) { - this.booleanGroup = booleanGroup; - return this; - } - - /** - * Set int64Group - * @param int64Group Integer in group parameters (optional) - * @return APItestGroupParametersRequest - */ - public APItestGroupParametersRequest int64Group(Long int64Group) { - this.int64Group = int64Group; - return this; - } - - /** - * Build call for testGroupParameters - * @param _callback ApiCallback API callback - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    400 Someting wrong -
    - */ - public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); - } - - /** - * Execute testGroupParameters request - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    400 Someting wrong -
    - */ - public void execute() throws ApiException { - testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * Execute testGroupParameters request with HTTP info returned - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    400 Someting wrong -
    - */ - public ApiResponse executeWithHttpInfo() throws ApiException { - return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * Execute testGroupParameters request (asynchronously) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    400 Someting wrong -
    - */ - public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return testGroupParametersAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); - } - } - - /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @return APItestGroupParametersRequest - * @http.response.details - - - -
    Status Code Description Response Headers
    400 Someting wrong -
    - */ - public APItestGroupParametersRequest testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group) { - return new APItestGroupParametersRequest(requiredStringGroup, requiredBooleanGroup, requiredInt64Group); - } - /** - * Build call for testInlineAdditionalProperties - * @param requestBody request body (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call testInlineAdditionalPropertiesCall(Map requestBody, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = requestBody; - - // create path and map variables - String localVarPath = "/fake/inline-additionalProperties"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map requestBody, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'requestBody' is set - if (requestBody == null) { - throw new ApiException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties(Async)"); - } - - - okhttp3.Call localVarCall = testInlineAdditionalPropertiesCall(requestBody, _callback); - return localVarCall; - - } - - /** - * test inline additionalProperties - * - * @param requestBody request body (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public void testInlineAdditionalProperties(Map requestBody) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(requestBody); - } - - /** - * test inline additionalProperties - * - * @param requestBody request body (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws ApiException { - okhttp3.Call localVarCall = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * test inline additionalProperties (asynchronously) - * - * @param requestBody request body (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call testInlineAdditionalPropertiesAsync(Map requestBody, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for testJsonFormData - * @param param field1 (required) - * @param param2 field2 (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake/jsonFormData"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (param != null) { - localVarFormParams.put("param", param); - } - - if (param2 != null) { - localVarFormParams.put("param2", param2); - } - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testJsonFormDataValidateBeforeCall(String param, String param2, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException("Missing the required parameter 'param' when calling testJsonFormData(Async)"); - } - - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new ApiException("Missing the required parameter 'param2' when calling testJsonFormData(Async)"); - } - - - okhttp3.Call localVarCall = testJsonFormDataCall(param, param2, _callback); - return localVarCall; - - } - - /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public void testJsonFormData(String param, String param2) throws ApiException { - testJsonFormDataWithHttpInfo(param, param2); - } - - /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - okhttp3.Call localVarCall = testJsonFormDataValidateBeforeCall(param, param2, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * test json serialization of form data (asynchronously) - * - * @param param field1 (required) - * @param param2 field2 (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call testJsonFormDataAsync(String param, String param2, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testJsonFormDataValidateBeforeCall(param, param2, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for testQueryParameterCollectionFormat - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Success -
    - */ - public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake/test-query-parameters"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (pipe != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "pipe", pipe)); - } - - if (ioutil != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "ioutil", ioutil)); - } - - if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); - } - - if (url != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "url", url)); - } - - if (context != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "context", context)); - } - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'pipe' is set - if (pipe == null) { - throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)"); - } - - // verify the required parameter 'ioutil' is set - if (ioutil == null) { - throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)"); - } - - // verify the required parameter 'http' is set - if (http == null) { - throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)"); - } - - // verify the required parameter 'url' is set - if (url == null) { - throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)"); - } - - // verify the required parameter 'context' is set - if (context == null) { - throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)"); - } - - - okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); - return localVarCall; - - } - - /** - * - * To test the collection format in query parameters - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Success -
    - */ - public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { - testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); - } - - /** - * - * To test the collection format in query parameters - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Success -
    - */ - public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { - okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * (asynchronously) - * To test the collection format in query parameters - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 Success -
    - */ - public okhttp3.Call testQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java deleted file mode 100644 index 34c9d282281e..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.api; - -import org.openapitools.client.ApiCallback; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; -import org.openapitools.client.ProgressRequestBody; -import org.openapitools.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.openapitools.client.model.Client; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.ws.rs.core.GenericType; - -public class FakeClassnameTags123Api { - private ApiClient localVarApiClient; - - public FakeClassnameTags123Api() { - this(Configuration.getDefaultApiClient()); - } - - public FakeClassnameTags123Api(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for testClassname - * @param client client model (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call testClassnameCall(Client client, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = client; - - // create path and map variables - String localVarPath = "/fake_classname_test"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "api_key_query" }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testClassnameValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'client' is set - if (client == null) { - throw new ApiException("Missing the required parameter 'client' when calling testClassname(Async)"); - } - - - okhttp3.Call localVarCall = testClassnameCall(client, _callback); - return localVarCall; - - } - - /** - * To test class name in snake case - * To test class name in snake case - * @param client client model (required) - * @return Client - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public Client testClassname(Client client) throws ApiException { - ApiResponse localVarResp = testClassnameWithHttpInfo(client); - return localVarResp.getData(); - } - - /** - * To test class name in snake case - * To test class name in snake case - * @param client client model (required) - * @return ApiResponse<Client> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { - okhttp3.Call localVarCall = testClassnameValidateBeforeCall(client, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * To test class name in snake case (asynchronously) - * To test class name in snake case - * @param client client model (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call testClassnameAsync(Client client, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testClassnameValidateBeforeCall(client, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java deleted file mode 100644 index 2357401a1b50..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java +++ /dev/null @@ -1,1198 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.api; - -import org.openapitools.client.ApiCallback; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; -import org.openapitools.client.ProgressRequestBody; -import org.openapitools.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import java.io.File; -import org.openapitools.client.model.ModelApiResponse; -import org.openapitools.client.model.Pet; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.ws.rs.core.GenericType; - -public class PetApi { - private ApiClient localVarApiClient; - - public PetApi() { - this(Configuration.getDefaultApiClient()); - } - - public PetApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for addPet - * @param pet Pet object that needs to be added to the store (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    405 Invalid input -
    - */ - public okhttp3.Call addPetCall(Pet pet, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = pet; - - // create path and map variables - String localVarPath = "/pet"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call addPetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); - } - - - okhttp3.Call localVarCall = addPetCall(pet, _callback); - return localVarCall; - - } - - /** - * Add a new pet to the store - * - * @param pet Pet object that needs to be added to the store (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    405 Invalid input -
    - */ - public void addPet(Pet pet) throws ApiException { - addPetWithHttpInfo(pet); - } - - /** - * Add a new pet to the store - * - * @param pet Pet object that needs to be added to the store (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    405 Invalid input -
    - */ - public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { - okhttp3.Call localVarCall = addPetValidateBeforeCall(pet, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Add a new pet to the store (asynchronously) - * - * @param pet Pet object that needs to be added to the store (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    405 Invalid input -
    - */ - public okhttp3.Call addPetAsync(Pet pet, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addPetValidateBeforeCall(pet, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for deletePet - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    400 Invalid pet value -
    - */ - public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (apiKey != null) { - localVarHeaderParams.put("api_key", localVarApiClient.parameterToString(apiKey)); - } - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)"); - } - - - okhttp3.Call localVarCall = deletePetCall(petId, apiKey, _callback); - return localVarCall; - - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    400 Invalid pet value -
    - */ - public void deletePet(Long petId, String apiKey) throws ApiException { - deletePetWithHttpInfo(petId, apiKey); - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    400 Invalid pet value -
    - */ - public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - okhttp3.Call localVarCall = deletePetValidateBeforeCall(petId, apiKey, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Deletes a pet (asynchronously) - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    400 Invalid pet value -
    - */ - public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deletePetValidateBeforeCall(petId, apiKey, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for findPetsByStatus - * @param status Status values that need to be considered for filter (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    - */ - public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/pet/findByStatus"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (status != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "status", status)); - } - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call findPetsByStatusValidateBeforeCall(List status, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'status' is set - if (status == null) { - throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)"); - } - - - okhttp3.Call localVarCall = findPetsByStatusCall(status, _callback); - return localVarCall; - - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @return List<Pet> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    - */ - public List findPetsByStatus(List status) throws ApiException { - ApiResponse> localVarResp = findPetsByStatusWithHttpInfo(status); - return localVarResp.getData(); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @return ApiResponse<List<Pet>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    - */ - public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, null); - try { - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); - e.setErrorObjectType(new GenericType>(){}); - throw e; - } - } - - /** - * Finds Pets by status (asynchronously) - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    - */ - public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for findPetsByTags - * @param tags Tags to filter by (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    - * @deprecated - */ - @Deprecated - public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/pet/findByTags"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (tags != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tags", tags)); - } - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'tags' is set - if (tags == null) { - throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)"); - } - - - okhttp3.Call localVarCall = findPetsByTagsCall(tags, _callback); - return localVarCall; - - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @return List<Pet> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    - * @deprecated - */ - @Deprecated - public List findPetsByTags(List tags) throws ApiException { - ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); - return localVarResp.getData(); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @return ApiResponse<List<Pet>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    - * @deprecated - */ - @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); - try { - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); - e.setErrorObjectType(new GenericType>(){}); - throw e; - } - } - - /** - * Finds Pets by tags (asynchronously) - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    - * @deprecated - */ - @Deprecated - public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getPetById - * @param petId ID of pet to return (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    - */ - public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "api_key" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPetByIdValidateBeforeCall(Long petId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)"); - } - - - okhttp3.Call localVarCall = getPetByIdCall(petId, _callback); - return localVarCall; - - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @return Pet - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    - */ - public Pet getPetById(Long petId) throws ApiException { - ApiResponse localVarResp = getPetByIdWithHttpInfo(petId); - return localVarResp.getData(); - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @return ApiResponse<Pet> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    - */ - public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * Find pet by ID (asynchronously) - * Returns a single pet - * @param petId ID of pet to return (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    - */ - public okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updatePet - * @param pet Pet object that needs to be added to the store (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    - */ - public okhttp3.Call updatePetCall(Pet pet, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = pet; - - // create path and map variables - String localVarPath = "/pet"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updatePetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); - } - - - okhttp3.Call localVarCall = updatePetCall(pet, _callback); - return localVarCall; - - } - - /** - * Update an existing pet - * - * @param pet Pet object that needs to be added to the store (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    - */ - public void updatePet(Pet pet) throws ApiException { - updatePetWithHttpInfo(pet); - } - - /** - * Update an existing pet - * - * @param pet Pet object that needs to be added to the store (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    - */ - public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { - okhttp3.Call localVarCall = updatePetValidateBeforeCall(pet, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Update an existing pet (asynchronously) - * - * @param pet Pet object that needs to be added to the store (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    - */ - public okhttp3.Call updatePetAsync(Pet pet, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updatePetValidateBeforeCall(pet, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for updatePetWithForm - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    405 Invalid input -
    - */ - public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (name != null) { - localVarFormParams.put("name", name); - } - - if (status != null) { - localVarFormParams.put("status", status); - } - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)"); - } - - - okhttp3.Call localVarCall = updatePetWithFormCall(petId, name, status, _callback); - return localVarCall; - - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    405 Invalid input -
    - */ - public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - updatePetWithFormWithHttpInfo(petId, name, status); - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    405 Invalid input -
    - */ - public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - okhttp3.Call localVarCall = updatePetWithFormValidateBeforeCall(petId, name, status, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Updates a pet in the store with form data (asynchronously) - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    405 Invalid input -
    - */ - public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updatePetWithFormValidateBeforeCall(petId, name, status, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for uploadFile - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param _file file to upload (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (additionalMetadata != null) { - localVarFormParams.put("additionalMetadata", additionalMetadata); - } - - if (_file != null) { - localVarFormParams.put("file", _file); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)"); - } - - - okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, _file, _callback); - return localVarCall; - - } - - /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param _file file to upload (optional) - * @return ModelApiResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException { - ApiResponse localVarResp = uploadFileWithHttpInfo(petId, additionalMetadata, _file); - return localVarResp.getData(); - } - - /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param _file file to upload (optional) - * @return ApiResponse<ModelApiResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { - okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * uploads an image (asynchronously) - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param _file file to upload (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for uploadFileWithRequiredFile - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (additionalMetadata != null) { - localVarFormParams.put("additionalMetadata", additionalMetadata); - } - - if (requiredFile != null) { - localVarFormParams.put("requiredFile", requiredFile); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile(Async)"); - } - - // verify the required parameter 'requiredFile' is set - if (requiredFile == null) { - throw new ApiException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile(Async)"); - } - - - okhttp3.Call localVarCall = uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback); - return localVarCall; - - } - - /** - * uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return ModelApiResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - ApiResponse localVarResp = uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); - return localVarResp.getData(); - } - - /** - * uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return ApiResponse<ModelApiResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - okhttp3.Call localVarCall = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * uploads an image (required) (asynchronously) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call uploadFileWithRequiredFileAsync(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java deleted file mode 100644 index f57a9e3ff700..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java +++ /dev/null @@ -1,533 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.api; - -import org.openapitools.client.ApiCallback; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; -import org.openapitools.client.ProgressRequestBody; -import org.openapitools.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.openapitools.client.model.Order; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.ws.rs.core.GenericType; - -public class StoreApi { - private ApiClient localVarApiClient; - - public StoreApi() { - this(Configuration.getDefaultApiClient()); - } - - public StoreApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for deleteOrder - * @param orderId ID of the order that needs to be deleted (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    - */ - public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteOrderValidateBeforeCall(String orderId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)"); - } - - - okhttp3.Call localVarCall = deleteOrderCall(orderId, _callback); - return localVarCall; - - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    - */ - public void deleteOrder(String orderId) throws ApiException { - deleteOrderWithHttpInfo(orderId); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    - */ - public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete purchase order by ID (asynchronously) - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    - */ - public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getInventory - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/inventory"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "api_key" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getInventoryValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getInventoryCall(_callback); - return localVarCall; - - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map<String, Integer> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public Map getInventory() throws ApiException { - ApiResponse> localVarResp = getInventoryWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return ApiResponse<Map<String, Integer>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getInventoryValidateBeforeCall(null); - try { - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); - e.setErrorObjectType(new GenericType>(){}); - throw e; - } - } - - /** - * Returns pet inventories by status (asynchronously) - * Returns a map of status codes to quantities - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    200 successful operation -
    - */ - public okhttp3.Call getInventoryAsync(final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getInventoryValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getOrderById - * @param orderId ID of pet that needs to be fetched (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    - */ - public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getOrderByIdValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)"); - } - - - okhttp3.Call localVarCall = getOrderByIdCall(orderId, _callback); - return localVarCall; - - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @return Order - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    - */ - public Order getOrderById(Long orderId) throws ApiException { - ApiResponse localVarResp = getOrderByIdWithHttpInfo(orderId); - return localVarResp.getData(); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @return ApiResponse<Order> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    - */ - public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * Find purchase order by ID (asynchronously) - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    - */ - public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for placeOrder - * @param order order placed for purchasing the pet (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    - */ - public okhttp3.Call placeOrderCall(Order order, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = order; - - // create path and map variables - String localVarPath = "/store/order"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call placeOrderValidateBeforeCall(Order order, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'order' is set - if (order == null) { - throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)"); - } - - - okhttp3.Call localVarCall = placeOrderCall(order, _callback); - return localVarCall; - - } - - /** - * Place an order for a pet - * - * @param order order placed for purchasing the pet (required) - * @return Order - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    - */ - public Order placeOrder(Order order) throws ApiException { - ApiResponse localVarResp = placeOrderWithHttpInfo(order); - return localVarResp.getData(); - } - - /** - * Place an order for a pet - * - * @param order order placed for purchasing the pet (required) - * @return ApiResponse<Order> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    - */ - public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { - okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * Place an order for a pet (asynchronously) - * - * @param order order placed for purchasing the pet (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    - */ - public okhttp3.Call placeOrderAsync(Order order, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java deleted file mode 100644 index f6d5e33327ce..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java +++ /dev/null @@ -1,991 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.api; - -import org.openapitools.client.ApiCallback; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; -import org.openapitools.client.ProgressRequestBody; -import org.openapitools.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.threeten.bp.OffsetDateTime; -import org.openapitools.client.model.User; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.ws.rs.core.GenericType; - -public class UserApi { - private ApiClient localVarApiClient; - - public UserApi() { - this(Configuration.getDefaultApiClient()); - } - - public UserApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for createUser - * @param user Created user object (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public okhttp3.Call createUserCall(User user, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = user; - - // create path and map variables - String localVarPath = "/user"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createUserValidateBeforeCall(User user, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); - } - - - okhttp3.Call localVarCall = createUserCall(user, _callback); - return localVarCall; - - } - - /** - * Create user - * This can only be done by the logged in user. - * @param user Created user object (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public void createUser(User user) throws ApiException { - createUserWithHttpInfo(user); - } - - /** - * Create user - * This can only be done by the logged in user. - * @param user Created user object (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public ApiResponse createUserWithHttpInfo(User user) throws ApiException { - okhttp3.Call localVarCall = createUserValidateBeforeCall(user, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Create user (asynchronously) - * This can only be done by the logged in user. - * @param user Created user object (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public okhttp3.Call createUserAsync(User user, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createUserValidateBeforeCall(user, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for createUsersWithArrayInput - * @param user List of user object (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public okhttp3.Call createUsersWithArrayInputCall(List user, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = user; - - // create path and map variables - String localVarPath = "/user/createWithArray"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException("Missing the required parameter 'user' when calling createUsersWithArrayInput(Async)"); - } - - - okhttp3.Call localVarCall = createUsersWithArrayInputCall(user, _callback); - return localVarCall; - - } - - /** - * Creates list of users with given input array - * - * @param user List of user object (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public void createUsersWithArrayInput(List user) throws ApiException { - createUsersWithArrayInputWithHttpInfo(user); - } - - /** - * Creates list of users with given input array - * - * @param user List of user object (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { - okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(user, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Creates list of users with given input array (asynchronously) - * - * @param user List of user object (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public okhttp3.Call createUsersWithArrayInputAsync(List user, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(user, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for createUsersWithListInput - * @param user List of user object (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public okhttp3.Call createUsersWithListInputCall(List user, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = user; - - // create path and map variables - String localVarPath = "/user/createWithList"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createUsersWithListInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException("Missing the required parameter 'user' when calling createUsersWithListInput(Async)"); - } - - - okhttp3.Call localVarCall = createUsersWithListInputCall(user, _callback); - return localVarCall; - - } - - /** - * Creates list of users with given input array - * - * @param user List of user object (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public void createUsersWithListInput(List user) throws ApiException { - createUsersWithListInputWithHttpInfo(user); - } - - /** - * Creates list of users with given input array - * - * @param user List of user object (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { - okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(user, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Creates list of users with given input array (asynchronously) - * - * @param user List of user object (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public okhttp3.Call createUsersWithListInputAsync(List user, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(user, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for deleteUser - * @param username The name that needs to be deleted (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    - */ - public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteUserValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)"); - } - - - okhttp3.Call localVarCall = deleteUserCall(username, _callback); - return localVarCall; - - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    - */ - public void deleteUser(String username) throws ApiException { - deleteUserWithHttpInfo(username); - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    - */ - public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - okhttp3.Call localVarCall = deleteUserValidateBeforeCall(username, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete user (asynchronously) - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    - */ - public okhttp3.Call deleteUserAsync(String username, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteUserValidateBeforeCall(username, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getUserByName - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    - */ - public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getUserByNameValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)"); - } - - - okhttp3.Call localVarCall = getUserByNameCall(username, _callback); - return localVarCall; - - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return User - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    - */ - public User getUserByName(String username) throws ApiException { - ApiResponse localVarResp = getUserByNameWithHttpInfo(username); - return localVarResp.getData(); - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return ApiResponse<User> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    - */ - public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * Get user by user name (asynchronously) - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    - */ - public okhttp3.Call getUserByNameAsync(String username, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for loginUser - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    - */ - public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/login"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (username != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username)); - } - - if (password != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("password", password)); - } - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call loginUserValidateBeforeCall(String username, String password, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)"); - } - - // verify the required parameter 'password' is set - if (password == null) { - throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)"); - } - - - okhttp3.Call localVarCall = loginUserCall(username, password, _callback); - return localVarCall; - - } - - /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return String - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    - */ - public String loginUser(String username, String password) throws ApiException { - ApiResponse localVarResp = loginUserWithHttpInfo(username, password); - return localVarResp.getData(); - } - - /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return ApiResponse<String> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    - */ - public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, null); - try { - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); - e.setErrorObjectType(new GenericType(){}); - throw e; - } - } - - /** - * Logs user into the system (asynchronously) - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    - */ - public okhttp3.Call loginUserAsync(String username, String password, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for logoutUser - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/logout"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call logoutUserValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = logoutUserCall(_callback); - return localVarCall; - - } - - /** - * Logs out current logged in user session - * - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public void logoutUser() throws ApiException { - logoutUserWithHttpInfo(); - } - - /** - * Logs out current logged in user session - * - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public ApiResponse logoutUserWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = logoutUserValidateBeforeCall(null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Logs out current logged in user session (asynchronously) - * - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
    Status Code Description Response Headers
    0 successful operation -
    - */ - public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = logoutUserValidateBeforeCall(_callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for updateUser - * @param username name that need to be deleted (required) - * @param user Updated user object (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    - */ - public okhttp3.Call updateUserCall(String username, User user, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = user; - - // create path and map variables - String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateUserValidateBeforeCall(String username, User user, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); - } - - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); - } - - - okhttp3.Call localVarCall = updateUserCall(username, user, _callback); - return localVarCall; - - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param user Updated user object (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    - */ - public void updateUser(String username, User user) throws ApiException { - updateUserWithHttpInfo(username, user); - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param user Updated user object (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    - */ - public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { - okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, user, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Updated user (asynchronously) - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param user Updated user object (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    - */ - public okhttp3.Call updateUserAsync(String username, User user, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, user, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java deleted file mode 100644 index 35aa7184d26b..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.ApiException; -import org.openapitools.client.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); - } - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/Authentication.java deleted file mode 100644 index c59d11e0ce99..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/Authentication.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.Pair; -import org.openapitools.client.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws ApiException if failed to update the parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java deleted file mode 100644 index b4641c4217c0..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.Pair; -import org.openapitools.client.ApiException; - -import okhttp3.Credentials; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -import java.io.UnsupportedEncodingException; - -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (username == null && password == null) { - return; - } - headerParams.put("Authorization", Credentials.basic( - username == null ? "" : username, - password == null ? "" : password)); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java deleted file mode 100644 index 460ad224963c..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.ApiException; -import org.openapitools.client.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class HttpBearerAuth implements Authentication { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return bearerToken; - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (bearerToken == null) { - return; - } - - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuth.java deleted file mode 100644 index 08a855ec5f92..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuth.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.Pair; -import org.openapitools.client.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class OAuth implements Authentication { - private String accessToken; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (accessToken != null) { - headerParams.put("Authorization", "Bearer " + accessToken); - } - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthFlow.java deleted file mode 100644 index 5faf36c39348..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -/** - * OAuth flows that are supported by this client - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public enum OAuthFlow { - ACCESS_CODE, //called authorizationCode in OpenAPI 3.0 - IMPLICIT, - PASSWORD, - APPLICATION //called clientCredentials in OpenAPI 3.0 -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java deleted file mode 100644 index 1c8ac2dc0cce..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.openapitools.client.auth; - -import okhttp3.OkHttpClient; -import okhttp3.MediaType; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -public class OAuthOkHttpClient implements HttpClient { - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - @Override - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - MediaType mediaType = MediaType.parse("application/json"); - Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); - - if(headers != null) { - for (Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - mediaType = MediaType.parse(entry.getValue()); - } else { - requestBuilder.addHeader(entry.getKey(), entry.getValue()); - } - } - } - - RequestBody body = request.getBody() != null ? RequestBody.create(request.getBody(), mediaType) : null; - requestBuilder.method(requestMethod, body); - - try { - Response response = client.newCall(requestBuilder.build()).execute(); - return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), - response.body().contentType().toString(), - response.code(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - @Override - public void shutdown() { - // Nothing to do here - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java deleted file mode 100644 index 7b630bb57e77..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ /dev/null @@ -1,211 +0,0 @@ -package org.openapitools.client.auth; - -import org.openapitools.client.ApiException; -import org.openapitools.client.Pair; - -import okhttp3.Interceptor; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URI; -import java.util.Map; -import java.util.List; - -public class RetryingOAuth extends OAuth implements Interceptor { - private OAuthClient oAuthClient; - - private TokenRequestBuilder tokenRequestBuilder; - - /** - * @param client An OkHttp client - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { - this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = tokenRequestBuilder; - } - - /** - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { - this(new OkHttpClient(), tokenRequestBuilder); - } - - /** - * @param tokenUrl The token URL to be used for this OAuth2 flow. - * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - * The value must be an absolute URL. - * @param clientId The OAuth2 client ID for the "clientCredentials" flow. - * @param flow OAuth flow. - * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - * @param parameters A map of string. - */ - public RetryingOAuth( - String tokenUrl, - String clientId, - OAuthFlow flow, - String clientSecret, - Map parameters - ) { - this(OAuthClientRequest.tokenLocation(tokenUrl) - .setClientId(clientId) - .setClientSecret(clientSecret)); - setFlow(flow); - if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); - } - } - } - - /** - * Set the OAuth flow - * - * @param flow The OAuth flow. - */ - public void setFlow(OAuthFlow flow) { - switch(flow) { - case ACCESS_CODE: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case IMPLICIT: - tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); - break; - case PASSWORD: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case APPLICATION: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - } - - @Override - public Response intercept(Chain chain) throws IOException { - return retryingIntercept(chain, true); - } - - private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { - Request request = chain.request(); - - // If the request already has an authorization (e.g. Basic auth), proceed with the request as is - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // Get the token if it has not yet been acquired - if (getAccessToken() == null) { - updateAccessToken(null); - } - - OAuthClientRequest oAuthRequest; - if (getAccessToken() != null) { - // Build the request - Request.Builder requestBuilder = request.newBuilder(); - - String requestAccessToken = getAccessToken(); - try { - oAuthRequest = - new OAuthBearerClientRequest(request.url().toString()). - setAccessToken(requestAccessToken). - buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); - } - requestBuilder.url(oAuthRequest.getLocationUri()); - - // Execute the request - Response response = chain.proceed(requestBuilder.build()); - - // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row - if ( - response != null && - ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || - response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && - updateTokenAndRetryOnAuthorizationFailure - ) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body().close(); - return retryingIntercept(chain, false); - } - } catch (Exception e) { - response.body().close(); - throw e; - } - } - return response; - } - else { - return chain.proceed(chain.request()); - } - } - - /** - * Returns true if the access token has been updated - * - * @param requestAccessToken the request access token - * @return True if the update is successful - * @throws java.io.IOException If fail to update the access token - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = - oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - } - } catch (OAuthSystemException | OAuthProblemException e) { - throw new IOException(e); - } - } - return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); - } - - /** - * Gets the token request builder - * - * @return A token request builder - * @throws java.io.IOException If fail to update the access token - */ - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - /** - * Sets the token request builder - * - * @param tokenRequestBuilder Token request builder - */ - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - // Applying authorization to parameters is performed in the retryingIntercept method - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - // No implementation necessary - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java deleted file mode 100644 index d5f4dc14d804..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,460 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * AdditionalPropertiesClass - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesClass { - public static final String SERIALIZED_NAME_MAP_PROPERTY = "map_property"; - @SerializedName(SERIALIZED_NAME_MAP_PROPERTY) - private Map mapProperty = null; - - public static final String SERIALIZED_NAME_MAP_OF_MAP_PROPERTY = "map_of_map_property"; - @SerializedName(SERIALIZED_NAME_MAP_OF_MAP_PROPERTY) - private Map> mapOfMapProperty = null; - - public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; - @SerializedName(SERIALIZED_NAME_ANYTYPE1) - private Object anytype1 = null; - - public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1"; - @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) - private Object mapWithUndeclaredPropertiesAnytype1; - - public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2"; - @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) - private Object mapWithUndeclaredPropertiesAnytype2; - - public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3"; - @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) - private Map mapWithUndeclaredPropertiesAnytype3 = null; - - public static final String SERIALIZED_NAME_EMPTY_MAP = "empty_map"; - @SerializedName(SERIALIZED_NAME_EMPTY_MAP) - private Object emptyMap; - - public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; - @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_STRING) - private Map mapWithUndeclaredPropertiesString = null; - - public AdditionalPropertiesClass() { - } - - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - - this.mapProperty = mapProperty; - return this; - } - - public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { - if (this.mapProperty == null) { - this.mapProperty = new HashMap(); - } - this.mapProperty.put(key, mapPropertyItem); - return this; - } - - /** - * Get mapProperty - * @return mapProperty - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map getMapProperty() { - return mapProperty; - } - - - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; - } - - - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - - this.mapOfMapProperty = mapOfMapProperty; - return this; - } - - public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { - if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); - } - this.mapOfMapProperty.put(key, mapOfMapPropertyItem); - return this; - } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map> getMapOfMapProperty() { - return mapOfMapProperty; - } - - - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; - } - - - public AdditionalPropertiesClass anytype1(Object anytype1) { - - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Object getAnytype1() { - return anytype1; - } - - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - - public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { - - this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; - return this; - } - - /** - * Get mapWithUndeclaredPropertiesAnytype1 - * @return mapWithUndeclaredPropertiesAnytype1 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Object getMapWithUndeclaredPropertiesAnytype1() { - return mapWithUndeclaredPropertiesAnytype1; - } - - - public void setMapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { - this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; - } - - - public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { - - this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; - return this; - } - - /** - * Get mapWithUndeclaredPropertiesAnytype2 - * @return mapWithUndeclaredPropertiesAnytype2 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Object getMapWithUndeclaredPropertiesAnytype2() { - return mapWithUndeclaredPropertiesAnytype2; - } - - - public void setMapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { - this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; - } - - - public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { - - this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; - return this; - } - - public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(String key, Object mapWithUndeclaredPropertiesAnytype3Item) { - if (this.mapWithUndeclaredPropertiesAnytype3 == null) { - this.mapWithUndeclaredPropertiesAnytype3 = new HashMap(); - } - this.mapWithUndeclaredPropertiesAnytype3.put(key, mapWithUndeclaredPropertiesAnytype3Item); - return this; - } - - /** - * Get mapWithUndeclaredPropertiesAnytype3 - * @return mapWithUndeclaredPropertiesAnytype3 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map getMapWithUndeclaredPropertiesAnytype3() { - return mapWithUndeclaredPropertiesAnytype3; - } - - - public void setMapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { - this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; - } - - - public AdditionalPropertiesClass emptyMap(Object emptyMap) { - - this.emptyMap = emptyMap; - return this; - } - - /** - * an object with no declared properties and no undeclared properties, hence it's an empty map. - * @return emptyMap - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "an object with no declared properties and no undeclared properties, hence it's an empty map.") - - public Object getEmptyMap() { - return emptyMap; - } - - - public void setEmptyMap(Object emptyMap) { - this.emptyMap = emptyMap; - } - - - public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { - - this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; - return this; - } - - public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String key, String mapWithUndeclaredPropertiesStringItem) { - if (this.mapWithUndeclaredPropertiesString == null) { - this.mapWithUndeclaredPropertiesString = new HashMap(); - } - this.mapWithUndeclaredPropertiesString.put(key, mapWithUndeclaredPropertiesStringItem); - return this; - } - - /** - * Get mapWithUndeclaredPropertiesString - * @return mapWithUndeclaredPropertiesString - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map getMapWithUndeclaredPropertiesString() { - return mapWithUndeclaredPropertiesString; - } - - - public void setMapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { - this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && - Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && - Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty, anytype1, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" mapWithUndeclaredPropertiesAnytype1: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype1)).append("\n"); - sb.append(" mapWithUndeclaredPropertiesAnytype2: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype2)).append("\n"); - sb.append(" mapWithUndeclaredPropertiesAnytype3: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype3)).append("\n"); - sb.append(" emptyMap: ").append(toIndentedString(emptyMap)).append("\n"); - sb.append(" mapWithUndeclaredPropertiesString: ").append(toIndentedString(mapWithUndeclaredPropertiesString)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("map_property"); - openapiFields.add("map_of_map_property"); - openapiFields.add("anytype_1"); - openapiFields.add("map_with_undeclared_properties_anytype_1"); - openapiFields.add("map_with_undeclared_properties_anytype_2"); - openapiFields.add("map_with_undeclared_properties_anytype_3"); - openapiFields.add("empty_map"); - openapiFields.add("map_with_undeclared_properties_string"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesClass - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesClass is not found in the empty JSON string", AdditionalPropertiesClass.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AdditionalPropertiesClass' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesClass.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AdditionalPropertiesClass value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AdditionalPropertiesClass read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AdditionalPropertiesClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesClass - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass - */ - public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class); - } - - /** - * Convert an instance of AdditionalPropertiesClass to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java deleted file mode 100644 index de69f3d6d73c..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Animal - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Animal { - public static final String SERIALIZED_NAME_CLASS_NAME = "className"; - @SerializedName(SERIALIZED_NAME_CLASS_NAME) - protected String className; - - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color = "red"; - - public Animal() { - this.className = this.getClass().getSimpleName(); - } - - public Animal className(String className) { - - this.className = className; - return this; - } - - /** - * Get className - * @return className - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public String getClassName() { - return className; - } - - - public void setClassName(String className) { - this.className = className; - } - - - public Animal color(String color) { - - this.color = color; - return this; - } - - /** - * Get color - * @return color - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getColor() { - return color; - } - - - public void setColor(String color) { - this.color = color; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("className"); - openapiFields.add("color"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("className"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Animal - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Animal.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Animal is not found in the empty JSON string", Animal.openapiRequiredFields.toString())); - } - } - - String discriminatorValue = jsonObj.get("className").getAsString(); - switch (discriminatorValue) { - case "Cat": - Cat.validateJsonObject(jsonObj); - break; - case "Dog": - Dog.validateJsonObject(jsonObj); - break; - default: - throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); - } - } - - - /** - * Create an instance of Animal given an JSON string - * - * @param jsonString JSON string - * @return An instance of Animal - * @throws IOException if the JSON string is invalid with respect to Animal - */ - public static Animal fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Animal.class); - } - - /** - * Convert an instance of Animal to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index d375bd8a4886..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ArrayOfArrayOfNumberOnly - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ArrayOfArrayOfNumberOnly { - public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly() { - } - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ArrayArrayNumber"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayOfArrayOfNumberOnly - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ArrayOfArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ArrayOfArrayOfNumberOnly' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfArrayOfNumberOnly.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ArrayOfArrayOfNumberOnly value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ArrayOfArrayOfNumberOnly read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfArrayOfNumberOnly - * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly - */ - public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class); - } - - /** - * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java deleted file mode 100644 index 9ec157ed1515..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ArrayOfNumberOnly - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ArrayOfNumberOnly { - public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; - @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) - private List arrayNumber = null; - - public ArrayOfNumberOnly() { - } - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getArrayNumber() { - return arrayNumber; - } - - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ArrayNumber"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayOfNumberOnly - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ArrayOfNumberOnly' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfNumberOnly.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ArrayOfNumberOnly value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ArrayOfNumberOnly read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ArrayOfNumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfNumberOnly - * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly - */ - public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class); - } - - /** - * Convert an instance of ArrayOfNumberOnly to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java deleted file mode 100644 index 66d23d236a84..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.ReadOnlyFirst; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ArrayTest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ArrayTest { - public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; - @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) - private List arrayOfString = null; - - public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = null; - - public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = null; - - public ArrayTest() { - } - - public ArrayTest arrayOfString(List arrayOfString) { - - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getArrayOfString() { - return arrayOfString; - } - - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("array_of_string"); - openapiFields.add("array_array_of_integer"); - openapiFields.add("array_array_of_model"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayTest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayTest.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ArrayTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ArrayTest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ArrayTest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ArrayTest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ArrayTest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ArrayTest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ArrayTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayTest - * @throws IOException if the JSON string is invalid with respect to ArrayTest - */ - public static ArrayTest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ArrayTest.class); - } - - /** - * Convert an instance of ArrayTest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java deleted file mode 100644 index ce4095ed0e52..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java +++ /dev/null @@ -1,353 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Capitalization - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Capitalization { - public static final String SERIALIZED_NAME_SMALL_CAMEL = "smallCamel"; - @SerializedName(SERIALIZED_NAME_SMALL_CAMEL) - private String smallCamel; - - public static final String SERIALIZED_NAME_CAPITAL_CAMEL = "CapitalCamel"; - @SerializedName(SERIALIZED_NAME_CAPITAL_CAMEL) - private String capitalCamel; - - public static final String SERIALIZED_NAME_SMALL_SNAKE = "small_Snake"; - @SerializedName(SERIALIZED_NAME_SMALL_SNAKE) - private String smallSnake; - - public static final String SERIALIZED_NAME_CAPITAL_SNAKE = "Capital_Snake"; - @SerializedName(SERIALIZED_NAME_CAPITAL_SNAKE) - private String capitalSnake; - - public static final String SERIALIZED_NAME_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @SerializedName(SERIALIZED_NAME_SC_A_E_T_H_FLOW_POINTS) - private String scAETHFlowPoints; - - public static final String SERIALIZED_NAME_A_T_T_N_A_M_E = "ATT_NAME"; - @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) - private String ATT_NAME; - - public Capitalization() { - } - - public Capitalization smallCamel(String smallCamel) { - - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getSmallCamel() { - return smallCamel; - } - - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - - public Capitalization capitalCamel(String capitalCamel) { - - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getCapitalCamel() { - return capitalCamel; - } - - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - - public Capitalization smallSnake(String smallSnake) { - - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getSmallSnake() { - return smallSnake; - } - - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - - public Capitalization capitalSnake(String capitalSnake) { - - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getCapitalSnake() { - return capitalSnake; - } - - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - - public Capitalization ATT_NAME(String ATT_NAME) { - - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { - return ATT_NAME; - } - - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("smallCamel"); - openapiFields.add("CapitalCamel"); - openapiFields.add("small_Snake"); - openapiFields.add("Capital_Snake"); - openapiFields.add("SCA_ETH_Flow_Points"); - openapiFields.add("ATT_NAME"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Capitalization - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Capitalization.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Capitalization is not found in the empty JSON string", Capitalization.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Capitalization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Capitalization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Capitalization.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Capitalization' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Capitalization.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Capitalization value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Capitalization read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Capitalization given an JSON string - * - * @param jsonString JSON string - * @return An instance of Capitalization - * @throws IOException if the JSON string is invalid with respect to Capitalization - */ - public static Capitalization fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Capitalization.class); - } - - /** - * Convert an instance of Capitalization to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java deleted file mode 100644 index a81d5016bf72..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.Animal; -import org.openapitools.client.model.CatAllOf; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Cat - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Cat extends Animal { - public static final String SERIALIZED_NAME_DECLAWED = "declawed"; - @SerializedName(SERIALIZED_NAME_DECLAWED) - private Boolean declawed; - - public Cat() { - this.className = this.getClass().getSimpleName(); - } - - public Cat declawed(Boolean declawed) { - - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Boolean getDeclawed() { - return declawed; - } - - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("className"); - openapiFields.add("color"); - openapiFields.add("declawed"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("className"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Cat - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Cat.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Cat is not found in the empty JSON string", Cat.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Cat.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Cat` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Cat.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Cat.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Cat' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Cat.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Cat value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Cat read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Cat given an JSON string - * - * @param jsonString JSON string - * @return An instance of Cat - * @throws IOException if the JSON string is invalid with respect to Cat - */ - public static Cat fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Cat.class); - } - - /** - * Convert an instance of Cat to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java deleted file mode 100644 index 6a2c50e1c046..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * CatAllOf - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CatAllOf { - public static final String SERIALIZED_NAME_DECLAWED = "declawed"; - @SerializedName(SERIALIZED_NAME_DECLAWED) - private Boolean declawed; - - public CatAllOf() { - } - - public CatAllOf declawed(Boolean declawed) { - - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Boolean getDeclawed() { - return declawed; - } - - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("declawed"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CatAllOf - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (CatAllOf.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in CatAllOf is not found in the empty JSON string", CatAllOf.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CatAllOf.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CatAllOf.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CatAllOf' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CatAllOf.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CatAllOf value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CatAllOf read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CatAllOf given an JSON string - * - * @param jsonString JSON string - * @return An instance of CatAllOf - * @throws IOException if the JSON string is invalid with respect to CatAllOf - */ - public static CatAllOf fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CatAllOf.class); - } - - /** - * Convert an instance of CatAllOf to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java deleted file mode 100644 index d23447f518de..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Category - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Category { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private Long id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name = "default-name"; - - public Category() { - } - - public Category id(Long id) { - - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Long getId() { - return id; - } - - - public void setId(Long id) { - this.id = id; - } - - - public Category name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Category - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Category.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Category is not found in the empty JSON string", Category.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Category.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Category` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Category.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Category.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Category' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Category.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Category value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Category read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Category given an JSON string - * - * @param jsonString JSON string - * @return An instance of Category - * @throws IOException if the JSON string is invalid with respect to Category - */ - public static Category fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Category.class); - } - - /** - * Convert an instance of Category to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java deleted file mode 100644 index 8fb1b2f83d15..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ClassModel { - public static final String SERIALIZED_NAME_PROPERTY_CLASS = "_class"; - @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) - private String propertyClass; - - public ClassModel() { - } - - public ClassModel propertyClass(String propertyClass) { - - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getPropertyClass() { - return propertyClass; - } - - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("_class"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ClassModel - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ClassModel.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ClassModel is not found in the empty JSON string", ClassModel.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ClassModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClassModel` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ClassModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ClassModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ClassModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ClassModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ClassModel read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ClassModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ClassModel - * @throws IOException if the JSON string is invalid with respect to ClassModel - */ - public static ClassModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ClassModel.class); - } - - /** - * Convert an instance of ClassModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java deleted file mode 100644 index a52cc0be31af..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Client - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Client { - public static final String SERIALIZED_NAME_CLIENT = "client"; - @SerializedName(SERIALIZED_NAME_CLIENT) - private String client; - - public Client() { - } - - public Client client(String client) { - - this.client = client; - return this; - } - - /** - * Get client - * @return client - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getClient() { - return client; - } - - - public void setClient(String client) { - this.client = client; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("client"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Client - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Client.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Client is not found in the empty JSON string", Client.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Client.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Client` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Client.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Client' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Client.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Client value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Client read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Client given an JSON string - * - * @param jsonString JSON string - * @return An instance of Client - * @throws IOException if the JSON string is invalid with respect to Client - */ - public static Client fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Client.class); - } - - /** - * Convert an instance of Client to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java deleted file mode 100644 index 24062284ab56..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.Animal; -import org.openapitools.client.model.DogAllOf; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Dog - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Dog extends Animal { - public static final String SERIALIZED_NAME_BREED = "breed"; - @SerializedName(SERIALIZED_NAME_BREED) - private String breed; - - public Dog() { - this.className = this.getClass().getSimpleName(); - } - - public Dog breed(String breed) { - - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getBreed() { - return breed; - } - - - public void setBreed(String breed) { - this.breed = breed; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("className"); - openapiFields.add("color"); - openapiFields.add("breed"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("className"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Dog - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Dog.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Dog is not found in the empty JSON string", Dog.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Dog.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Dog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Dog.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Dog.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Dog' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Dog.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Dog value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Dog read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Dog given an JSON string - * - * @param jsonString JSON string - * @return An instance of Dog - * @throws IOException if the JSON string is invalid with respect to Dog - */ - public static Dog fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Dog.class); - } - - /** - * Convert an instance of Dog to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java deleted file mode 100644 index 6053b9169b79..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * DogAllOf - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class DogAllOf { - public static final String SERIALIZED_NAME_BREED = "breed"; - @SerializedName(SERIALIZED_NAME_BREED) - private String breed; - - public DogAllOf() { - } - - public DogAllOf breed(String breed) { - - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getBreed() { - return breed; - } - - - public void setBreed(String breed) { - this.breed = breed; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("breed"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DogAllOf - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (DogAllOf.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in DogAllOf is not found in the empty JSON string", DogAllOf.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DogAllOf.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DogAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DogAllOf.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DogAllOf' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DogAllOf.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DogAllOf value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DogAllOf read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DogAllOf given an JSON string - * - * @param jsonString JSON string - * @return An instance of DogAllOf - * @throws IOException if the JSON string is invalid with respect to DogAllOf - */ - public static DogAllOf fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DogAllOf.class); - } - - /** - * Convert an instance of DogAllOf to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java deleted file mode 100644 index 6b64ece26660..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * EnumArrays - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class EnumArrays { - /** - * Gets or Sets justSymbol - */ - @JsonAdapter(JustSymbolEnum.Adapter.class) - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return JustSymbolEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_JUST_SYMBOL = "just_symbol"; - @SerializedName(SERIALIZED_NAME_JUST_SYMBOL) - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - @JsonAdapter(ArrayEnumEnum.Adapter.class) - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ArrayEnumEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; - @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = null; - - public EnumArrays() { - } - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - - public EnumArrays arrayEnum(List arrayEnum) { - - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getArrayEnum() { - return arrayEnum; - } - - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("just_symbol"); - openapiFields.add("array_enum"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EnumArrays - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (EnumArrays.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in EnumArrays is not found in the empty JSON string", EnumArrays.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EnumArrays.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumArrays` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EnumArrays.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EnumArrays' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EnumArrays.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EnumArrays value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EnumArrays read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EnumArrays given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnumArrays - * @throws IOException if the JSON string is invalid with respect to EnumArrays - */ - public static EnumArrays fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EnumArrays.class); - } - - /** - * Convert an instance of EnumArrays to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumClass.java deleted file mode 100644 index b9a78241a5a7..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumClass.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets EnumClass - */ -@JsonAdapter(EnumClass.Adapter.class) -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnumClass enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnumClass read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EnumClass.fromValue(value); - } - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java deleted file mode 100644 index b25fad66483e..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java +++ /dev/null @@ -1,706 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.OuterEnum; -import org.openapitools.client.model.OuterEnumDefaultValue; -import org.openapitools.client.model.OuterEnumInteger; -import org.openapitools.client.model.OuterEnumIntegerDefaultValue; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * EnumTest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class EnumTest { - /** - * Gets or Sets enumString - */ - @JsonAdapter(EnumStringEnum.Adapter.class) - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnumStringEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EnumStringEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ENUM_STRING = "enum_string"; - @SerializedName(SERIALIZED_NAME_ENUM_STRING) - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - @JsonAdapter(EnumStringRequiredEnum.Adapter.class) - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EnumStringRequiredEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ENUM_STRING_REQUIRED = "enum_string_required"; - @SerializedName(SERIALIZED_NAME_ENUM_STRING_REQUIRED) - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - @JsonAdapter(EnumIntegerEnum.Adapter.class) - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); - return EnumIntegerEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ENUM_INTEGER = "enum_integer"; - @SerializedName(SERIALIZED_NAME_ENUM_INTEGER) - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumIntegerOnly - */ - @JsonAdapter(EnumIntegerOnlyEnum.Adapter.class) - public enum EnumIntegerOnlyEnum { - NUMBER_2(2), - - NUMBER_MINUS_2(-2); - - private Integer value; - - EnumIntegerOnlyEnum(Integer value) { - this.value = value; - } - - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnumIntegerOnlyEnum fromValue(Integer value) { - for (EnumIntegerOnlyEnum b : EnumIntegerOnlyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnumIntegerOnlyEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnumIntegerOnlyEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); - return EnumIntegerOnlyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ENUM_INTEGER_ONLY = "enum_integer_only"; - @SerializedName(SERIALIZED_NAME_ENUM_INTEGER_ONLY) - private EnumIntegerOnlyEnum enumIntegerOnly; - - /** - * Gets or Sets enumNumber - */ - @JsonAdapter(EnumNumberEnum.Adapter.class) - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); - return EnumNumberEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ENUM_NUMBER = "enum_number"; - @SerializedName(SERIALIZED_NAME_ENUM_NUMBER) - private EnumNumberEnum enumNumber; - - public static final String SERIALIZED_NAME_OUTER_ENUM = "outerEnum"; - @SerializedName(SERIALIZED_NAME_OUTER_ENUM) - private OuterEnum outerEnum; - - public static final String SERIALIZED_NAME_OUTER_ENUM_INTEGER = "outerEnumInteger"; - @SerializedName(SERIALIZED_NAME_OUTER_ENUM_INTEGER) - private OuterEnumInteger outerEnumInteger; - - public static final String SERIALIZED_NAME_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; - @SerializedName(SERIALIZED_NAME_OUTER_ENUM_DEFAULT_VALUE) - private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; - - public static final String SERIALIZED_NAME_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; - @SerializedName(SERIALIZED_NAME_OUTER_ENUM_INTEGER_DEFAULT_VALUE) - private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; - - public EnumTest() { - } - - public EnumTest enumString(EnumStringEnum enumString) { - - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { - return enumString; - } - - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - - public EnumTest enumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { - - this.enumIntegerOnly = enumIntegerOnly; - return this; - } - - /** - * Get enumIntegerOnly - * @return enumIntegerOnly - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public EnumIntegerOnlyEnum getEnumIntegerOnly() { - return enumIntegerOnly; - } - - - public void setEnumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { - this.enumIntegerOnly = enumIntegerOnly; - } - - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - - public EnumTest outerEnum(OuterEnum outerEnum) { - - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public OuterEnum getOuterEnum() { - return outerEnum; - } - - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { - - this.outerEnumInteger = outerEnumInteger; - return this; - } - - /** - * Get outerEnumInteger - * @return outerEnumInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public OuterEnumInteger getOuterEnumInteger() { - return outerEnumInteger; - } - - - public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { - this.outerEnumInteger = outerEnumInteger; - } - - - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { - - this.outerEnumDefaultValue = outerEnumDefaultValue; - return this; - } - - /** - * Get outerEnumDefaultValue - * @return outerEnumDefaultValue - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public OuterEnumDefaultValue getOuterEnumDefaultValue() { - return outerEnumDefaultValue; - } - - - public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { - this.outerEnumDefaultValue = outerEnumDefaultValue; - } - - - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { - - this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; - return this; - } - - /** - * Get outerEnumIntegerDefaultValue - * @return outerEnumIntegerDefaultValue - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { - return outerEnumIntegerDefaultValue; - } - - - public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { - this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumIntegerOnly, enumTest.enumIntegerOnly) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum) && - Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && - Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && - Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumIntegerOnly: ").append(toIndentedString(enumIntegerOnly)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); - sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); - sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("enum_string"); - openapiFields.add("enum_string_required"); - openapiFields.add("enum_integer"); - openapiFields.add("enum_integer_only"); - openapiFields.add("enum_number"); - openapiFields.add("outerEnum"); - openapiFields.add("outerEnumInteger"); - openapiFields.add("outerEnumDefaultValue"); - openapiFields.add("outerEnumIntegerDefaultValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("enum_string_required"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EnumTest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (EnumTest.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in EnumTest is not found in the empty JSON string", EnumTest.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EnumTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EnumTest.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EnumTest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EnumTest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EnumTest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EnumTest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EnumTest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EnumTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnumTest - * @throws IOException if the JSON string is invalid with respect to EnumTest - */ - public static EnumTest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EnumTest.class); - } - - /** - * Convert an instance of EnumTest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java deleted file mode 100644 index 48923c990846..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java +++ /dev/null @@ -1,679 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * FormatTest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FormatTest { - public static final String SERIALIZED_NAME_INTEGER = "integer"; - @SerializedName(SERIALIZED_NAME_INTEGER) - private Integer integer; - - public static final String SERIALIZED_NAME_INT32 = "int32"; - @SerializedName(SERIALIZED_NAME_INT32) - private Integer int32; - - public static final String SERIALIZED_NAME_INT64 = "int64"; - @SerializedName(SERIALIZED_NAME_INT64) - private Long int64; - - public static final String SERIALIZED_NAME_NUMBER = "number"; - @SerializedName(SERIALIZED_NAME_NUMBER) - private BigDecimal number; - - public static final String SERIALIZED_NAME_FLOAT = "float"; - @SerializedName(SERIALIZED_NAME_FLOAT) - private Float _float; - - public static final String SERIALIZED_NAME_DOUBLE = "double"; - @SerializedName(SERIALIZED_NAME_DOUBLE) - private Double _double; - - public static final String SERIALIZED_NAME_DECIMAL = "decimal"; - @SerializedName(SERIALIZED_NAME_DECIMAL) - private BigDecimal decimal; - - public static final String SERIALIZED_NAME_STRING = "string"; - @SerializedName(SERIALIZED_NAME_STRING) - private String string; - - public static final String SERIALIZED_NAME_BYTE = "byte"; - @SerializedName(SERIALIZED_NAME_BYTE) - private byte[] _byte; - - public static final String SERIALIZED_NAME_BINARY = "binary"; - @SerializedName(SERIALIZED_NAME_BINARY) - private File binary; - - public static final String SERIALIZED_NAME_DATE = "date"; - @SerializedName(SERIALIZED_NAME_DATE) - private LocalDate date; - - public static final String SERIALIZED_NAME_DATE_TIME = "dateTime"; - @SerializedName(SERIALIZED_NAME_DATE_TIME) - private OffsetDateTime dateTime; - - public static final String SERIALIZED_NAME_UUID = "uuid"; - @SerializedName(SERIALIZED_NAME_UUID) - private UUID uuid; - - public static final String SERIALIZED_NAME_PASSWORD = "password"; - @SerializedName(SERIALIZED_NAME_PASSWORD) - private String password; - - public static final String SERIALIZED_NAME_PATTERN_WITH_DIGITS = "pattern_with_digits"; - @SerializedName(SERIALIZED_NAME_PATTERN_WITH_DIGITS) - private String patternWithDigits; - - public static final String SERIALIZED_NAME_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; - @SerializedName(SERIALIZED_NAME_PATTERN_WITH_DIGITS_AND_DELIMITER) - private String patternWithDigitsAndDelimiter; - - public FormatTest() { - } - - public FormatTest integer(Integer integer) { - - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getInteger() { - return integer; - } - - - public void setInteger(Integer integer) { - this.integer = integer; - } - - - public FormatTest int32(Integer int32) { - - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getInt32() { - return int32; - } - - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - - public FormatTest int64(Long int64) { - - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Long getInt64() { - return int64; - } - - - public void setInt64(Long int64) { - this.int64 = int64; - } - - - public FormatTest number(BigDecimal number) { - - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public BigDecimal getNumber() { - return number; - } - - - public void setNumber(BigDecimal number) { - this.number = number; - } - - - public FormatTest _float(Float _float) { - - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Float getFloat() { - return _float; - } - - - public void setFloat(Float _float) { - this._float = _float; - } - - - public FormatTest _double(Double _double) { - - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Double getDouble() { - return _double; - } - - - public void setDouble(Double _double) { - this._double = _double; - } - - - public FormatTest decimal(BigDecimal decimal) { - - this.decimal = decimal; - return this; - } - - /** - * Get decimal - * @return decimal - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public BigDecimal getDecimal() { - return decimal; - } - - - public void setDecimal(BigDecimal decimal) { - this.decimal = decimal; - } - - - public FormatTest string(String string) { - - this.string = string; - return this; - } - - /** - * Get string - * @return string - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getString() { - return string; - } - - - public void setString(String string) { - this.string = string; - } - - - public FormatTest _byte(byte[] _byte) { - - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public byte[] getByte() { - return _byte; - } - - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - - public FormatTest binary(File binary) { - - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public File getBinary() { - return binary; - } - - - public void setBinary(File binary) { - this.binary = binary; - } - - - public FormatTest date(LocalDate date) { - - this.date = date; - return this; - } - - /** - * Get date - * @return date - **/ - @javax.annotation.Nonnull - @ApiModelProperty(example = "Sun Feb 02 00:00:00 UTC 2020", required = true, value = "") - - public LocalDate getDate() { - return date; - } - - - public void setDate(LocalDate date) { - this.date = date; - } - - - public FormatTest dateTime(OffsetDateTime dateTime) { - - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "2007-12-03T10:15:30+01:00", value = "") - - public OffsetDateTime getDateTime() { - return dateTime; - } - - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - - public FormatTest uuid(UUID uuid) { - - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - public UUID getUuid() { - return uuid; - } - - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - - public FormatTest password(String password) { - - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public String getPassword() { - return password; - } - - - public void setPassword(String password) { - this.password = password; - } - - - public FormatTest patternWithDigits(String patternWithDigits) { - - this.patternWithDigits = patternWithDigits; - return this; - } - - /** - * A string that is a 10 digit number. Can have leading zeros. - * @return patternWithDigits - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.") - - public String getPatternWithDigits() { - return patternWithDigits; - } - - - public void setPatternWithDigits(String patternWithDigits) { - this.patternWithDigits = patternWithDigits; - } - - - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { - - this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; - return this; - } - - /** - * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - * @return patternWithDigitsAndDelimiter - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") - - public String getPatternWithDigitsAndDelimiter() { - return patternWithDigitsAndDelimiter; - } - - - public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { - this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.decimal, formatTest.decimal) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && - Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); - sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("integer"); - openapiFields.add("int32"); - openapiFields.add("int64"); - openapiFields.add("number"); - openapiFields.add("float"); - openapiFields.add("double"); - openapiFields.add("decimal"); - openapiFields.add("string"); - openapiFields.add("byte"); - openapiFields.add("binary"); - openapiFields.add("date"); - openapiFields.add("dateTime"); - openapiFields.add("uuid"); - openapiFields.add("password"); - openapiFields.add("pattern_with_digits"); - openapiFields.add("pattern_with_digits_and_delimiter"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("number"); - openapiRequiredFields.add("byte"); - openapiRequiredFields.add("date"); - openapiRequiredFields.add("password"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FormatTest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FormatTest.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in FormatTest is not found in the empty JSON string", FormatTest.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!FormatTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FormatTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FormatTest.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FormatTest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FormatTest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FormatTest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FormatTest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public FormatTest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FormatTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of FormatTest - * @throws IOException if the JSON string is invalid with respect to FormatTest - */ - public static FormatTest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FormatTest.class); - } - - /** - * Convert an instance of FormatTest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java deleted file mode 100644 index ff80990e36a7..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * HasOnlyReadOnly - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class HasOnlyReadOnly { - public static final String SERIALIZED_NAME_BAR = "bar"; - @SerializedName(SERIALIZED_NAME_BAR) - private String bar; - - public static final String SERIALIZED_NAME_FOO = "foo"; - @SerializedName(SERIALIZED_NAME_FOO) - private String foo; - - public HasOnlyReadOnly() { - } - - - public HasOnlyReadOnly( - String bar, - String foo - ) { - this(); - this.bar = bar; - this.foo = foo; - } - - /** - * Get bar - * @return bar - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getBar() { - return bar; - } - - - - - /** - * Get foo - * @return foo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getFoo() { - return foo; - } - - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("bar"); - openapiFields.add("foo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HasOnlyReadOnly - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (HasOnlyReadOnly.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in HasOnlyReadOnly is not found in the empty JSON string", HasOnlyReadOnly.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!HasOnlyReadOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasOnlyReadOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!HasOnlyReadOnly.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'HasOnlyReadOnly' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(HasOnlyReadOnly.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, HasOnlyReadOnly value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public HasOnlyReadOnly read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of HasOnlyReadOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of HasOnlyReadOnly - * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly - */ - public static HasOnlyReadOnly fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, HasOnlyReadOnly.class); - } - - /** - * Convert an instance of HasOnlyReadOnly to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java deleted file mode 100644 index 51fb198904fe..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java +++ /dev/null @@ -1,375 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * MapTest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MapTest { - public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; - @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - @JsonAdapter(InnerEnum.Adapter.class) - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public InnerEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return InnerEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = null; - - public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; - @SerializedName(SERIALIZED_NAME_DIRECT_MAP) - private Map directMap = null; - - public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; - @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private Map indirectMap = null; - - public MapTest() { - } - - public MapTest mapMapOfString(Map> mapMapOfString) { - - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map> getMapMapOfString() { - return mapMapOfString; - } - - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - - public MapTest mapOfEnumString(Map mapOfEnumString) { - - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - - public MapTest directMap(Map directMap) { - - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map getDirectMap() { - return directMap; - } - - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - - public MapTest indirectMap(Map indirectMap) { - - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map getIndirectMap() { - return indirectMap; - } - - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("map_map_of_string"); - openapiFields.add("map_of_enum_string"); - openapiFields.add("direct_map"); - openapiFields.add("indirect_map"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MapTest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (MapTest.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in MapTest is not found in the empty JSON string", MapTest.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!MapTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MapTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MapTest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MapTest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MapTest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, MapTest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public MapTest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of MapTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of MapTest - * @throws IOException if the JSON string is invalid with respect to MapTest - */ - public static MapTest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MapTest.class); - } - - /** - * Convert an instance of MapTest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index 3bd9f59adbb8..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - public static final String SERIALIZED_NAME_UUID = "uuid"; - @SerializedName(SERIALIZED_NAME_UUID) - private UUID uuid; - - public static final String SERIALIZED_NAME_DATE_TIME = "dateTime"; - @SerializedName(SERIALIZED_NAME_DATE_TIME) - private OffsetDateTime dateTime; - - public static final String SERIALIZED_NAME_MAP = "map"; - @SerializedName(SERIALIZED_NAME_MAP) - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass() { - } - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public UUID getUuid() { - return uuid; - } - - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public OffsetDateTime getDateTime() { - return dateTime; - } - - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map getMap() { - return map; - } - - - public void setMap(Map map) { - this.map = map; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("uuid"); - openapiFields.add("dateTime"); - openapiFields.add("map"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in MixedPropertiesAndAdditionalPropertiesClass is not found in the empty JSON string", MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!MixedPropertiesAndAdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MixedPropertiesAndAdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MixedPropertiesAndAdditionalPropertiesClass' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MixedPropertiesAndAdditionalPropertiesClass.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, MixedPropertiesAndAdditionalPropertiesClass value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public MixedPropertiesAndAdditionalPropertiesClass read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of MixedPropertiesAndAdditionalPropertiesClass - * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass - */ - public static MixedPropertiesAndAdditionalPropertiesClass fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MixedPropertiesAndAdditionalPropertiesClass.class); - } - - /** - * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java deleted file mode 100644 index a6f1720f9e57..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Model200Response { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private Integer name; - - public static final String SERIALIZED_NAME_PROPERTY_CLASS = "class"; - @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) - private String propertyClass; - - public Model200Response() { - } - - public Model200Response name(Integer name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getName() { - return name; - } - - - public void setName(Integer name) { - this.name = name; - } - - - public Model200Response propertyClass(String propertyClass) { - - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getPropertyClass() { - return propertyClass; - } - - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("class"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Model200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Model200Response.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Model200Response is not found in the empty JSON string", Model200Response.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Model200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Model200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Model200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Model200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Model200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Model200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Model200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Model200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of Model200Response - * @throws IOException if the JSON string is invalid with respect to Model200Response - */ - public static Model200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Model200Response.class); - } - - /** - * Convert an instance of Model200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java deleted file mode 100644 index 9d4ee4fbdf4b..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ModelApiResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ModelApiResponse { - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private Integer code; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public ModelApiResponse() { - } - - public ModelApiResponse code(Integer code) { - - this.code = code; - return this; - } - - /** - * Get code - * @return code - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getCode() { - return code; - } - - - public void setCode(Integer code) { - this.code = code; - } - - - public ModelApiResponse type(String type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - public ModelApiResponse message(String message) { - - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getMessage() { - return message; - } - - - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("code"); - openapiFields.add("type"); - openapiFields.add("message"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ModelApiResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ModelApiResponse.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ModelApiResponse is not found in the empty JSON string", ModelApiResponse.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ModelApiResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ModelApiResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ModelApiResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ModelApiResponse value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ModelApiResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ModelApiResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelApiResponse - * @throws IOException if the JSON string is invalid with respect to ModelApiResponse - */ - public static ModelApiResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ModelApiResponse.class); - } - - /** - * Convert an instance of ModelApiResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java deleted file mode 100644 index 4b0921084274..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ModelFile { - public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; - @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) - private String sourceURI; - - public ModelFile() { - } - - public ModelFile sourceURI(String sourceURI) { - - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { - return sourceURI; - } - - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceURI"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ModelFile - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ModelFile.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ModelFile is not found in the empty JSON string", ModelFile.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ModelFile.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ModelFile.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ModelFile' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ModelFile.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ModelFile value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ModelFile read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ModelFile given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelFile - * @throws IOException if the JSON string is invalid with respect to ModelFile - */ - public static ModelFile fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ModelFile.class); - } - - /** - * Convert an instance of ModelFile to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java deleted file mode 100644 index cffa7fb4f941..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ModelList - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ModelList { - public static final String SERIALIZED_NAME_123LIST = "123-list"; - @SerializedName(SERIALIZED_NAME_123LIST) - private String _123list; - - public ModelList() { - } - - public ModelList _123list(String _123list) { - - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String get123list() { - return _123list; - } - - - public void set123list(String _123list) { - this._123list = _123list; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("123-list"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ModelList - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ModelList.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ModelList is not found in the empty JSON string", ModelList.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ModelList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ModelList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ModelList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ModelList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ModelList value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ModelList read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ModelList given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelList - * @throws IOException if the JSON string is invalid with respect to ModelList - */ - public static ModelList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ModelList.class); - } - - /** - * Convert an instance of ModelList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java deleted file mode 100644 index 09a6be5b714a..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ModelReturn { - public static final String SERIALIZED_NAME_RETURN = "return"; - @SerializedName(SERIALIZED_NAME_RETURN) - private Integer _return; - - public ModelReturn() { - } - - public ModelReturn _return(Integer _return) { - - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getReturn() { - return _return; - } - - - public void setReturn(Integer _return) { - this._return = _return; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("return"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ModelReturn - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ModelReturn.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ModelReturn is not found in the empty JSON string", ModelReturn.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ModelReturn.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelReturn` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ModelReturn.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ModelReturn' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ModelReturn.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ModelReturn value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ModelReturn read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ModelReturn given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelReturn - * @throws IOException if the JSON string is invalid with respect to ModelReturn - */ - public static ModelReturn fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ModelReturn.class); - } - - /** - * Convert an instance of ModelReturn to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java deleted file mode 100644 index a9f5ca0e1508..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Name { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private Integer name; - - public static final String SERIALIZED_NAME_SNAKE_CASE = "snake_case"; - @SerializedName(SERIALIZED_NAME_SNAKE_CASE) - private Integer snakeCase; - - public static final String SERIALIZED_NAME_PROPERTY = "property"; - @SerializedName(SERIALIZED_NAME_PROPERTY) - private String property; - - public static final String SERIALIZED_NAME_123NUMBER = "123Number"; - @SerializedName(SERIALIZED_NAME_123NUMBER) - private Integer _123number; - - public Name() { - } - - - public Name( - Integer snakeCase, - Integer _123number - ) { - this(); - this.snakeCase = snakeCase; - this._123number = _123number; - } - - public Name name(Integer name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public Integer getName() { - return name; - } - - - public void setName(Integer name) { - this.name = name; - } - - - /** - * Get snakeCase - * @return snakeCase - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getSnakeCase() { - return snakeCase; - } - - - - - public Name property(String property) { - - this.property = property; - return this; - } - - /** - * Get property - * @return property - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getProperty() { - return property; - } - - - public void setProperty(String property) { - this.property = property; - } - - - /** - * Get _123number - * @return _123number - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer get123number() { - return _123number; - } - - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("snake_case"); - openapiFields.add("property"); - openapiFields.add("123Number"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Name - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Name.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Name is not found in the empty JSON string", Name.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Name.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Name.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Name' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Name.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Name value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Name read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Name given an JSON string - * - * @param jsonString JSON string - * @return An instance of Name - * @throws IOException if the JSON string is invalid with respect to Name - */ - public static Name fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Name.class); - } - - /** - * Convert an instance of Name to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java deleted file mode 100644 index 180a6db89aac..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * NumberOnly - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class NumberOnly { - public static final String SERIALIZED_NAME_JUST_NUMBER = "JustNumber"; - @SerializedName(SERIALIZED_NAME_JUST_NUMBER) - private BigDecimal justNumber; - - public NumberOnly() { - } - - public NumberOnly justNumber(BigDecimal justNumber) { - - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public BigDecimal getJustNumber() { - return justNumber; - } - - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("JustNumber"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to NumberOnly - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (NumberOnly.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in NumberOnly is not found in the empty JSON string", NumberOnly.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!NumberOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NumberOnly.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NumberOnly' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(NumberOnly.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, NumberOnly value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public NumberOnly read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of NumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of NumberOnly - * @throws IOException if the JSON string is invalid with respect to NumberOnly - */ - public static NumberOnly fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NumberOnly.class); - } - - /** - * Convert an instance of NumberOnly to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java deleted file mode 100644 index 82d8a256c0b1..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.threeten.bp.OffsetDateTime; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Order - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Order { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private Long id; - - public static final String SERIALIZED_NAME_PET_ID = "petId"; - @SerializedName(SERIALIZED_NAME_PET_ID) - private Long petId; - - public static final String SERIALIZED_NAME_QUANTITY = "quantity"; - @SerializedName(SERIALIZED_NAME_QUANTITY) - private Integer quantity; - - public static final String SERIALIZED_NAME_SHIP_DATE = "shipDate"; - @SerializedName(SERIALIZED_NAME_SHIP_DATE) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_COMPLETE = "complete"; - @SerializedName(SERIALIZED_NAME_COMPLETE) - private Boolean complete = false; - - public Order() { - } - - public Order id(Long id) { - - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Long getId() { - return id; - } - - - public void setId(Long id) { - this.id = id; - } - - - public Order petId(Long petId) { - - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Long getPetId() { - return petId; - } - - - public void setPetId(Long petId) { - this.petId = petId; - } - - - public Order quantity(Integer quantity) { - - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Integer getQuantity() { - return quantity; - } - - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - - public Order shipDate(OffsetDateTime shipDate) { - - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "2020-02-02T20:20:20.000222Z", value = "") - - public OffsetDateTime getShipDate() { - return shipDate; - } - - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - - public Order status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Order Status - * @return status - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { - return status; - } - - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - public Order complete(Boolean complete) { - - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Boolean getComplete() { - return complete; - } - - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("petId"); - openapiFields.add("quantity"); - openapiFields.add("shipDate"); - openapiFields.add("status"); - openapiFields.add("complete"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Order - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Order.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Order is not found in the empty JSON string", Order.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Order.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Order.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Order' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Order.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Order value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Order read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Order given an JSON string - * - * @param jsonString JSON string - * @return An instance of Order - * @throws IOException if the JSON string is invalid with respect to Order - */ - public static Order fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Order.class); - } - - /** - * Convert an instance of Order to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java deleted file mode 100644 index e86d5bc5ff5e..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * OuterComposite - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class OuterComposite { - public static final String SERIALIZED_NAME_MY_NUMBER = "my_number"; - @SerializedName(SERIALIZED_NAME_MY_NUMBER) - private BigDecimal myNumber; - - public static final String SERIALIZED_NAME_MY_STRING = "my_string"; - @SerializedName(SERIALIZED_NAME_MY_STRING) - private String myString; - - public static final String SERIALIZED_NAME_MY_BOOLEAN = "my_boolean"; - @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) - private Boolean myBoolean; - - public OuterComposite() { - } - - public OuterComposite myNumber(BigDecimal myNumber) { - - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public BigDecimal getMyNumber() { - return myNumber; - } - - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - - public OuterComposite myString(String myString) { - - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getMyString() { - return myString; - } - - - public void setMyString(String myString) { - this.myString = myString; - } - - - public OuterComposite myBoolean(Boolean myBoolean) { - - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { - return myBoolean; - } - - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("my_number"); - openapiFields.add("my_string"); - openapiFields.add("my_boolean"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to OuterComposite - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (OuterComposite.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in OuterComposite is not found in the empty JSON string", OuterComposite.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!OuterComposite.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OuterComposite` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OuterComposite.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OuterComposite' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OuterComposite.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OuterComposite value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OuterComposite read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OuterComposite given an JSON string - * - * @param jsonString JSON string - * @return An instance of OuterComposite - * @throws IOException if the JSON string is invalid with respect to OuterComposite - */ - public static OuterComposite fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OuterComposite.class); - } - - /** - * Convert an instance of OuterComposite to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnum.java deleted file mode 100644 index c4e27915c8aa..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets OuterEnum - */ -@JsonAdapter(OuterEnum.Adapter.class) -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final OuterEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public OuterEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return OuterEnum.fromValue(value); - } - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java deleted file mode 100644 index 5d2d5688cb3c..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java +++ /dev/null @@ -1,439 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Category; -import org.openapitools.client.model.Tag; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Pet - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Pet { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private Long id; - - public static final String SERIALIZED_NAME_CATEGORY = "category"; - @SerializedName(SERIALIZED_NAME_CATEGORY) - private Category category; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; - @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; - - /** - * pet status in the store - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public Pet() { - } - - public Pet id(Long id) { - - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Long getId() { - return id; - } - - - public void setId(Long id) { - this.id = id; - } - - - public Pet category(Category category) { - - this.category = category; - return this; - } - - /** - * Get category - * @return category - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Category getCategory() { - return category; - } - - - public void setCategory(Category category) { - this.category = category; - } - - - public Pet name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(example = "doggie", required = true, value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public Pet photoUrls(List photoUrls) { - - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public List getPhotoUrls() { - return photoUrls; - } - - - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - - public Pet tags(List tags) { - - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getTags() { - return tags; - } - - - public void setTags(List tags) { - this.tags = tags; - } - - - public Pet status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { - return status; - } - - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("category"); - openapiFields.add("name"); - openapiFields.add("photoUrls"); - openapiFields.add("tags"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("photoUrls"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Pet - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Pet.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Pet is not found in the empty JSON string", Pet.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Pet.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Pet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Pet.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `category` - if (jsonObj.getAsJsonObject("category") != null) { - Category.validateJsonObject(jsonObj.getAsJsonObject("category")); - } - JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); - // validate the optional field `tags` (array) - if (jsonArraytags != null) { - for (int i = 0; i < jsonArraytags.size(); i++) { - Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject()); - }; - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Pet.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Pet' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Pet.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Pet value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Pet read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Pet given an JSON string - * - * @param jsonString JSON string - * @return An instance of Pet - * @throws IOException if the JSON string is invalid with respect to Pet - */ - public static Pet fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Pet.class); - } - - /** - * Convert an instance of Pet to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java deleted file mode 100644 index 14b28a610665..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ReadOnlyFirst - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ReadOnlyFirst { - public static final String SERIALIZED_NAME_BAR = "bar"; - @SerializedName(SERIALIZED_NAME_BAR) - private String bar; - - public static final String SERIALIZED_NAME_BAZ = "baz"; - @SerializedName(SERIALIZED_NAME_BAZ) - private String baz; - - public ReadOnlyFirst() { - } - - - public ReadOnlyFirst( - String bar - ) { - this(); - this.bar = bar; - } - - /** - * Get bar - * @return bar - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getBar() { - return bar; - } - - - - - public ReadOnlyFirst baz(String baz) { - - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getBaz() { - return baz; - } - - - public void setBaz(String baz) { - this.baz = baz; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("bar"); - openapiFields.add("baz"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ReadOnlyFirst - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ReadOnlyFirst.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ReadOnlyFirst is not found in the empty JSON string", ReadOnlyFirst.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ReadOnlyFirst.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadOnlyFirst` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReadOnlyFirst.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReadOnlyFirst' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ReadOnlyFirst.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ReadOnlyFirst value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReadOnlyFirst read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ReadOnlyFirst given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReadOnlyFirst - * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst - */ - public static ReadOnlyFirst fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReadOnlyFirst.class); - } - - /** - * Convert an instance of ReadOnlyFirst to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java deleted file mode 100644 index 9b26d894f051..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * SpecialModelName - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SpecialModelName { - public static final String SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) - private Long $specialPropertyName; - - public static final String SERIALIZED_NAME_SPECIAL_MODEL_NAME = "_special_model.name_"; - @SerializedName(SERIALIZED_NAME_SPECIAL_MODEL_NAME) - private String specialModelName; - - public SpecialModelName() { - } - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - - public SpecialModelName specialModelName(String specialModelName) { - - this.specialModelName = specialModelName; - return this; - } - - /** - * Get specialModelName - * @return specialModelName - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getSpecialModelName() { - return specialModelName; - } - - - public void setSpecialModelName(String specialModelName) { - this.specialModelName = specialModelName; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName) && - Objects.equals(this.specialModelName, specialModelName.specialModelName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName, specialModelName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append(" specialModelName: ").append(toIndentedString(specialModelName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("$special[property.name]"); - openapiFields.add("_special_model.name_"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SpecialModelName - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SpecialModelName.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in SpecialModelName is not found in the empty JSON string", SpecialModelName.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!SpecialModelName.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SpecialModelName` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SpecialModelName.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SpecialModelName' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SpecialModelName.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SpecialModelName value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SpecialModelName read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SpecialModelName given an JSON string - * - * @param jsonString JSON string - * @return An instance of SpecialModelName - * @throws IOException if the JSON string is invalid with respect to SpecialModelName - */ - public static SpecialModelName fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SpecialModelName.class); - } - - /** - * Convert an instance of SpecialModelName to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java deleted file mode 100644 index 0aae4c29af96..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * Tag - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Tag { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private Long id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public Tag() { - } - - public Tag id(Long id) { - - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Long getId() { - return id; - } - - - public void setId(Long id) { - this.id = id; - } - - - public Tag name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Tag - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Tag.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Tag.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Tag.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Tag' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Tag.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Tag value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Tag read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Tag given an JSON string - * - * @param jsonString JSON string - * @return An instance of Tag - * @throws IOException if the JSON string is invalid with respect to Tag - */ - public static Tag fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Tag.class); - } - - /** - * Convert an instance of Tag to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java deleted file mode 100644 index d1b54e47fe4e..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java +++ /dev/null @@ -1,545 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * User - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class User { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private Long id; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; - @SerializedName(SERIALIZED_NAME_FIRST_NAME) - private String firstName; - - public static final String SERIALIZED_NAME_LAST_NAME = "lastName"; - @SerializedName(SERIALIZED_NAME_LAST_NAME) - private String lastName; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_PASSWORD = "password"; - @SerializedName(SERIALIZED_NAME_PASSWORD) - private String password; - - public static final String SERIALIZED_NAME_PHONE = "phone"; - @SerializedName(SERIALIZED_NAME_PHONE) - private String phone; - - public static final String SERIALIZED_NAME_USER_STATUS = "userStatus"; - @SerializedName(SERIALIZED_NAME_USER_STATUS) - private Integer userStatus; - - public static final String SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; - @SerializedName(SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS) - private Object objectWithNoDeclaredProps; - - public static final String SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; - @SerializedName(SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) - private Object objectWithNoDeclaredPropsNullable; - - public static final String SERIALIZED_NAME_ANY_TYPE_PROP = "anyTypeProp"; - @SerializedName(SERIALIZED_NAME_ANY_TYPE_PROP) - private Object anyTypeProp = null; - - public static final String SERIALIZED_NAME_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; - @SerializedName(SERIALIZED_NAME_ANY_TYPE_PROP_NULLABLE) - private Object anyTypePropNullable = null; - - public User() { - } - - public User id(Long id) { - - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Long getId() { - return id; - } - - - public void setId(Long id) { - this.id = id; - } - - - public User username(String username) { - - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getUsername() { - return username; - } - - - public void setUsername(String username) { - this.username = username; - } - - - public User firstName(String firstName) { - - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getFirstName() { - return firstName; - } - - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - - public User lastName(String lastName) { - - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getLastName() { - return lastName; - } - - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - - public User email(String email) { - - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getEmail() { - return email; - } - - - public void setEmail(String email) { - this.email = email; - } - - - public User password(String password) { - - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getPassword() { - return password; - } - - - public void setPassword(String password) { - this.password = password; - } - - - public User phone(String phone) { - - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getPhone() { - return phone; - } - - - public void setPhone(String phone) { - this.phone = phone; - } - - - public User userStatus(Integer userStatus) { - - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { - return userStatus; - } - - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - - public User objectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { - - this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; - return this; - } - - /** - * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. - * @return objectWithNoDeclaredProps - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.") - - public Object getObjectWithNoDeclaredProps() { - return objectWithNoDeclaredProps; - } - - - public void setObjectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { - this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; - } - - - public User objectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { - - this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; - return this; - } - - /** - * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. - * @return objectWithNoDeclaredPropsNullable - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.") - - public Object getObjectWithNoDeclaredPropsNullable() { - return objectWithNoDeclaredPropsNullable; - } - - - public void setObjectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { - this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; - } - - - public User anyTypeProp(Object anyTypeProp) { - - this.anyTypeProp = anyTypeProp; - return this; - } - - /** - * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 - * @return anyTypeProp - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389") - - public Object getAnyTypeProp() { - return anyTypeProp; - } - - - public void setAnyTypeProp(Object anyTypeProp) { - this.anyTypeProp = anyTypeProp; - } - - - public User anyTypePropNullable(Object anyTypePropNullable) { - - this.anyTypePropNullable = anyTypePropNullable; - return this; - } - - /** - * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. - * @return anyTypePropNullable - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.") - - public Object getAnyTypePropNullable() { - return anyTypePropNullable; - } - - - public void setAnyTypePropNullable(Object anyTypePropNullable) { - this.anyTypePropNullable = anyTypePropNullable; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus) && - Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && - Objects.equals(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && - Objects.equals(this.anyTypeProp, user.anyTypeProp) && - Objects.equals(this.anyTypePropNullable, user.anyTypePropNullable); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, anyTypeProp, anyTypePropNullable); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append(" objectWithNoDeclaredProps: ").append(toIndentedString(objectWithNoDeclaredProps)).append("\n"); - sb.append(" objectWithNoDeclaredPropsNullable: ").append(toIndentedString(objectWithNoDeclaredPropsNullable)).append("\n"); - sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n"); - sb.append(" anyTypePropNullable: ").append(toIndentedString(anyTypePropNullable)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("username"); - openapiFields.add("firstName"); - openapiFields.add("lastName"); - openapiFields.add("email"); - openapiFields.add("password"); - openapiFields.add("phone"); - openapiFields.add("userStatus"); - openapiFields.add("objectWithNoDeclaredProps"); - openapiFields.add("objectWithNoDeclaredPropsNullable"); - openapiFields.add("anyTypeProp"); - openapiFields.add("anyTypePropNullable"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to User - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (User.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!User.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!User.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'User' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(User.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, User value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public User read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of User given an JSON string - * - * @param jsonString JSON string - * @return An instance of User - * @throws IOException if the JSON string is invalid with respect to User - */ - public static User fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, User.class); - } - - /** - * Convert an instance of User to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ApiClientTest.java deleted file mode 100644 index 9edd0ae7bedc..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ApiClientTest.java +++ /dev/null @@ -1,345 +0,0 @@ -package org.openapitools.client; - -import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.*; - -import java.util.*; -import okhttp3.OkHttpClient; -import org.junit.*; -import org.openapitools.client.auth.*; - -public class ApiClientTest { - ApiClient apiClient; - JSON json; - - @Before - public void setup() { - apiClient = new ApiClient(); - json = apiClient.getJSON(); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime(null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - - assertTrue(apiClient.isJsonMime("application/json-patch+json")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[] {"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[] {"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[] {"text/plain", "application/xml"}; - assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[] {}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[] {"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[] {"application/xml", "application/json; charset=UTF8"}; - assertEquals( - "application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[] {"text/plain", "application/xml"}; - assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[] {}; - assertNull(apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - /* - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - */ - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testGetAndSetConnectTimeout() { - // connect timeout defaults to 10 seconds - assertEquals(10000, apiClient.getConnectTimeout()); - assertEquals(10000, apiClient.getHttpClient().connectTimeoutMillis()); - - apiClient.setConnectTimeout(0); - assertEquals(0, apiClient.getConnectTimeout()); - assertEquals(0, apiClient.getHttpClient().connectTimeoutMillis()); - - apiClient.setConnectTimeout(10000); - } - - @Test - public void testGetAndSetReadTimeout() { - // read timeout defaults to 10 seconds - assertEquals(10000, apiClient.getReadTimeout()); - assertEquals(10000, apiClient.getHttpClient().readTimeoutMillis()); - - apiClient.setReadTimeout(0); - assertEquals(0, apiClient.getReadTimeout()); - assertEquals(0, apiClient.getHttpClient().readTimeoutMillis()); - - apiClient.setReadTimeout(10000); - } - - @Test - public void testGetAndSetWriteTimeout() { - // write timeout defaults to 10 seconds - assertEquals(10000, apiClient.getWriteTimeout()); - assertEquals(10000, apiClient.getHttpClient().writeTimeoutMillis()); - - apiClient.setWriteTimeout(0); - assertEquals(0, apiClient.getWriteTimeout()); - assertEquals(0, apiClient.getHttpClient().writeTimeoutMillis()); - - apiClient.setWriteTimeout(10000); - } - - @Test - public void testParameterToPairWhenNameIsInvalid() throws Exception { - List pairs_a = apiClient.parameterToPair(null, new Integer(1)); - List pairs_b = apiClient.parameterToPair("", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPair("param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsEmptyString() throws Exception { - // single empty string - List pairs = apiClient.parameterToPair("param-a", " "); - assertEquals(1, pairs.size()); - } - - @Test - public void testParameterToPairWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - List pairs = apiClient.parameterToPair(name, value); - - assertEquals(1, pairs.size()); - assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); - } - - @Test - public void testParameterToPairWhenValueIsCollection() throws Exception { - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - List pairs = apiClient.parameterToPair("param-a", values); - assertEquals(0, pairs.size()); - } - - @Test - public void testParameterToPairsWhenNameIsInvalid() throws Exception { - List objects = new ArrayList(); - objects.add(new Integer(1)); - - List pairs_a = apiClient.parameterToPairs("csv", null, objects); - List pairs_b = apiClient.parameterToPairs("csv", "", objects); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPairs("csv", "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); - - assertEquals(1, concatStrings.size()); - assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToPairsWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put("csv", ","); - collectionFormatMap.put("tsv", "\t"); - collectionFormatMap.put("ssv", " "); - collectionFormatMap.put("pipes", "|"); - collectionFormatMap.put("", ","); // no format, must default to csv - collectionFormatMap.put("unknown", ","); // all other formats, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - List multiPairs = apiClient.parameterToPairs("multi", name, values); - assertEquals(values.size(), multiPairs.size()); - for (int i = 0; i < values.size(); i++) { - assertEquals( - apiClient.escapeString(apiClient.parameterToString(values.get(i))), - multiPairs.get(i).getValue()); - } - - // all other formats - for (String collectionFormat : collectionFormatMap.keySet()) { - List pairs = apiClient.parameterToPairs(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - if (!delimiter.equals(",")) { - // commas are not escaped because they are reserved characters in URIs - delimiter = apiClient.escapeString(delimiter); - } - String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); - - // must equal input values - assertEquals(values.size(), pairValueSplit.length); - for (int i = 0; i < values.size(); i++) { - assertEquals( - apiClient.escapeString(apiClient.parameterToString(values.get(i))), - pairValueSplit[i]); - } - } - } - - @Test - public void testSanitizeFilename() { - assertEquals("sun", apiClient.sanitizeFilename("sun")); - assertEquals("sun.gif", apiClient.sanitizeFilename("sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("../sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("/var/tmp/sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("./sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("..\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("\\var\\tmp\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("c:\\var\\tmp\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif")); - } - - @Test - public void testNewHttpClient() { - OkHttpClient oldClient = apiClient.getHttpClient(); - apiClient.setHttpClient(oldClient.newBuilder().build()); - assertThat(apiClient.getHttpClient(), is(not(oldClient))); - } - - /** Tests the invariant that the HttpClient for the ApiClient must never be null */ - @Test(expected = NullPointerException.class) - public void testNullHttpClient() { - apiClient.setHttpClient(null); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ConfigurationTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ConfigurationTest.java deleted file mode 100644 index 3d6ab82bd3e6..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ConfigurationTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.openapitools.client; - -import static org.junit.Assert.*; - -import org.junit.*; - -public class ConfigurationTest { - @Test - public void testDefaultApiClient() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - assertNotNull(apiClient); - assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); - assertFalse(apiClient.isDebugging()); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java deleted file mode 100644 index 9d56087899b3..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ /dev/null @@ -1,450 +0,0 @@ -package org.openapitools.client; - -import static org.junit.Assert.*; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.reflect.TypeToken; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.charset.StandardCharsets; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.Locale; -import java.util.TimeZone; -import okio.ByteString; -import org.junit.*; -import org.openapitools.client.model.Order; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.format.DateTimeFormatter; - -import org.openapitools.client.model.*; - -public class JSONTest { - private ApiClient apiClient = null; - private JSON json = null; - private Order order = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - json = apiClient.getJSON(); - order = new Order(); - } - - @Test - public void testSqlDateTypeAdapter() { - final String str = "\"2015-11-07\""; - final java.sql.Date date = java.sql.Date.valueOf("2015-11-07"); - - assertEquals(str, json.serialize(date)); - assertEquals(json.deserialize(str, java.sql.Date.class), date); - assertEquals( - json.deserialize( - "\"2015-11-07T03:49:09.356" + getCurrentTimezoneOffset() + "\"", - java.sql.Date.class) - .toString(), - date.toString()); - - // custom date format: without day - DateFormat format = new SimpleDateFormat("yyyy-MM", Locale.ROOT); - apiClient.setSqlDateFormat(format); - String dateStr = "\"2015-11\""; - assertEquals( - dateStr, - json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11\"", java.sql.Date.class))); - } - - @Test - public void testDateTypeAdapter() { - Calendar cal = new GregorianCalendar(2015, 10, 7, 3, 49, 9); - cal.setTimeZone(TimeZone.getTimeZone("UTC")); - - assertEquals(json.deserialize("\"2015-11-07T05:49:09+02\"", Date.class), cal.getTime()); - - cal.set(Calendar.MILLISECOND, 300); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.3Z\"", Date.class), cal.getTime()); - - cal.set(Calendar.MILLISECOND, 356); - Date date = cal.getTime(); - - final String utcDate = "\"2015-11-07T03:49:09.356Z\""; - assertEquals(json.deserialize(utcDate, Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T05:49:09.356+02:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-01:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356Z\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-0100\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356456789Z\"", Date.class), date); - - assertEquals(utcDate, json.serialize(date)); - - // custom datetime format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - - String dateStr = "\"2015-11-07T13:49:09+10:00\""; - assertEquals( - dateStr, - json.serialize(json.deserialize("\"2015-11-07T03:49:09+00:00\"", Date.class))); - assertEquals( - dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", Date.class))); - assertEquals( - dateStr, - json.serialize(json.deserialize("\"2015-11-07T00:49:09-03:00\"", Date.class))); - - try { - // invalid time zone format - json.deserialize("\"2015-11-07T03:49:09+00\"", Date.class); - fail("json parsing should fail"); - } catch (RuntimeException e) { - // OK - } - try { - // unexpected miliseconds - json.deserialize("\"2015-11-07T03:49:09.000Z\"", Date.class); - fail("json parsing should fail"); - } catch (RuntimeException e) { - // OK - } - } - - @Test - public void testOffsetDateTimeTypeAdapter() { - final String str = "\"2016-09-09T08:02:03.123-03:00\""; - OffsetDateTime date = - OffsetDateTime.of(2016, 9, 9, 8, 2, 3, 123000000, ZoneOffset.of("-3")); - - assertEquals(str, json.serialize(date)); - // Use toString() instead of isEqual to verify that the offset is preserved - assertEquals(json.deserialize(str, OffsetDateTime.class).toString(), date.toString()); - } - - @Test - public void testLocalDateTypeAdapter() { - final String str = "\"2016-09-09\""; - final LocalDate date = LocalDate.of(2016, 9, 9); - - assertEquals(str, json.serialize(date)); - assertEquals(json.deserialize(str, LocalDate.class), date); - } - - @Test - public void testDefaultDate() throws Exception { - final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - final String dateStr = "2015-11-07T14:11:05.267Z"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.serialize(order); - Type type = new TypeToken() {}.getType(); - Order o = json.deserialize(str, type); - assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); - } - - @Test - public void testCustomDate() throws Exception { - final DateTimeFormatter datetimeFormat = - DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); - final String dateStr = "2015-11-07T14:11:05-02:00"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.serialize(order); - Type type = new TypeToken() {}.getType(); - Order o = json.deserialize(str, type); - assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); - } - - @Test - public void testByteArrayTypeAdapterSerialization() { - // Arrange - final String expectedBytesAsString = "Let's pretend this a jpg or something"; - final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); - - // Act - String serializedBytesWithQuotes = json.serialize(expectedBytes); - - // Assert - String serializedBytes = - serializedBytesWithQuotes.substring(1, serializedBytesWithQuotes.length() - 1); - if (json.getGson().htmlSafe()) { - serializedBytes = serializedBytes.replaceAll("\\\\u003d", "="); - } - ByteString actualAsByteString = ByteString.decodeBase64(serializedBytes); - byte[] actualBytes = actualAsByteString.toByteArray(); - assertEquals(expectedBytesAsString, new String(actualBytes, StandardCharsets.UTF_8)); - } - - @Test - public void testByteArrayTypeAdapterDeserialization() { - // Arrange - final String expectedBytesAsString = "Let's pretend this a jpg or something"; - final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); - final ByteString expectedByteString = ByteString.of(expectedBytes); - final String serializedBytes = expectedByteString.base64(); - final String serializedBytesWithQuotes = "\"" + serializedBytes + "\""; - Type type = new TypeToken() {}.getType(); - - // Act - byte[] actualDeserializedBytes = json.deserialize(serializedBytesWithQuotes, type); - - // Assert - assertEquals( - expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8)); - } - - @Test(expected = IllegalArgumentException.class) - public void testRequiredFieldException() { - // test json string missing required field(s) to ensure exception is thrown - Gson gson = json.getGson(); - //Gson gson = new GsonBuilder() - // .registerTypeAdapter(Pet.class, new Pet.CustomDeserializer()) - // .create(); - String json = "{\"id\": 5847, \"name\":\"tag test 1\"}"; // missing photoUrls (required field) - //String json = "{\"id2\": 5847, \"name\":\"tag test 1\"}"; - //String json = "{\"id\": 5847}"; - Pet p = gson.fromJson(json, Pet.class); - } - - @Test(expected = IllegalArgumentException.class) - public void testAdditionalFieldException() { - // test json string with additional field(s) to ensure exception is thrown - Gson gson = json.getGson(); - //Gson gson = new GsonBuilder() - // .registerTypeAdapter(Tag.class, new Tag.CustomDeserializer()) - // .create(); - String json = "{\"id\": 5847, \"name\":\"tag test 1\", \"new-field\": true}"; - Tag t = gson.fromJson(json, Tag.class); - } - - @Test - public void testCustomDeserializer() { - // test the custom deserializer to ensure it can deserialize json payload into objects - Gson gson = json.getGson(); - //Gson gson = new GsonBuilder() - // .registerTypeAdapter(Tag.class, new Tag.CustomDeserializer()) - // .create(); - // id and name - String json = "{\"id\": 5847, \"name\":\"tag test 1\"}"; - Tag t = gson.fromJson(json, Tag.class); - assertEquals(t.getName(), "tag test 1"); - assertEquals(t.getId(), Long.valueOf(5847L)); - - // name only - String json2 = "{\"name\":\"tag test 1\"}"; - Tag t2 = gson.fromJson(json2, Tag.class); - assertEquals(t2.getName(), "tag test 1"); - assertEquals(t2.getId(), null); - - // with all required fields - String json3 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; - Pet t3 = gson.fromJson(json3, Pet.class); - assertEquals(t3.getName(), "pet test 1"); - assertEquals(t3.getId(), Long.valueOf(5847)); - - // with all required fields and tags (optional) - String json4 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"id\":\"tag 123\"}]}"; - Pet t4 = gson.fromJson(json3, Pet.class); - assertEquals(t4.getName(), "pet test 1"); - assertEquals(t4.getId(), Long.valueOf(5847)); - - // test Tag - String json5 = "{\"unknown_field\": 543, \"id\":\"tag 123\"}"; - Exception exception5 = assertThrows(java.lang.IllegalArgumentException.class, () -> { - Tag t5 = gson.fromJson(json5, Tag.class); - }); - assertTrue(exception5.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); - - // test Pet with invalid tags - String json6 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"unknown_field\": 543, \"id\":\"tag 123\"}]}"; - Exception exception6 = assertThrows(java.lang.IllegalArgumentException.class, () -> { - Pet t6 = gson.fromJson(json6, Pet.class); - }); - assertTrue(exception6.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); - - // test Pet with invalid tags (required) - String json7 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"unknown_field\": 543, \"id\":\"tag 123\"}]}"; - Exception exception7 = assertThrows(java.lang.IllegalArgumentException.class, () -> { - PetWithRequiredTags t7 = gson.fromJson(json7, PetWithRequiredTags.class); - }); - assertTrue(exception7.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); - - // test Pet with invalid tags (missing reqired) - String json8 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; - Exception exception8 = assertThrows(java.lang.IllegalArgumentException.class, () -> { - PetWithRequiredTags t8 = gson.fromJson(json8, PetWithRequiredTags.class); - }); - assertTrue(exception8.getMessage().contains("The required field `tags` is not found in the JSON string: {\"id\":5847,\"name\":\"pet test 1\",\"photoUrls\":[\"https://a.com\",\"https://b.com\"]}")); - - - } - - /** Model tests for Pet */ - @Test - public void testPet() { - // test Pet - Pet model = new Pet(); - model.setId(1029L); - model.setName("Dog"); - - Pet model2 = new Pet(); - model2.setId(1029L); - model2.setName("Dog"); - - Assert.assertTrue(model.equals(model2)); - } - - // Obtained 22JAN2018 from stackoverflow answer by PuguaSoft - // https://stackoverflow.com/questions/11399491/java-timezone-offset - // Direct link https://stackoverflow.com/a/16680815/3166133 - public static String getCurrentTimezoneOffset() { - - TimeZone tz = TimeZone.getDefault(); - Calendar cal = GregorianCalendar.getInstance(tz, Locale.ROOT); - int offsetInMillis = tz.getOffset(cal.getTimeInMillis()); - - String offset = - String.format( - Locale.ROOT, - "%02d:%02d", - Math.abs(offsetInMillis / 3600000), - Math.abs((offsetInMillis / 60000) % 60)); - offset = (offsetInMillis >= 0 ? "+" : "-") + offset; - - return offset; - } - - /** - * Validate an anyOf schema can be deserialized into the expected class. - * The anyOf schema does not have a discriminator. - */ - @Test - public void testAnyOfSchemaWithoutDiscriminator() throws Exception { - { - String str = "{ \"cultivar\": \"golden delicious\", \"origin\": \"japan\" }"; - - // make sure deserialization works for pojo object - Apple a = json.getGson().fromJson(str, Apple.class); - assertEquals(a.getCultivar(), "golden delicious"); - assertEquals(a.getOrigin(), "japan"); - - GmFruit o = json.getGson().fromJson(str, GmFruit.class); - assertTrue(o.getActualInstance() instanceof Apple); - Apple inst = (Apple) o.getActualInstance(); - assertEquals(inst.getCultivar(), "golden delicious"); - assertEquals(inst.getOrigin(), "japan"); - assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); - assertEquals(inst.toJson(), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); - assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); - assertEquals(o.toJson(), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); - - String str2 = "{ \"origin_typo\": \"japan\" }"; - // no match - Exception exception = assertThrows(java.lang.IllegalArgumentException.class, () -> { - Apple o3 = json.getGson().fromJson(str2, Apple.class); - }); - - // no match - Exception exception3 = assertThrows(java.lang.IllegalArgumentException.class, () -> { - Banana o2 = json.getGson().fromJson(str2, Banana.class); - }); - - // no match - Exception exception4 = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { - GmFruit o2 = json.getGson().fromJson(str2, GmFruit.class); - }); - } - } - - /** - * Validate a oneOf schema can be deserialized into the expected class. - * The oneOf schema does not have a discriminator. - */ - @Test - public void testOneOfSchemaWithoutDiscriminator() throws Exception { - // BananaReq and AppleReq have explicitly defined properties that are different by name. - // There is no discriminator property. - { - String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false }"; - - // make sure deserialization works for pojo object - AppleReq a = json.getGson().fromJson(str, AppleReq.class); - assertEquals(a.getCultivar(), "golden delicious"); - assertEquals(a.getMealy(), false); - - FruitReq o = json.getGson().fromJson(str, FruitReq.class); - assertTrue(o.getActualInstance() instanceof AppleReq); - AppleReq inst = (AppleReq) o.getActualInstance(); - assertEquals(inst.getCultivar(), "golden delicious"); - assertEquals(inst.getMealy(), false); - assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); - assertEquals(inst.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); - assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); - assertEquals(o.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); - - AppleReq inst2 = o.getAppleReq(); - assertEquals(inst2.getCultivar(), "golden delicious"); - assertEquals(inst2.getMealy(), false); - assertEquals(json.getGson().toJson(inst2), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); - assertEquals(inst2.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); - - // test fromJson - FruitReq o3 = FruitReq.fromJson(str); - assertTrue(o3.getActualInstance() instanceof AppleReq); - AppleReq inst3 = (AppleReq) o3.getActualInstance(); - assertEquals(inst3.getCultivar(), "golden delicious"); - assertEquals(inst3.getMealy(), false); - assertEquals(json.getGson().toJson(inst3), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); - assertEquals(inst3.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); - assertEquals(o3.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); - } - { - // test to ensure the oneOf object can be serialized to "null" correctly - FruitReq o = new FruitReq(); - assertEquals(o.getActualInstance(), null); - assertEquals(json.getGson().toJson(o), "null"); - assertEquals(o.toJson(), "null"); - assertEquals(json.getGson().toJson(null), "null"); - } - { - // Same test, but this time with additional (undeclared) properties. - // Since FruitReq has additionalProperties: false, deserialization should fail. - String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false, \"garbage_prop\": \"abc\" }"; - Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { - FruitReq o = json.getGson().fromJson(str, FruitReq.class); - }); - assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result, expected 1. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}")); - } - { - String str = "{ \"lengthCm\": 17 }"; - - // make sure deserialization works for pojo object - BananaReq b = json.getGson().fromJson(str, BananaReq.class); - assertEquals(b.getLengthCm(), new java.math.BigDecimal(17)); - - FruitReq o = json.getGson().fromJson(str, FruitReq.class); - assertTrue(o.getActualInstance() instanceof BananaReq); - BananaReq inst = (BananaReq) o.getActualInstance(); - assertEquals(inst.getLengthCm(), new java.math.BigDecimal(17)); - assertEquals(json.getGson().toJson(o), "{\"lengthCm\":17}"); - assertEquals(json.getGson().toJson(inst), "{\"lengthCm\":17}"); - } - { - // Try to deserialize empty object. This should fail 'oneOf' because none will match - // AppleReq or BananaReq. - String str = "{ }"; - Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { - json.getGson().fromJson(str, FruitReq.class); - }); - assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result, expected 1")); - } - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/StringUtilTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/StringUtilTest.java deleted file mode 100644 index f6b87fbaaa12..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/StringUtilTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client; - -import static org.junit.Assert.*; - -import org.junit.*; - -public class StringUtilTest { - @Test - public void testContainsIgnoreCase() { - assertTrue(StringUtil.containsIgnoreCase(new String[] {"abc"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[] {"abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[] {"ABC"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[] {null, "abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[] {null, "abc"}, null)); - - assertFalse(StringUtil.containsIgnoreCase(new String[] {"abc"}, "def")); - assertFalse(StringUtil.containsIgnoreCase(new String[] {}, "ABC")); - assertFalse(StringUtil.containsIgnoreCase(new String[] {}, null)); - } - - @Test - public void testJoin() { - String[] array = {"aa", "bb", "cc"}; - assertEquals("aa,bb,cc", StringUtil.join(array, ",")); - assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); - assertEquals("aabbcc", StringUtil.join(array, "")); - assertEquals("aa bb cc", StringUtil.join(array, " ")); - assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); - - assertEquals("", StringUtil.join(new String[] {}, ",")); - assertEquals("abc", StringUtil.join(new String[] {"abc"}, ",")); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java deleted file mode 100644 index af8a9594410c..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.api; - - -import org.junit.Ignore; -import org.junit.Test; -import org.openapitools.client.ApiException; -import org.openapitools.client.model.Client; - -/** API tests for AnotherFakeApi */ -@Ignore -public class AnotherFakeApiTest { - - private final AnotherFakeApi api = new AnotherFakeApi(); - - /** - * To test special tags - * - *

    To test special tags and operation ID starting with number - * - * @throws ApiException if the Api call fails - */ - @Test - public void call123testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.call123testSpecialTags(body); - - // TODO: test validations - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java deleted file mode 100644 index 471887d2611e..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ /dev/null @@ -1,286 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.api; - -import org.openapitools.client.ApiException; -import java.math.BigDecimal; -import org.openapitools.client.model.Client; -import java.io.File; -import org.openapitools.client.model.HealthCheckResult; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.openapitools.client.model.OuterComposite; -import org.openapitools.client.model.OuterEnum; -import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FakeApi - */ -@Ignore -public class FakeApiTest { - - private final FakeApi api = new FakeApi(); - - - /** - * Health check endpoint - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeHealthGetTest() throws ApiException { - HealthCheckResult response = api.fakeHealthGet(); - // TODO: test validations - } - - /** - * - * - * Test serialization of outer boolean types - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterBooleanSerializeTest() throws ApiException { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); - // TODO: test validations - } - - /** - * - * - * Test serialization of object with outer number type - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterCompositeSerializeTest() throws ApiException { - OuterComposite outerComposite = null; - OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); - // TODO: test validations - } - - /** - * - * - * Test serialization of outer number types - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterNumberSerializeTest() throws ApiException { - BigDecimal body = null; - BigDecimal response = api.fakeOuterNumberSerialize(body); - // TODO: test validations - } - - /** - * - * - * Test serialization of outer string types - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterStringSerializeTest() throws ApiException { - String body = null; - String response = api.fakeOuterStringSerialize(body); - // TODO: test validations - } - - /** - * Array of Enums - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getArrayOfEnumsTest() throws ApiException { - List response = api.getArrayOfEnums(); - // TODO: test validations - } - - /** - * - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testBodyWithQueryParamsTest() throws ApiException { - String query = null; - User user = null; - api.testBodyWithQueryParams(query, user); - // TODO: test validations - } - - /** - * To test \"client\" model - * - * To test \"client\" model - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testClientModelTest() throws ApiException { - Client client = null; - Client response = api.testClientModel(client); - // TODO: test validations - } - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testEndpointParametersTest() throws ApiException { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - File binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - // TODO: test validations - } - - /** - * To test enum parameters - * - * To test enum parameters - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testEnumParametersTest() throws ApiException { - List enumHeaderStringArray = null; - String enumHeaderString = null; - List enumQueryStringArray = null; - String enumQueryString = null; - Integer enumQueryInteger = null; - Double enumQueryDouble = null; - List enumFormStringArray = null; - String enumFormString = null; - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - // TODO: test validations - } - - /** - * Fake endpoint to test group parameters (optional) - * - * Fake endpoint to test group parameters (optional) - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testGroupParametersTest() throws ApiException { - Integer requiredStringGroup = null; - Boolean requiredBooleanGroup = null; - Long requiredInt64Group = null; - Integer stringGroup = null; - Boolean booleanGroup = null; - Long int64Group = null; - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) - .stringGroup(stringGroup) - .booleanGroup(booleanGroup) - .int64Group(int64Group) - .execute(); - // TODO: test validations - } - - /** - * test inline additionalProperties - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testInlineAdditionalPropertiesTest() throws ApiException { - Map requestBody = null; - api.testInlineAdditionalProperties(requestBody); - // TODO: test validations - } - - /** - * test json serialization of form data - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testJsonFormDataTest() throws ApiException { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2); - // TODO: test validations - } - - /** - * - * - * To test the collection format in query parameters - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testQueryParameterCollectionFormatTest() throws ApiException { - List pipe = null; - List ioutil = null; - List http = null; - List url = null; - List context = null; - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - // TODO: test validations - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java deleted file mode 100644 index 16b1c5afa719..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.api; - - -import org.junit.Ignore; -import org.junit.Test; -import org.openapitools.client.ApiException; -import org.openapitools.client.model.Client; - -/** API tests for FakeClassnameTags123Api */ -@Ignore -public class FakeClassnameTags123ApiTest { - - private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); - - /** - * To test class name in snake case - * - *

    To test class name in snake case - * - * @throws ApiException if the Api call fails - */ - @Test - public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); - - // TODO: test validations - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/PetApiTest.java deleted file mode 100644 index a4e3dcec14c2..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/PetApiTest.java +++ /dev/null @@ -1,575 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.api; - -import static org.junit.Assert.*; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.TimeUnit; -import org.junit.*; -import org.openapitools.client.*; -import org.openapitools.client.ApiException; -import org.openapitools.client.auth.*; -import org.openapitools.client.model.*; -import org.openapitools.client.model.Pet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** API tests for PetApi */ -public class PetApiTest { - - private PetApi api = new PetApi(); - private final Logger LOG = LoggerFactory.getLogger(PetApiTest.class); - // In the circle.yml file, /etc/host is configured with an entry to resolve petstore.swagger.io - // to 127.0.0.1 - private static String basePath = "http://petstore.swagger.io:80/v2"; - - @Before - public void setup() { - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - api.getApiClient().setBasePath(basePath); - } - - @Test - public void testApiClient() { - // the default api client is used - assertEquals(Configuration.getDefaultApiClient(), api.getApiClient()); - assertNotNull(api.getApiClient()); - assertEquals(basePath, api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - - ApiClient oldClient = api.getApiClient(); - - ApiClient newClient = new ApiClient(); - newClient.setVerifyingSsl(true); - newClient.setBasePath("http://example.com"); - newClient.setDebugging(true); - - // set api client via constructor - api = new PetApi(newClient); - assertNotNull(api.getApiClient()); - assertEquals("http://example.com", api.getApiClient().getBasePath()); - assertTrue(api.getApiClient().isDebugging()); - - // set api client via setter method - api.setApiClient(oldClient); - assertNotNull(api.getApiClient()); - assertEquals(basePath, api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - } - - @Test - public void testCreateAndGetPet() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - assertPetMatches(pet, fetched); - api.deletePet(pet.getId(), null); - } - - @Test - public void testCreateAndGetPetWithHttpInfo() throws Exception { - Pet pet = createPet(); - api.addPetWithHttpInfo(pet); - - ApiResponse resp = api.getPetByIdWithHttpInfo(pet.getId()); - assertEquals(200, resp.getStatusCode()); - assertEquals("application/json", resp.getHeaders().get("Content-Type").get(0)); - Pet fetched = resp.getData(); - - assertPetMatches(pet, fetched); - api.deletePet(pet.getId(), null); - } - - @Test - public void testCreateAndGetPetAsync() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - // to store returned Pet or error message/exception - final Map result = new HashMap(); - - api.getPetByIdAsync( - pet.getId(), - new ApiCallback() { - @Override - public void onFailure( - ApiException e, - int statusCode, - Map> responseHeaders) { - result.put("error", e.getMessage()); - } - - @Override - public void onSuccess( - Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } - - @Override - public void onUploadProgress( - long bytesWritten, long contentLength, boolean done) { - // empty - } - - @Override - public void onDownloadProgress( - long bytesRead, long contentLength, boolean done) { - // empty - } - }); - - // wait for the asynchronous call to finish (at most 10 seconds) - final int maxTry = 10; - int tryCount = 1; - Pet fetched = null; - do { - if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); - Thread.sleep(1000); - tryCount += 1; - if (result.get("error") != null) fail((String) result.get("error")); - if (result.get("pet") != null) { - fetched = (Pet) result.get("pet"); - break; - } - } while (result.isEmpty()); - assertPetMatches(pet, fetched); - api.deletePet(pet.getId(), null); - } - - @Test - public void testCreateAndGetPetAsyncInvalidID() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - // to store returned Pet or error message/exception - final Map result = new HashMap(); - - // test getting a nonexistent pet - result.clear(); - api.getPetByIdAsync( - -10000L, - new ApiCallback() { - @Override - public void onFailure( - ApiException e, - int statusCode, - Map> responseHeaders) { - result.put("exception", e); - } - - @Override - public void onSuccess( - Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } - - @Override - public void onUploadProgress( - long bytesWritten, long contentLength, boolean done) { - // empty - } - - @Override - public void onDownloadProgress( - long bytesRead, long contentLength, boolean done) { - // empty - } - }); - - // wait for the asynchronous call to finish (at most 10 seconds) - final int maxTry = 10; - int tryCount = 1; - Pet fetched = null; - ApiException exception = null; - - do { - if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); - Thread.sleep(1000); - tryCount += 1; - if (result.get("pet") != null) fail("expected an error"); - if (result.get("exception") != null) { - exception = (ApiException) result.get("exception"); - break; - } - } while (result.isEmpty()); - assertNotNull(exception); - assertEquals(404, exception.getCode()); - assertEquals("Not Found", exception.getMessage()); - assertEquals("application/json", exception.getResponseHeaders().get("Content-Type").get(0)); - api.deletePet(pet.getId(), null); - } - - @Test - public void testCreateAndGetMultiplePetsAsync() throws Exception { - Pet pet1 = createPet(); - Pet pet2 = createPet(); - - final CountDownLatch addLatch = new CountDownLatch(2); - final TestApiCallback addCallback1 = new TestApiCallback(addLatch); - final TestApiCallback addCallback2 = new TestApiCallback(addLatch); - - // Make 2 simultaneous calls - api.addPetAsync(pet1, addCallback1); - api.addPetAsync(pet2, addCallback2); - - // wait for both asynchronous calls to finish (at most 10 seconds) - assertTrue(addLatch.await(10, TimeUnit.SECONDS)); - - assertTrue(addCallback1.isDone()); - assertTrue(addCallback2.isDone()); - - if (!addCallback1.isSuccess()) throw addCallback1.getException(); - if (!addCallback2.isSuccess()) throw addCallback2.getException(); - - assertValidProgress(addCallback1.getUploadProgress()); - assertValidProgress(addCallback2.getUploadProgress()); - - final CountDownLatch getLatch = new CountDownLatch(3); - final TestApiCallback getCallback1 = new TestApiCallback(getLatch); - final TestApiCallback getCallback2 = new TestApiCallback(getLatch); - final TestApiCallback getCallback3 = new TestApiCallback(getLatch); - - api.getPetByIdAsync(pet1.getId(), getCallback1); - api.getPetByIdAsync(pet2.getId(), getCallback2); - // Get nonexistent pet - api.getPetByIdAsync(-10000L, getCallback3); - - // wait for all asynchronous calls to finish (at most 10 seconds) - assertTrue(getLatch.await(10, TimeUnit.SECONDS)); - - assertTrue(getCallback1.isDone()); - assertTrue(getCallback2.isDone()); - assertTrue(getCallback3.isDone()); - - if (!getCallback1.isSuccess()) throw getCallback1.getException(); - if (!getCallback2.isSuccess()) throw getCallback2.getException(); - - assertPetMatches(pet1, getCallback1.getResult()); - assertPetMatches(pet2, getCallback2.getResult()); - - assertValidProgress(getCallback1.getDownloadProgress()); - assertValidProgress(getCallback2.getDownloadProgress()); - - // Last callback should fail with ApiException - assertFalse(getCallback3.isSuccess()); - final ApiException exception = getCallback3.getException(); - assertNotNull(exception); - assertEquals(404, exception.getCode()); - api.deletePet(pet1.getId(), null); - api.deletePet(pet2.getId(), null); - } - - @Test - public void testUpdatePet() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - pet.setName("programmer"); - - api.updatePet(pet); - - Pet fetched = api.getPetById(pet.getId()); - assertPetMatches(pet, fetched); - api.deletePet(pet.getId(), null); - } - - @Test - public void testFindPetsByStatus() throws Exception { - assertEquals(basePath, api.getApiClient().getBasePath()); - Pet pet = createPet(); - api.addPet(pet); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.PENDING); - api.updatePet(pet); - - List pets = api.findPetsByStatus(Arrays.asList("pending")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); - - api.deletePet(pet.getId(), null); - } - - @Test - @Ignore - public void testFindPetsByTags() throws Exception { - Pet pet = createPet(); - pet.setName("monster"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - - List tags = new ArrayList(); - Tag tag1 = new Tag(); - tag1.setName("friendly"); - tags.add(tag1); - pet.setTags(tags); - - api.updatePet(pet); - - List pets = api.findPetsByTags((Arrays.asList("friendly"))); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); - - api.deletePet(pet.getId(), null); - } - - @Test - public void testUpdatePetWithForm() throws Exception { - Pet pet = createPet(); - pet.setName("frank"); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - - api.updatePetWithForm(fetched.getId(), "furt", null); - Pet updated = api.getPetById(fetched.getId()); - - assertEquals(updated.getName(), "furt"); - api.deletePet(pet.getId(), null); - } - - @Test - @Ignore - public void testDeletePet() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - api.deletePet(pet.getId(), null); - - try { - fetched = api.getPetById(fetched.getId()); - fail("expected an error"); - } catch (ApiException e) { - LOG.info("Code: {}. Message: {}", e.getCode(), e.getMessage()); - assertEquals(404, e.getCode()); - } - } - - @Test - public void testUploadFile() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath())); - api.deletePet(pet.getId(), null); - } - - @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - - pet2.setName("really-happy"); - pet2.setPhotoUrls( - (Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls( - (Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - } - - private Pet createPet() { - Pet pet = new Pet(); - pet.setId(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = - (Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - pet.setPhotoUrls(photos); - - return pet; - } - - private String serializeJson(Object o, ApiClient apiClient) { - return apiClient.getJSON().serialize(o); - } - - private T deserializeJson(String json, Type type, ApiClient apiClient) { - return (T) apiClient.getJSON().deserialize(json, type); - } - - private void assertPetMatches(Pet expected, Pet actual) { - assertNotNull(actual); - assertEquals(expected.getId(), actual.getId()); - assertNotNull(actual.getCategory()); - assertEquals(expected.getCategory().getName(), actual.getCategory().getName()); - } - - /** - * Assert that the given upload/download progress list satisfies the following constraints: - * - *

    - List is not empty - Byte count should be nondecreasing - The last element, and only the - * last element, should have done=true - */ - private void assertValidProgress(List progressList) { - assertFalse(progressList.isEmpty()); - - Progress prev = null; - int index = 0; - for (Progress progress : progressList) { - if (prev != null) { - if (prev.done || prev.bytes > progress.bytes) { - fail("Progress list out of order at index " + index + ": " + progressList); - } - } - prev = progress; - index += 1; - } - - if (!prev.done) { - fail("Last progress item should have done=true: " + progressList); - } - } - - private static class TestApiCallback implements ApiCallback { - - private final CountDownLatch latch; - private final ConcurrentLinkedQueue uploadProgress = - new ConcurrentLinkedQueue(); - private final ConcurrentLinkedQueue downloadProgress = - new ConcurrentLinkedQueue(); - - private boolean done; - private boolean success; - private ApiException exception; - private T result; - - public TestApiCallback(CountDownLatch latch) { - this.latch = latch; - this.done = false; - } - - @Override - public void onFailure( - ApiException e, int statusCode, Map> responseHeaders) { - exception = e; - this.done = true; - this.success = false; - latch.countDown(); - } - - @Override - public void onSuccess(T result, int statusCode, Map> responseHeaders) { - this.result = result; - this.done = true; - this.success = true; - latch.countDown(); - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - uploadProgress.add(new Progress(bytesWritten, contentLength, done)); - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - downloadProgress.add(new Progress(bytesRead, contentLength, done)); - } - - public boolean isDone() { - return done; - } - - public boolean isSuccess() { - return success; - } - - public ApiException getException() { - return exception; - } - - public T getResult() { - return result; - } - - public List getUploadProgress() { - return new ArrayList(uploadProgress); - } - - public List getDownloadProgress() { - return new ArrayList(downloadProgress); - } - } - - private static class Progress { - public final long bytes; - public final long contentLength; - public final boolean done; - - public Progress(long bytes, long contentLength, boolean done) { - this.bytes = bytes; - this.contentLength = contentLength; - this.done = done; - } - - @Override - public String toString() { - return ""; - } - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/StoreApiTest.java deleted file mode 100644 index 41c551458ed8..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.api; - - -import java.util.Map; -import org.junit.Ignore; -import org.junit.Test; -import org.openapitools.client.ApiException; -import org.openapitools.client.model.Order; - -/** API tests for StoreApi */ -@Ignore -public class StoreApiTest { - - private final StoreApi api = new StoreApi(); - - /** - * Delete purchase order by ID - * - *

    For valid response try integer IDs with value < 1000. Anything above 1000 or - * nonintegers will generate API errors - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteOrderTest() throws ApiException { - String orderId = null; - api.deleteOrder(orderId); - - // TODO: test validations - } - - /** - * Returns pet inventories by status - * - *

    Returns a map of status codes to quantities - * - * @throws ApiException if the Api call fails - */ - @Test - public void getInventoryTest() throws ApiException { - Map response = api.getInventory(); - - // TODO: test validations - } - - /** - * Find purchase order by ID - * - *

    For valid response try integer IDs with value <= 5 or > 10. Other values will - * generated exceptions - * - * @throws ApiException if the Api call fails - */ - @Test - public void getOrderByIdTest() throws ApiException { - Long orderId = null; - Order response = api.getOrderById(orderId); - - // TODO: test validations - } - - /** - * Place an order for a pet - * - * @throws ApiException if the Api call fails - */ - @Test - public void placeOrderTest() throws ApiException { - Order body = null; - Order response = api.placeOrder(body); - - // TODO: test validations - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/UserApiTest.java deleted file mode 100644 index 364b90cab318..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/UserApiTest.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.api; - - -import java.util.List; -import org.junit.Ignore; -import org.junit.Test; -import org.openapitools.client.ApiException; -import org.openapitools.client.model.User; - -/** API tests for UserApi */ -@Ignore -public class UserApiTest { - - private final UserApi api = new UserApi(); - - /** - * Create user - * - *

    This can only be done by the logged in user. - * - * @throws ApiException if the Api call fails - */ - @Test - public void createUserTest() throws ApiException { - User body = null; - api.createUser(body); - - // TODO: test validations - } - - /** - * Creates list of users with given input array - * - * @throws ApiException if the Api call fails - */ - @Test - public void createUsersWithArrayInputTest() throws ApiException { - List body = null; - api.createUsersWithArrayInput(body); - - // TODO: test validations - } - - /** - * Creates list of users with given input array - * - * @throws ApiException if the Api call fails - */ - @Test - public void createUsersWithListInputTest() throws ApiException { - List body = null; - api.createUsersWithListInput(body); - - // TODO: test validations - } - - /** - * Delete user - * - *

    This can only be done by the logged in user. - * - * @throws ApiException if the Api call fails - */ - @Test - public void deleteUserTest() throws ApiException { - String username = null; - api.deleteUser(username); - - // TODO: test validations - } - - /** - * Get user by user name - * - * @throws ApiException if the Api call fails - */ - @Test - public void getUserByNameTest() throws ApiException { - String username = null; - User response = api.getUserByName(username); - - // TODO: test validations - } - - /** - * Logs user into the system - * - * @throws ApiException if the Api call fails - */ - @Test - public void loginUserTest() throws ApiException { - String username = null; - String password = null; - String response = api.loginUser(username, password); - - // TODO: test validations - } - - /** - * Logs out current logged in user session - * - * @throws ApiException if the Api call fails - */ - @Test - public void logoutUserTest() throws ApiException { - api.logoutUser(); - - // TODO: test validations - } - - /** - * Updated user - * - *

    This can only be done by the logged in user. - * - * @throws ApiException if the Api call fails - */ - @Test - public void updateUserTest() throws ApiException { - String username = null; - User body = null; - api.updateUser(username, body); - - // TODO: test validations - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java deleted file mode 100644 index f7c2ecec9e1e..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.client.auth; - -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.*; -import org.openapitools.client.ApiException; -import org.openapitools.client.Pair; - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - assertEquals(1, queryParams.size()); - for (Pair queryParam : queryParams) { - assertEquals("my-api-key", queryParam.getValue()); - } - - // no changes to header or cookie parameters - assertEquals(0, headerParams.size()); - assertEquals(0, cookieParams.size()); - } - - @Test - public void testApplyToParamsInQueryWithNullValue() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey(null); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - assertEquals(0, cookieParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - // no changes to query or cookie parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); - } - - @Test - public void testApplyToParamsInHeaderWithNullValue() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey(null); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInCookieWithPrefix() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - // no changes to query or header parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - assertEquals(1, cookieParams.size()); - assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN")); - } - - @Test - public void testApplyToParamsInCookieWithNullValue() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); - auth.setApiKey(null); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(0, headerParams.size()); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java deleted file mode 100644 index a077d394ada2..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.openapitools.client.auth; - -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.*; -import org.openapitools.client.ApiException; -import org.openapitools.client.Pair; - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - // no changes to query or cookie parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " - // prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization")); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization")); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization")); - - // null username and password should be ignored - queryParams = new ArrayList(); - headerParams = new HashMap(); - auth.setUsername(null); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java deleted file mode 100644 index 2d0d0743caf5..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.openapitools.client.auth; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.util.Collections; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import okhttp3.*; -import okhttp3.Interceptor.Chain; -import okhttp3.Response.Builder; -import org.apache.commons.lang3.reflect.FieldUtils; -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.junit.Before; -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -public class RetryingOAuthTest { - - private RetryingOAuth oauth; - - @Before - public void setUp() throws Exception { - oauth = - new RetryingOAuth( - "_clientId", - "_clientSecret", - OAuthFlow.ACCESS_CODE, - "https://token.example.com", - Collections.emptyMap()); - oauth.setAccessToken("expired-access-token"); - FieldUtils.writeField(oauth, "oAuthClient", mockOAuthClient(), true); - } - - @Test - public void testSingleRequestUnauthorized() throws Exception { - Response response = oauth.intercept(mockChain()); - assertEquals(HttpURLConnection.HTTP_OK, response.code()); - } - - @Test - public void testTwoConcurrentRequestsUnauthorized() throws Exception { - - Callable callable = - new Callable() { - @Override - public Response call() throws Exception { - return oauth.intercept(mockChain()); - } - }; - ExecutorService executor = Executors.newFixedThreadPool(2); - try { - Future response1 = executor.submit(callable); - Future response2 = executor.submit(callable); - - assertEquals(HttpURLConnection.HTTP_OK, response1.get().code()); - assertEquals(HttpURLConnection.HTTP_OK, response2.get().code()); - } finally { - executor.shutdown(); - } - } - - private OAuthClient mockOAuthClient() throws OAuthProblemException, OAuthSystemException { - OAuthJSONAccessTokenResponse response = mock(OAuthJSONAccessTokenResponse.class); - when(response.getAccessToken()) - .thenAnswer( - new Answer() { - @Override - public String answer(InvocationOnMock invocation) throws Throwable { - // sleep ensures that the bug is triggered. - Thread.sleep(1000); - return "new-access-token"; - } - }); - - OAuthClient client = mock(OAuthClient.class); - when(client.accessToken(any(OAuthClientRequest.class))).thenReturn(response); - return client; - } - - private Chain mockChain() throws IOException { - Chain chain = mock(Chain.class); - - final Request request = new Request.Builder().url("https://api.example.com").build(); - when(chain.request()).thenReturn(request); - - when(chain.proceed(any(Request.class))) - .thenAnswer( - new Answer() { - @Override - public Response answer(InvocationOnMock inv) { - Request r = inv.getArgument(0); - int responseCode = - "Bearer new-access-token".equals(r.header("Authorization")) - ? HttpURLConnection.HTTP_OK - : HttpURLConnection.HTTP_UNAUTHORIZED; - return new Builder() - .protocol(Protocol.HTTP_1_0) - .message("sup") - .request(request) - .body( - ResponseBody.create( - new byte[0], - MediaType.get("application/test"))) - .code(responseCode) - .build(); - } - }); - - return chain; - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java deleted file mode 100644 index ba387a41bf5d..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for AdditionalPropertiesClass - */ -public class AdditionalPropertiesClassTest { - private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); - - /** - * Model tests for AdditionalPropertiesClass - */ - @Test - public void testAdditionalPropertiesClass() { - // TODO: test AdditionalPropertiesClass - } - - /** - * Test the property 'mapProperty' - */ - @Test - public void mapPropertyTest() { - // TODO: test mapProperty - } - - /** - * Test the property 'mapOfMapProperty' - */ - @Test - public void mapOfMapPropertyTest() { - // TODO: test mapOfMapProperty - } - - /** - * Test the property 'anytype1' - */ - @Test - public void anytype1Test() { - // TODO: test anytype1 - } - - /** - * Test the property 'mapWithUndeclaredPropertiesAnytype1' - */ - @Test - public void mapWithUndeclaredPropertiesAnytype1Test() { - // TODO: test mapWithUndeclaredPropertiesAnytype1 - } - - /** - * Test the property 'mapWithUndeclaredPropertiesAnytype2' - */ - @Test - public void mapWithUndeclaredPropertiesAnytype2Test() { - // TODO: test mapWithUndeclaredPropertiesAnytype2 - } - - /** - * Test the property 'mapWithUndeclaredPropertiesAnytype3' - */ - @Test - public void mapWithUndeclaredPropertiesAnytype3Test() { - // TODO: test mapWithUndeclaredPropertiesAnytype3 - } - - /** - * Test the property 'emptyMap' - */ - @Test - public void emptyMapTest() { - // TODO: test emptyMap - } - - /** - * Test the property 'mapWithUndeclaredPropertiesString' - */ - @Test - public void mapWithUndeclaredPropertiesStringTest() { - // TODO: test mapWithUndeclaredPropertiesString - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AnimalTest.java deleted file mode 100644 index b11ec766286b..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AnimalTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Animal - */ -public class AnimalTest { - private final Animal model = new Animal(); - - /** - * Model tests for Animal - */ - @Test - public void testAnimal() { - // TODO: test Animal - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java deleted file mode 100644 index 9afc3397f46c..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for ArrayOfNumberOnly - */ -public class ArrayOfNumberOnlyTest { - private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); - - /** - * Model tests for ArrayOfNumberOnly - */ - @Test - public void testArrayOfNumberOnly() { - // TODO: test ArrayOfNumberOnly - } - - /** - * Test the property 'arrayNumber' - */ - @Test - public void arrayNumberTest() { - // TODO: test arrayNumber - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayTestTest.java deleted file mode 100644 index fab9a30565f3..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for ArrayTest - */ -public class ArrayTestTest { - private final ArrayTest model = new ArrayTest(); - - /** - * Model tests for ArrayTest - */ - @Test - public void testArrayTest() { - // TODO: test ArrayTest - } - - /** - * Test the property 'arrayOfString' - */ - @Test - public void arrayOfStringTest() { - // TODO: test arrayOfString - } - - /** - * Test the property 'arrayArrayOfInteger' - */ - @Test - public void arrayArrayOfIntegerTest() { - // TODO: test arrayArrayOfInteger - } - - /** - * Test the property 'arrayArrayOfModel' - */ - @Test - public void arrayArrayOfModelTest() { - // TODO: test arrayArrayOfModel - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CapitalizationTest.java deleted file mode 100644 index ced4f48eb5f9..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Capitalization - */ -public class CapitalizationTest { - private final Capitalization model = new Capitalization(); - - /** - * Model tests for Capitalization - */ - @Test - public void testCapitalization() { - // TODO: test Capitalization - } - - /** - * Test the property 'smallCamel' - */ - @Test - public void smallCamelTest() { - // TODO: test smallCamel - } - - /** - * Test the property 'capitalCamel' - */ - @Test - public void capitalCamelTest() { - // TODO: test capitalCamel - } - - /** - * Test the property 'smallSnake' - */ - @Test - public void smallSnakeTest() { - // TODO: test smallSnake - } - - /** - * Test the property 'capitalSnake' - */ - @Test - public void capitalSnakeTest() { - // TODO: test capitalSnake - } - - /** - * Test the property 'scAETHFlowPoints' - */ - @Test - public void scAETHFlowPointsTest() { - // TODO: test scAETHFlowPoints - } - - /** - * Test the property 'ATT_NAME' - */ - @Test - public void ATT_NAMETest() { - // TODO: test ATT_NAME - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatAllOfTest.java deleted file mode 100644 index 384ab21b773b..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatAllOfTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for CatAllOf - */ -public class CatAllOfTest { - private final CatAllOf model = new CatAllOf(); - - /** - * Model tests for CatAllOf - */ - @Test - public void testCatAllOf() { - // TODO: test CatAllOf - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatTest.java deleted file mode 100644 index b2b3e7e048d9..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.Animal; -import org.openapitools.client.model.CatAllOf; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Cat - */ -public class CatTest { - private final Cat model = new Cat(); - - /** - * Model tests for Cat - */ - @Test - public void testCat() { - // TODO: test Cat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CategoryTest.java deleted file mode 100644 index a6efa6e1fbc6..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CategoryTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Category - */ -public class CategoryTest { - private final Category model = new Category(); - - /** - * Model tests for Category - */ - @Test - public void testCategory() { - // TODO: test Category - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClassModelTest.java deleted file mode 100644 index 1233feec65ec..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for ClassModel - */ -public class ClassModelTest { - private final ClassModel model = new ClassModel(); - - /** - * Model tests for ClassModel - */ - @Test - public void testClassModel() { - // TODO: test ClassModel - } - - /** - * Test the property 'propertyClass' - */ - @Test - public void propertyClassTest() { - // TODO: test propertyClass - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClientTest.java deleted file mode 100644 index 456fab74c4d7..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClientTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Client - */ -public class ClientTest { - private final Client model = new Client(); - - /** - * Model tests for Client - */ - @Test - public void testClient() { - // TODO: test Client - } - - /** - * Test the property 'client' - */ - @Test - public void clientTest() { - // TODO: test client - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogAllOfTest.java deleted file mode 100644 index 0d695b15a639..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogAllOfTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for DogAllOf - */ -public class DogAllOfTest { - private final DogAllOf model = new DogAllOf(); - - /** - * Model tests for DogAllOf - */ - @Test - public void testDogAllOf() { - // TODO: test DogAllOf - } - - /** - * Test the property 'breed' - */ - @Test - public void breedTest() { - // TODO: test breed - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogTest.java deleted file mode 100644 index 124bc99c1f12..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.Animal; -import org.openapitools.client.model.DogAllOf; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Dog - */ -public class DogTest { - private final Dog model = new Dog(); - - /** - * Model tests for Dog - */ - @Test - public void testDog() { - // TODO: test Dog - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'breed' - */ - @Test - public void breedTest() { - // TODO: test breed - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumArraysTest.java deleted file mode 100644 index c25b05e9f0d1..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for EnumArrays - */ -public class EnumArraysTest { - private final EnumArrays model = new EnumArrays(); - - /** - * Model tests for EnumArrays - */ - @Test - public void testEnumArrays() { - // TODO: test EnumArrays - } - - /** - * Test the property 'justSymbol' - */ - @Test - public void justSymbolTest() { - // TODO: test justSymbol - } - - /** - * Test the property 'arrayEnum' - */ - @Test - public void arrayEnumTest() { - // TODO: test arrayEnum - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumClassTest.java deleted file mode 100644 index 329454658e33..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for EnumClass - */ -public class EnumClassTest { - /** - * Model tests for EnumClass - */ - @Test - public void testEnumClass() { - // TODO: test EnumClass - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumTestTest.java deleted file mode 100644 index 54c181bf9f3f..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.OuterEnum; -import org.openapitools.client.model.OuterEnumDefaultValue; -import org.openapitools.client.model.OuterEnumInteger; -import org.openapitools.client.model.OuterEnumIntegerDefaultValue; -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for EnumTest - */ -public class EnumTestTest { - private final EnumTest model = new EnumTest(); - - /** - * Model tests for EnumTest - */ - @Test - public void testEnumTest() { - // TODO: test EnumTest - } - - /** - * Test the property 'enumString' - */ - @Test - public void enumStringTest() { - // TODO: test enumString - } - - /** - * Test the property 'enumStringRequired' - */ - @Test - public void enumStringRequiredTest() { - // TODO: test enumStringRequired - } - - /** - * Test the property 'enumInteger' - */ - @Test - public void enumIntegerTest() { - // TODO: test enumInteger - } - - /** - * Test the property 'enumIntegerOnly' - */ - @Test - public void enumIntegerOnlyTest() { - // TODO: test enumIntegerOnly - } - - /** - * Test the property 'enumNumber' - */ - @Test - public void enumNumberTest() { - // TODO: test enumNumber - } - - /** - * Test the property 'outerEnum' - */ - @Test - public void outerEnumTest() { - // TODO: test outerEnum - } - - /** - * Test the property 'outerEnumInteger' - */ - @Test - public void outerEnumIntegerTest() { - // TODO: test outerEnumInteger - } - - /** - * Test the property 'outerEnumDefaultValue' - */ - @Test - public void outerEnumDefaultValueTest() { - // TODO: test outerEnumDefaultValue - } - - /** - * Test the property 'outerEnumIntegerDefaultValue' - */ - @Test - public void outerEnumIntegerDefaultValueTest() { - // TODO: test outerEnumIntegerDefaultValue - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FormatTestTest.java deleted file mode 100644 index 6d3c5e1c2a82..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for FormatTest - */ -public class FormatTestTest { - private final FormatTest model = new FormatTest(); - - /** - * Model tests for FormatTest - */ - @Test - public void testFormatTest() { - // TODO: test FormatTest - } - - /** - * Test the property 'integer' - */ - @Test - public void integerTest() { - // TODO: test integer - } - - /** - * Test the property 'int32' - */ - @Test - public void int32Test() { - // TODO: test int32 - } - - /** - * Test the property 'int64' - */ - @Test - public void int64Test() { - // TODO: test int64 - } - - /** - * Test the property 'number' - */ - @Test - public void numberTest() { - // TODO: test number - } - - /** - * Test the property '_float' - */ - @Test - public void _floatTest() { - // TODO: test _float - } - - /** - * Test the property '_double' - */ - @Test - public void _doubleTest() { - // TODO: test _double - } - - /** - * Test the property 'decimal' - */ - @Test - public void decimalTest() { - // TODO: test decimal - } - - /** - * Test the property 'string' - */ - @Test - public void stringTest() { - // TODO: test string - } - - /** - * Test the property '_byte' - */ - @Test - public void _byteTest() { - // TODO: test _byte - } - - /** - * Test the property 'binary' - */ - @Test - public void binaryTest() { - // TODO: test binary - } - - /** - * Test the property 'date' - */ - @Test - public void dateTest() { - // TODO: test date - } - - /** - * Test the property 'dateTime' - */ - @Test - public void dateTimeTest() { - // TODO: test dateTime - } - - /** - * Test the property 'uuid' - */ - @Test - public void uuidTest() { - // TODO: test uuid - } - - /** - * Test the property 'password' - */ - @Test - public void passwordTest() { - // TODO: test password - } - - /** - * Test the property 'patternWithDigits' - */ - @Test - public void patternWithDigitsTest() { - // TODO: test patternWithDigits - } - - /** - * Test the property 'patternWithDigitsAndDelimiter' - */ - @Test - public void patternWithDigitsAndDelimiterTest() { - // TODO: test patternWithDigitsAndDelimiter - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java deleted file mode 100644 index 0272d7b80004..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for HasOnlyReadOnly - */ -public class HasOnlyReadOnlyTest { - private final HasOnlyReadOnly model = new HasOnlyReadOnly(); - - /** - * Model tests for HasOnlyReadOnly - */ - @Test - public void testHasOnlyReadOnly() { - // TODO: test HasOnlyReadOnly - } - - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - - /** - * Test the property 'foo' - */ - @Test - public void fooTest() { - // TODO: test foo - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MapTestTest.java deleted file mode 100644 index f86a1303fc88..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MapTestTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for MapTest - */ -public class MapTestTest { - private final MapTest model = new MapTest(); - - /** - * Model tests for MapTest - */ - @Test - public void testMapTest() { - // TODO: test MapTest - } - - /** - * Test the property 'mapMapOfString' - */ - @Test - public void mapMapOfStringTest() { - // TODO: test mapMapOfString - } - - /** - * Test the property 'mapOfEnumString' - */ - @Test - public void mapOfEnumStringTest() { - // TODO: test mapOfEnumString - } - - /** - * Test the property 'directMap' - */ - @Test - public void directMapTest() { - // TODO: test directMap - } - - /** - * Test the property 'indirectMap' - */ - @Test - public void indirectMapTest() { - // TODO: test indirectMap - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java deleted file mode 100644 index 808773a5d852..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { - private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); - - /** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ - @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { - // TODO: test MixedPropertiesAndAdditionalPropertiesClass - } - - /** - * Test the property 'uuid' - */ - @Test - public void uuidTest() { - // TODO: test uuid - } - - /** - * Test the property 'dateTime' - */ - @Test - public void dateTimeTest() { - // TODO: test dateTime - } - - /** - * Test the property 'map' - */ - @Test - public void mapTest() { - // TODO: test map - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/Model200ResponseTest.java deleted file mode 100644 index d81fa5a0f669..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Model200Response - */ -public class Model200ResponseTest { - private final Model200Response model = new Model200Response(); - - /** - * Model tests for Model200Response - */ - @Test - public void testModel200Response() { - // TODO: test Model200Response - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'propertyClass' - */ - @Test - public void propertyClassTest() { - // TODO: test propertyClass - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java deleted file mode 100644 index 91bd8fada260..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for ModelApiResponse - */ -public class ModelApiResponseTest { - private final ModelApiResponse model = new ModelApiResponse(); - - /** - * Model tests for ModelApiResponse - */ - @Test - public void testModelApiResponse() { - // TODO: test ModelApiResponse - } - - /** - * Test the property 'code' - */ - @Test - public void codeTest() { - // TODO: test code - } - - /** - * Test the property 'type' - */ - @Test - public void typeTest() { - // TODO: test type - } - - /** - * Test the property 'message' - */ - @Test - public void messageTest() { - // TODO: test message - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java deleted file mode 100644 index 132012d4c387..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for ModelFile - */ -public class ModelFileTest { - private final ModelFile model = new ModelFile(); - - /** - * Model tests for ModelFile - */ - @Test - public void testModelFile() { - // TODO: test ModelFile - } - - /** - * Test the property 'sourceURI' - */ - @Test - public void sourceURITest() { - // TODO: test sourceURI - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java deleted file mode 100644 index d3ed2075e9a4..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for ModelList - */ -public class ModelListTest { - private final ModelList model = new ModelList(); - - /** - * Model tests for ModelList - */ - @Test - public void testModelList() { - // TODO: test ModelList - } - - /** - * Test the property '_123list' - */ - @Test - public void _123listTest() { - // TODO: test _123list - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelReturnTest.java deleted file mode 100644 index f317fef485ea..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for ModelReturn - */ -public class ModelReturnTest { - private final ModelReturn model = new ModelReturn(); - - /** - * Model tests for ModelReturn - */ - @Test - public void testModelReturn() { - // TODO: test ModelReturn - } - - /** - * Test the property '_return' - */ - @Test - public void _returnTest() { - // TODO: test _return - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NameTest.java deleted file mode 100644 index 1ed41a0f80c7..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NameTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Name - */ -public class NameTest { - private final Name model = new Name(); - - /** - * Model tests for Name - */ - @Test - public void testName() { - // TODO: test Name - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'snakeCase' - */ - @Test - public void snakeCaseTest() { - // TODO: test snakeCase - } - - /** - * Test the property 'property' - */ - @Test - public void propertyTest() { - // TODO: test property - } - - /** - * Test the property '_123number' - */ - @Test - public void _123numberTest() { - // TODO: test _123number - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NumberOnlyTest.java deleted file mode 100644 index 15b74f7ef8bf..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for NumberOnly - */ -public class NumberOnlyTest { - private final NumberOnly model = new NumberOnly(); - - /** - * Model tests for NumberOnly - */ - @Test - public void testNumberOnly() { - // TODO: test NumberOnly - } - - /** - * Test the property 'justNumber' - */ - @Test - public void justNumberTest() { - // TODO: test justNumber - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OrderTest.java deleted file mode 100644 index b5cc55e4f581..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OrderTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.threeten.bp.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Order - */ -public class OrderTest { - private final Order model = new Order(); - - /** - * Model tests for Order - */ - @Test - public void testOrder() { - // TODO: test Order - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'petId' - */ - @Test - public void petIdTest() { - // TODO: test petId - } - - /** - * Test the property 'quantity' - */ - @Test - public void quantityTest() { - // TODO: test quantity - } - - /** - * Test the property 'shipDate' - */ - @Test - public void shipDateTest() { - // TODO: test shipDate - } - - /** - * Test the property 'status' - */ - @Test - public void statusTest() { - // TODO: test status - } - - /** - * Test the property 'complete' - */ - @Test - public void completeTest() { - // TODO: test complete - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterCompositeTest.java deleted file mode 100644 index 67ee59963636..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for OuterComposite - */ -public class OuterCompositeTest { - private final OuterComposite model = new OuterComposite(); - - /** - * Model tests for OuterComposite - */ - @Test - public void testOuterComposite() { - // TODO: test OuterComposite - } - - /** - * Test the property 'myNumber' - */ - @Test - public void myNumberTest() { - // TODO: test myNumber - } - - /** - * Test the property 'myString' - */ - @Test - public void myStringTest() { - // TODO: test myString - } - - /** - * Test the property 'myBoolean' - */ - @Test - public void myBooleanTest() { - // TODO: test myBoolean - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumTest.java deleted file mode 100644 index 220d40e83cbb..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for OuterEnum - */ -public class OuterEnumTest { - /** - * Model tests for OuterEnum - */ - @Test - public void testOuterEnum() { - // TODO: test OuterEnum - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java deleted file mode 100644 index 2dc9cb2ae2cd..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for ReadOnlyFirst - */ -public class ReadOnlyFirstTest { - private final ReadOnlyFirst model = new ReadOnlyFirst(); - - /** - * Model tests for ReadOnlyFirst - */ - @Test - public void testReadOnlyFirst() { - // TODO: test ReadOnlyFirst - } - - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - - /** - * Test the property 'baz' - */ - @Test - public void bazTest() { - // TODO: test baz - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java deleted file mode 100644 index 0c723c8cd0cc..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for SpecialModelName - */ -public class SpecialModelNameTest { - private final SpecialModelName model = new SpecialModelName(); - - /** - * Model tests for SpecialModelName - */ - @Test - public void testSpecialModelName() { - // TODO: test SpecialModelName - } - - /** - * Test the property '$specialPropertyName' - */ - @Test - public void $specialPropertyNameTest() { - // TODO: test $specialPropertyName - } - - /** - * Test the property 'specialModelName' - */ - @Test - public void specialModelNameTest() { - // TODO: test specialModelName - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TagTest.java deleted file mode 100644 index 83f536d2fa39..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TagTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Tag - */ -public class TagTest { - private final Tag model = new Tag(); - - /** - * Model tests for Tag - */ - @Test - public void testTag() { - // TODO: test Tag - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/UserTest.java deleted file mode 100644 index 3b673daf5442..000000000000 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/UserTest.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for User - */ -public class UserTest { - private final User model = new User(); - - /** - * Model tests for User - */ - @Test - public void testUser() { - // TODO: test User - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'username' - */ - @Test - public void usernameTest() { - // TODO: test username - } - - /** - * Test the property 'firstName' - */ - @Test - public void firstNameTest() { - // TODO: test firstName - } - - /** - * Test the property 'lastName' - */ - @Test - public void lastNameTest() { - // TODO: test lastName - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'password' - */ - @Test - public void passwordTest() { - // TODO: test password - } - - /** - * Test the property 'phone' - */ - @Test - public void phoneTest() { - // TODO: test phone - } - - /** - * Test the property 'userStatus' - */ - @Test - public void userStatusTest() { - // TODO: test userStatus - } - - /** - * Test the property 'objectWithNoDeclaredProps' - */ - @Test - public void objectWithNoDeclaredPropsTest() { - // TODO: test objectWithNoDeclaredProps - } - - /** - * Test the property 'objectWithNoDeclaredPropsNullable' - */ - @Test - public void objectWithNoDeclaredPropsNullableTest() { - // TODO: test objectWithNoDeclaredPropsNullable - } - - /** - * Test the property 'anyTypeProp' - */ - @Test - public void anyTypePropTest() { - // TODO: test anyTypeProp - } - - /** - * Test the property 'anyTypePropNullable' - */ - @Test - public void anyTypePropNullableTest() { - // TODO: test anyTypePropNullable - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES index 67db66f25828..a2155ab98abb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES @@ -94,6 +94,7 @@ src/main/java/org/openapitools/client/auth/OAuth.java src/main/java/org/openapitools/client/auth/OAuthFlow.java src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java src/main/java/org/openapitools/client/auth/RetryingOAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 08ffdd44ecbf..e169b432739a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -313,6 +313,16 @@ jackson-databind-nullable ${jackson-databind-nullable-version} + + javax.ws.rs + jsr311-api + 1.1.1 + + + javax.ws.rs + javax.ws.rs-api + 2.0 + junit diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index 499d1d864e82..30aaedf4ee4a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -1170,6 +1170,7 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept /** * Build HTTP call with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1192,6 +1193,7 @@ public Call buildCall(String baseUrl, String path, String method, List que /** * Build an HTTP request with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1260,6 +1262,7 @@ public Request buildRequest(String baseUrl, String path, String method, List cookieParams, Request.Builde * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiException.java index 5851f0405ade..60e4f9a5e7e6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiException.java @@ -16,6 +16,8 @@ import java.util.Map; import java.util.List; +import javax.ws.rs.core.GenericType; + /** *

    ApiException class.

    */ @@ -25,6 +27,8 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorObject = null; + private GenericType errorObjectType = null; /** *

    Constructor for ApiException.

    @@ -151,4 +155,40 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the error object type. + * + * @return Error object type + */ + public GenericType getErrorObjectType() { + return errorObjectType; + } + + /** + * Set the error object type. + * + * @param errorObjectType object type + */ + public void setErrorObjectType(GenericType errorObjectType) { + this.errorObjectType = errorObjectType; + } + + /** + * Get the error object. + * + * @return Error object + */ + public Object getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject(Object errorObject) { + this.errorObject = errorObject; + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java index 274416e5dedc..c2502541ff1d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java @@ -27,7 +27,6 @@ import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; -import org.openapitools.client.model.*; import okio.ByteString; import java.io.IOException; @@ -41,54 +40,60 @@ import java.util.Map; import java.util.HashMap; +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() - .registerTypeSelector(Animal.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.Animal.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BigCat", BigCat.class); - classByDiscriminatorValue.put("Cat", Cat.class); - classByDiscriminatorValue.put("Dog", Dog.class); - classByDiscriminatorValue.put("Animal", Animal.class); + classByDiscriminatorValue.put("BigCat", org.openapitools.client.model.BigCat.class); + classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); + classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); + classByDiscriminatorValue.put("Animal", org.openapitools.client.model.Animal.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } }) - .registerTypeSelector(BigCat.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.BigCat.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BigCat", BigCat.class); + classByDiscriminatorValue.put("BigCat", org.openapitools.client.model.BigCat.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } }) - .registerTypeSelector(Cat.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.Cat.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BigCat", BigCat.class); - classByDiscriminatorValue.put("Cat", Cat.class); + classByDiscriminatorValue.put("BigCat", org.openapitools.client.model.BigCat.class); + classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } }) - .registerTypeSelector(Dog.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.Dog.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Dog", Dog.class); + classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } @@ -121,13 +126,57 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - public JSON() { + { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(byte[].class, byteArrayAdapter) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesAnyType.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesArray.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesBoolean.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesInteger.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesNumber.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesObject.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesString.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfArrayOfNumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfNumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.BigCat.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.BigCatAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Capitalization.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.CatAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Category.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ClassModel.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Client.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Dog.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.DogAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EnumArrays.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FileSchemaTestClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FormatTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.HasOnlyReadOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.MapTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.MixedPropertiesAndAdditionalPropertiesClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Model200Response.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelApiResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelFile.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelList.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelReturn.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Name.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.NumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Order.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.OuterComposite.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ReadOnlyFirst.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.SpecialModelName.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.TypeHolderDefault.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.TypeHolderExample.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.User.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.XmlItem.CustomTypeAdapterFactory()) .create(); } @@ -136,7 +185,7 @@ public JSON() { * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -144,23 +193,13 @@ public Gson getGson() { * Set Gson. * * @param gson Gson - * @return JSON */ - public JSON setGson(Gson gson) { - this.gson = gson; - return this; + public static void setGson(Gson gson) { + JSON.gson = gson; } - /** - * Configure the parser to be liberal in what it accepts. - * - * @param lenientOnJson Set it to true to ignore some syntax errors - * @return JSON - * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html - */ - public JSON setLenientOnJson(boolean lenientOnJson) { + public static void setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; - return this; } /** @@ -169,7 +208,7 @@ public JSON setLenientOnJson(boolean lenientOnJson) { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -182,11 +221,11 @@ public String serialize(Object obj) { * @return The deserialized Java object */ @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { @@ -206,7 +245,7 @@ public T deserialize(String body, Type returnType) { /** * Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { + public static class ByteArrayAdapter extends TypeAdapter { @Override public void write(JsonWriter out, byte[] value) throws IOException { @@ -278,7 +317,7 @@ public OffsetDateTime read(JsonReader in) throws IOException { /** * Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -316,14 +355,12 @@ public LocalDate read(JsonReader in) throws IOException { } } - public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); - return this; } /** @@ -437,14 +474,11 @@ public Date read(JsonReader in) throws IOException { } } - public JSON setDateFormat(DateFormat dateFormat) { + public static void setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setSqlDateFormat(DateFormat dateFormat) { + public static void setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); - return this; } - } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 5789ec8083be..e4e556f5565b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class AnotherFakeApi { private ApiClient localVarApiClient; @@ -86,7 +87,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -175,8 +175,14 @@ public Client call123testSpecialTags(Client body) throws ApiException { */ public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throws ApiException { okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 450dbb1a5b7a..db2f0272abb1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -42,6 +42,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeApi { private ApiClient localVarApiClient; @@ -94,7 +95,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -217,7 +217,6 @@ public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback */ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -301,8 +300,14 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -339,7 +344,6 @@ public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallba */ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -423,8 +427,14 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Ap */ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -461,7 +471,6 @@ public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final */ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -545,8 +554,14 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -583,7 +598,6 @@ public okhttp3.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCall */ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -667,8 +681,14 @@ public String fakeOuterStringSerialize(String body) throws ApiException { */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { okhttp3.Call localVarCall = fakeOuterStringSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -705,7 +725,6 @@ public okhttp3.Call fakeOuterStringSerializeAsync(String body, final ApiCallback */ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -829,7 +848,6 @@ public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass body, final */ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -964,7 +982,6 @@ public okhttp3.Call testBodyWithQueryParamsAsync(String query, User body, final */ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1053,8 +1070,14 @@ public Client testClientModel(Client body) throws ApiException { */ public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { okhttp3.Call localVarCall = testClientModelValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -1105,7 +1128,6 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1349,7 +1371,6 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1511,7 +1532,6 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1748,7 +1768,6 @@ public APItestGroupParametersRequest testGroupParameters(Integer requiredStringG */ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1872,7 +1891,6 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -2015,7 +2033,6 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api */ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index e9e0d6cb8c9f..d22a391b6dd3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeClassnameTags123Api { private ApiClient localVarApiClient; @@ -86,7 +87,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -175,8 +175,14 @@ public Client testClassname(Client body) throws ApiException { */ public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { okhttp3.Call localVarCall = testClassnameValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java index f3f8e2d557ce..b9f6d5e70c7e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class PetApi { private ApiClient localVarApiClient; @@ -90,7 +91,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -218,7 +218,6 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -353,7 +352,6 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -448,8 +446,14 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -490,7 +494,6 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback @Deprecated public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -590,8 +593,14 @@ public Set findPetsByTags(Set tags) throws ApiException { @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -633,7 +642,6 @@ public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback getPetByIdWithHttpInfo(Long petId) throws ApiException { okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -770,7 +784,6 @@ public okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback _callback */ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -904,7 +917,6 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1044,7 +1056,6 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1146,8 +1157,14 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _ */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -1188,7 +1205,6 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1295,8 +1311,14 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { okhttp3.Call localVarCall = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java index e17f7df6c482..513c7a98894c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class StoreApi { private ApiClient localVarApiClient; @@ -87,7 +88,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -213,7 +213,6 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -295,8 +294,14 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getInventoryValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -334,7 +339,6 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -428,8 +432,14 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -469,7 +479,6 @@ public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _ca */ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -560,8 +569,14 @@ public Order placeOrder(Order body) throws ApiException { */ public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { okhttp3.Call localVarCall = placeOrderValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index 627f78804878..a81b1b364434 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -35,6 +35,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class UserApi { private ApiClient localVarApiClient; @@ -87,7 +88,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -210,7 +210,6 @@ public okhttp3.Call createUserAsync(User body, final ApiCallback _callback */ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -333,7 +332,6 @@ public okhttp3.Call createUsersWithArrayInputAsync(List body, final ApiCal */ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -457,7 +455,6 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -586,7 +583,6 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -680,8 +676,14 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -722,7 +724,6 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -828,8 +829,14 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -867,7 +874,6 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -984,7 +990,6 @@ public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws Ap */ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index a37cbdd5a55e..7b630bb57e77 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -28,22 +28,31 @@ public class RetryingOAuth extends OAuth implements Interceptor { private TokenRequestBuilder tokenRequestBuilder; + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); this.tokenRequestBuilder = tokenRequestBuilder; } + /** + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { this(new OkHttpClient(), tokenRequestBuilder); } /** - @param tokenUrl The token URL to be used for this OAuth2 flow. - Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - The value must be an absolute URL. - @param clientId The OAuth2 client ID for the "clientCredentials" flow. - @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - */ + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ public RetryingOAuth( String tokenUrl, String clientId, @@ -62,6 +71,11 @@ public RetryingOAuth( } } + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ public void setFlow(OAuthFlow flow) { switch(flow) { case ACCESS_CODE: @@ -147,8 +161,12 @@ private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAut } } - /* + /** * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { @@ -165,10 +183,21 @@ public synchronized boolean updateAccessToken(String requestAccessToken) throws return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); } + /** + * Gets the token request builder + * + * @return A token request builder + * @throws java.io.IOException If fail to update the access token + */ public TokenRequestBuilder getTokenRequestBuilder() { return tokenRequestBuilder; } + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { this.tokenRequestBuilder = tokenRequestBuilder; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 931441b97144..e03739e2bcf4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,6 +28,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesAnyType */ @@ -126,5 +145,89 @@ public AdditionalPropertiesAnyType[] newArray(int size) { return new AdditionalPropertiesAnyType[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesAnyType + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesAnyType.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesAnyType is not found in the empty JSON string", AdditionalPropertiesAnyType.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesAnyType.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesAnyType` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesAnyType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesAnyType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesAnyType.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesAnyType value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesAnyType read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesAnyType given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesAnyType + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesAnyType + */ + public static AdditionalPropertiesAnyType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesAnyType.class); + } + + /** + * Convert an instance of AdditionalPropertiesAnyType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 17e44d0631d5..05f9c0cced89 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesArray */ @@ -127,5 +146,89 @@ public AdditionalPropertiesArray[] newArray(int size) { return new AdditionalPropertiesArray[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesArray + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesArray.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesArray is not found in the empty JSON string", AdditionalPropertiesArray.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesArray.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesArray` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesArray.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesArray' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesArray.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesArray value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesArray read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesArray given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesArray + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesArray + */ + public static AdditionalPropertiesArray fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesArray.class); + } + + /** + * Convert an instance of AdditionalPropertiesArray to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 6e6b4f800079..70e97cc2d81c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,6 +28,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesBoolean */ @@ -126,5 +145,89 @@ public AdditionalPropertiesBoolean[] newArray(int size) { return new AdditionalPropertiesBoolean[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesBoolean + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesBoolean.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesBoolean is not found in the empty JSON string", AdditionalPropertiesBoolean.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesBoolean.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesBoolean` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesBoolean.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesBoolean' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesBoolean.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesBoolean value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesBoolean read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesBoolean given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesBoolean + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesBoolean + */ + public static AdditionalPropertiesBoolean fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesBoolean.class); + } + + /** + * Convert an instance of AdditionalPropertiesBoolean to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 055b7d0995bd..87753e1c3506 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,6 +30,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesClass */ @@ -497,5 +516,99 @@ public AdditionalPropertiesClass[] newArray(int size) { return new AdditionalPropertiesClass[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("map_string"); + openapiFields.add("map_number"); + openapiFields.add("map_integer"); + openapiFields.add("map_boolean"); + openapiFields.add("map_array_integer"); + openapiFields.add("map_array_anytype"); + openapiFields.add("map_map_string"); + openapiFields.add("map_map_anytype"); + openapiFields.add("anytype_1"); + openapiFields.add("anytype_2"); + openapiFields.add("anytype_3"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesClass is not found in the empty JSON string", AdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesClass read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass + */ + public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class); + } + + /** + * Convert an instance of AdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 249f410a119f..f409a6e2c641 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,6 +28,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesInteger */ @@ -126,5 +145,89 @@ public AdditionalPropertiesInteger[] newArray(int size) { return new AdditionalPropertiesInteger[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesInteger + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesInteger.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesInteger is not found in the empty JSON string", AdditionalPropertiesInteger.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesInteger.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesInteger` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesInteger.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesInteger' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesInteger.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesInteger value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesInteger read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesInteger given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesInteger + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesInteger + */ + public static AdditionalPropertiesInteger fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesInteger.class); + } + + /** + * Convert an instance of AdditionalPropertiesInteger to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index df925edf3687..ff16dbeb8efe 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesNumber */ @@ -127,5 +146,89 @@ public AdditionalPropertiesNumber[] newArray(int size) { return new AdditionalPropertiesNumber[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesNumber + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesNumber.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesNumber is not found in the empty JSON string", AdditionalPropertiesNumber.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesNumber.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesNumber` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesNumber.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesNumber' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesNumber.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesNumber value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesNumber read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesNumber given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesNumber + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesNumber + */ + public static AdditionalPropertiesNumber fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesNumber.class); + } + + /** + * Convert an instance of AdditionalPropertiesNumber to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 9e258fe2e8f3..26d2ce0e0110 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,6 +28,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesObject */ @@ -126,5 +145,89 @@ public AdditionalPropertiesObject[] newArray(int size) { return new AdditionalPropertiesObject[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesObject + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesObject.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesObject is not found in the empty JSON string", AdditionalPropertiesObject.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesObject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesObject` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesObject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesObject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesObject read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesObject + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesObject + */ + public static AdditionalPropertiesObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesObject.class); + } + + /** + * Convert an instance of AdditionalPropertiesObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index f704a72d17f6..9ef3473ee7f8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,6 +28,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * AdditionalPropertiesString */ @@ -126,5 +145,89 @@ public AdditionalPropertiesString[] newArray(int size) { return new AdditionalPropertiesString[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesString + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesString.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesString is not found in the empty JSON string", AdditionalPropertiesString.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesString.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesString` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesString.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesString' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesString.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesString value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesString read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesString given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesString + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesString + */ + public static AdditionalPropertiesString fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesString.class); + } + + /** + * Convert an instance of AdditionalPropertiesString to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java index db195751a0bc..112bfea9eecf 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Animal */ @@ -154,5 +173,71 @@ public Animal[] newArray(int size) { return new Animal[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Animal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Animal.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Animal is not found in the empty JSON string", Animal.openapiRequiredFields.toString())); + } + } + + String discriminatorValue = jsonObj.get("className").getAsString(); + switch (discriminatorValue) { + case "BigCat": + BigCat.validateJsonObject(jsonObj); + break; + case "Cat": + Cat.validateJsonObject(jsonObj); + break; + case "Dog": + Dog.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + } + + + /** + * Create an instance of Animal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Animal + * @throws IOException if the JSON string is invalid with respect to Animal + */ + public static Animal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Animal.class); + } + + /** + * Convert an instance of Animal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 9d2410adfca2..286ee7b3a580 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ArrayOfArrayOfNumberOnly */ @@ -130,5 +149,89 @@ public ArrayOfArrayOfNumberOnly[] newArray(int size) { return new ArrayOfArrayOfNumberOnly[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ArrayArrayNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayOfArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayOfArrayOfNumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfArrayOfNumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayOfArrayOfNumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayOfArrayOfNumberOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 0aea024ea4ce..5fefc2e724b6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ArrayOfNumberOnly */ @@ -130,5 +149,89 @@ public ArrayOfNumberOnly[] newArray(int size) { return new ArrayOfNumberOnly[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ArrayNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayOfNumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfNumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayOfNumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayOfNumberOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly + */ + public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java index 216ff2dd0ca0..7ea18a7ce3ec 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ArrayTest */ @@ -208,5 +227,91 @@ public ArrayTest[] newArray(int size) { return new ArrayTest[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("array_of_string"); + openapiFields.add("array_array_of_integer"); + openapiFields.add("array_array_of_model"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTest + * @throws IOException if the JSON string is invalid with respect to ArrayTest + */ + public static ArrayTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayTest.class); + } + + /** + * Convert an instance of ArrayTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java index e1ac2c6f3b59..e4a69703159e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java @@ -28,6 +28,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * BigCat */ @@ -178,5 +197,100 @@ public BigCat[] newArray(int size) { return new BigCat[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("declawed"); + openapiFields.add("kind"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BigCat + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BigCat.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BigCat is not found in the empty JSON string", BigCat.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BigCat.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BigCat` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BigCat.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BigCat.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BigCat' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BigCat.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BigCat value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BigCat read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BigCat given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCat + * @throws IOException if the JSON string is invalid with respect to BigCat + */ + public static BigCat fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BigCat.class); + } + + /** + * Convert an instance of BigCat to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 96fbe115dff6..ef2876299455 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * BigCatAllOf */ @@ -170,5 +189,89 @@ public BigCatAllOf[] newArray(int size) { return new BigCatAllOf[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("kind"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BigCatAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BigCatAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BigCatAllOf is not found in the empty JSON string", BigCatAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BigCatAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BigCatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BigCatAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BigCatAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BigCatAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BigCatAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BigCatAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BigCatAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCatAllOf + * @throws IOException if the JSON string is invalid with respect to BigCatAllOf + */ + public static BigCatAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BigCatAllOf.class); + } + + /** + * Convert an instance of BigCatAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java index a93444bb063e..1eee3722a0cf 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Capitalization */ @@ -274,5 +293,94 @@ public Capitalization[] newArray(int size) { return new Capitalization[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("smallCamel"); + openapiFields.add("CapitalCamel"); + openapiFields.add("small_Snake"); + openapiFields.add("Capital_Snake"); + openapiFields.add("SCA_ETH_Flow_Points"); + openapiFields.add("ATT_NAME"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Capitalization + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Capitalization.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Capitalization is not found in the empty JSON string", Capitalization.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Capitalization.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Capitalization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Capitalization.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Capitalization' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Capitalization.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Capitalization value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Capitalization read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Capitalization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Capitalization + * @throws IOException if the JSON string is invalid with respect to Capitalization + */ + public static Capitalization fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Capitalization.class); + } + + /** + * Convert an instance of Capitalization to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java index ca69726075e8..e7a1ea757a1e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Cat */ @@ -128,5 +147,66 @@ public Cat[] newArray(int size) { return new Cat[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("declawed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Cat + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Cat.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Cat is not found in the empty JSON string", Cat.openapiRequiredFields.toString())); + } + } + + String discriminatorValue = jsonObj.get("className").getAsString(); + switch (discriminatorValue) { + case "BigCat": + BigCat.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + } + + + /** + * Create an instance of Cat given an JSON string + * + * @param jsonString JSON string + * @return An instance of Cat + * @throws IOException if the JSON string is invalid with respect to Cat + */ + public static Cat fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Cat.class); + } + + /** + * Convert an instance of Cat to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java index 85a45fb3aa0f..7ba04ee74dc8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * CatAllOf */ @@ -119,5 +138,89 @@ public CatAllOf[] newArray(int size) { return new CatAllOf[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("declawed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CatAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CatAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CatAllOf is not found in the empty JSON string", CatAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CatAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatAllOf + * @throws IOException if the JSON string is invalid with respect to CatAllOf + */ + public static CatAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatAllOf.class); + } + + /** + * Convert an instance of CatAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java index 39e56c2222f0..d42af70e5c33 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Category */ @@ -150,5 +169,98 @@ public Category[] newArray(int size) { return new Category[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Category + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Category.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Category is not found in the empty JSON string", Category.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Category.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Category` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Category.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Category.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Category' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Category.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Category value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Category read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Category given an JSON string + * + * @param jsonString JSON string + * @return An instance of Category + * @throws IOException if the JSON string is invalid with respect to Category + */ + public static Category fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Category.class); + } + + /** + * Convert an instance of Category to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java index e15f6e8788bf..e8d0404302c2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing model with \"_class\" property */ @@ -120,5 +139,89 @@ public ClassModel[] newArray(int size) { return new ClassModel[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("_class"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClassModel + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ClassModel.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ClassModel is not found in the empty JSON string", ClassModel.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClassModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClassModel` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClassModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClassModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClassModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClassModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClassModel read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClassModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClassModel + * @throws IOException if the JSON string is invalid with respect to ClassModel + */ + public static ClassModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClassModel.class); + } + + /** + * Convert an instance of ClassModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java index 975c9dfa7ee3..4400672426fa 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Client */ @@ -119,5 +138,89 @@ public Client[] newArray(int size) { return new Client[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("client"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Client + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Client.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Client is not found in the empty JSON string", Client.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Client.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Client` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Client.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Client' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Client.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Client value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Client read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Client given an JSON string + * + * @param jsonString JSON string + * @return An instance of Client + * @throws IOException if the JSON string is invalid with respect to Client + */ + public static Client fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Client.class); + } + + /** + * Convert an instance of Client to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java index 98454aa74b2b..d5241fa7bd9c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java @@ -28,6 +28,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Dog */ @@ -127,5 +146,99 @@ public Dog[] newArray(int size) { return new Dog[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("breed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Dog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Dog.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Dog is not found in the empty JSON string", Dog.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Dog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Dog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Dog.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Dog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Dog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Dog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Dog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Dog read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Dog given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dog + * @throws IOException if the JSON string is invalid with respect to Dog + */ + public static Dog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Dog.class); + } + + /** + * Convert an instance of Dog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java index c95c1494c91c..bc150269f7aa 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * DogAllOf */ @@ -119,5 +138,89 @@ public DogAllOf[] newArray(int size) { return new DogAllOf[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("breed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DogAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DogAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DogAllOf is not found in the empty JSON string", DogAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DogAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DogAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DogAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DogAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DogAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DogAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DogAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DogAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of DogAllOf + * @throws IOException if the JSON string is invalid with respect to DogAllOf + */ + public static DogAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DogAllOf.class); + } + + /** + * Convert an instance of DogAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java index 991b1296170a..538f1e573b2b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -28,6 +28,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * EnumArrays */ @@ -254,5 +273,90 @@ public EnumArrays[] newArray(int size) { return new EnumArrays[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("just_symbol"); + openapiFields.add("array_enum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumArrays + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumArrays.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumArrays is not found in the empty JSON string", EnumArrays.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumArrays.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumArrays` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnumArrays.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnumArrays' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnumArrays.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnumArrays value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EnumArrays read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EnumArrays given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumArrays + * @throws IOException if the JSON string is invalid with respect to EnumArrays + */ + public static EnumArrays fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumArrays.class); + } + + /** + * Convert an instance of EnumArrays to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java index 0e5d108906f0..871d4c59eabd 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java @@ -27,6 +27,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * EnumTest */ @@ -436,5 +455,101 @@ public EnumTest[] newArray(int size) { return new EnumTest[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enum_string"); + openapiFields.add("enum_string_required"); + openapiFields.add("enum_integer"); + openapiFields.add("enum_number"); + openapiFields.add("outerEnum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enum_string_required"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumTest is not found in the empty JSON string", EnumTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnumTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnumTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnumTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnumTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnumTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EnumTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EnumTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumTest + * @throws IOException if the JSON string is invalid with respect to EnumTest + */ + public static EnumTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumTest.class); + } + + /** + * Convert an instance of EnumTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index d57efa9262d8..f98a11ec8aed 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * FileSchemaTestClass */ @@ -161,5 +180,101 @@ public FileSchemaTestClass[] newArray(int size) { return new FileSchemaTestClass[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("file"); + openapiFields.add("files"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FileSchemaTestClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FileSchemaTestClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FileSchemaTestClass is not found in the empty JSON string", FileSchemaTestClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FileSchemaTestClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileSchemaTestClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `file` + if (jsonObj.getAsJsonObject("file") != null) { + ModelFile.validateJsonObject(jsonObj.getAsJsonObject("file")); + } + JsonArray jsonArrayfiles = jsonObj.getAsJsonArray("files"); + // validate the optional field `files` (array) + if (jsonArrayfiles != null) { + for (int i = 0; i < jsonArrayfiles.size(); i++) { + ModelFile.validateJsonObject(jsonArrayfiles.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FileSchemaTestClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FileSchemaTestClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FileSchemaTestClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FileSchemaTestClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FileSchemaTestClass read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FileSchemaTestClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileSchemaTestClass + * @throws IOException if the JSON string is invalid with respect to FileSchemaTestClass + */ + public static FileSchemaTestClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FileSchemaTestClass.class); + } + + /** + * Convert an instance of FileSchemaTestClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java index fbc06e995182..db316b339b5e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,6 +31,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * FormatTest */ @@ -537,5 +556,113 @@ public FormatTest[] newArray(int size) { return new FormatTest[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("integer"); + openapiFields.add("int32"); + openapiFields.add("int64"); + openapiFields.add("number"); + openapiFields.add("float"); + openapiFields.add("double"); + openapiFields.add("string"); + openapiFields.add("byte"); + openapiFields.add("binary"); + openapiFields.add("date"); + openapiFields.add("dateTime"); + openapiFields.add("uuid"); + openapiFields.add("password"); + openapiFields.add("BigDecimal"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("byte"); + openapiRequiredFields.add("date"); + openapiRequiredFields.add("password"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FormatTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FormatTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FormatTest is not found in the empty JSON string", FormatTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FormatTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FormatTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FormatTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FormatTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FormatTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FormatTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FormatTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FormatTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FormatTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FormatTest + * @throws IOException if the JSON string is invalid with respect to FormatTest + */ + public static FormatTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FormatTest.class); + } + + /** + * Convert an instance of FormatTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ec3a4545cfe8..c11b1292e144 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * HasOnlyReadOnly */ @@ -142,5 +161,90 @@ public HasOnlyReadOnly[] newArray(int size) { return new HasOnlyReadOnly[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bar"); + openapiFields.add("foo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasOnlyReadOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HasOnlyReadOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HasOnlyReadOnly is not found in the empty JSON string", HasOnlyReadOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasOnlyReadOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasOnlyReadOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasOnlyReadOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasOnlyReadOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasOnlyReadOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasOnlyReadOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasOnlyReadOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasOnlyReadOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasOnlyReadOnly + * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly + */ + public static HasOnlyReadOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasOnlyReadOnly.class); + } + + /** + * Convert an instance of HasOnlyReadOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java index 701638d5bda7..a1da6e960e1f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * MapTest */ @@ -294,5 +313,92 @@ public MapTest[] newArray(int size) { return new MapTest[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("map_map_of_string"); + openapiFields.add("map_of_enum_string"); + openapiFields.add("direct_map"); + openapiFields.add("indirect_map"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MapTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MapTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MapTest is not found in the empty JSON string", MapTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MapTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MapTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MapTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MapTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MapTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MapTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MapTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MapTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MapTest + * @throws IOException if the JSON string is invalid with respect to MapTest + */ + public static MapTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MapTest.class); + } + + /** + * Convert an instance of MapTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index f166778d042c..12712e38fd7a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,6 +32,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * MixedPropertiesAndAdditionalPropertiesClass */ @@ -195,5 +214,91 @@ public MixedPropertiesAndAdditionalPropertiesClass[] newArray(int size) { return new MixedPropertiesAndAdditionalPropertiesClass[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uuid"); + openapiFields.add("dateTime"); + openapiFields.add("map"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MixedPropertiesAndAdditionalPropertiesClass is not found in the empty JSON string", MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MixedPropertiesAndAdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MixedPropertiesAndAdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MixedPropertiesAndAdditionalPropertiesClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MixedPropertiesAndAdditionalPropertiesClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MixedPropertiesAndAdditionalPropertiesClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MixedPropertiesAndAdditionalPropertiesClass read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of MixedPropertiesAndAdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static MixedPropertiesAndAdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MixedPropertiesAndAdditionalPropertiesClass.class); + } + + /** + * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java index 0a93be51b998..4ad3047523a6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing model name starting with number */ @@ -151,5 +170,90 @@ public Model200Response[] newArray(int size) { return new Model200Response[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("class"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Model200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Model200Response.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Model200Response is not found in the empty JSON string", Model200Response.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Model200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Model200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Model200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Model200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Model200Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Model200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Model200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Model200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Model200Response + * @throws IOException if the JSON string is invalid with respect to Model200Response + */ + public static Model200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Model200Response.class); + } + + /** + * Convert an instance of Model200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 74b58c304b7d..f7682c67c363 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ModelApiResponse */ @@ -181,5 +200,91 @@ public ModelApiResponse[] newArray(int size) { return new ModelApiResponse[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("type"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelApiResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelApiResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelApiResponse is not found in the empty JSON string", ModelApiResponse.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelApiResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelApiResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelApiResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelApiResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelApiResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelApiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelApiResponse + * @throws IOException if the JSON string is invalid with respect to ModelApiResponse + */ + public static ModelApiResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelApiResponse.class); + } + + /** + * Convert an instance of ModelApiResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java index 99e3a6b454df..9f29fab1b3ab 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Must be named `File` for test. */ @@ -120,5 +139,89 @@ public ModelFile[] newArray(int size) { return new ModelFile[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceURI"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelFile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelFile.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelFile is not found in the empty JSON string", ModelFile.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelFile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelFile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelFile + * @throws IOException if the JSON string is invalid with respect to ModelFile + */ + public static ModelFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelFile.class); + } + + /** + * Convert an instance of ModelFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java index 3c03ba17da0a..7b22468b0ba0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ModelList */ @@ -119,5 +138,89 @@ public ModelList[] newArray(int size) { return new ModelList[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("123-list"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelList + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelList.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelList is not found in the empty JSON string", ModelList.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelList read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelList + * @throws IOException if the JSON string is invalid with respect to ModelList + */ + public static ModelList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelList.class); + } + + /** + * Convert an instance of ModelList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java index a6e15d195ab9..1e5616e90490 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing reserved words */ @@ -120,5 +139,89 @@ public ModelReturn[] newArray(int size) { return new ModelReturn[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("return"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelReturn + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelReturn.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelReturn is not found in the empty JSON string", ModelReturn.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelReturn.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelReturn` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelReturn.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelReturn' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelReturn.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelReturn value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelReturn read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelReturn given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelReturn + * @throws IOException if the JSON string is invalid with respect to ModelReturn + */ + public static ModelReturn fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelReturn.class); + } + + /** + * Convert an instance of ModelReturn to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java index 66a024bf9593..e76a4d83328e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing model name same as property name */ @@ -205,5 +224,100 @@ public Name[] newArray(int size) { return new Name[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("snake_case"); + openapiFields.add("property"); + openapiFields.add("123Number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Name + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Name.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Name is not found in the empty JSON string", Name.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Name.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Name.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Name.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Name' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Name.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Name value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Name read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws IOException if the JSON string is invalid with respect to Name + */ + public static Name fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Name.class); + } + + /** + * Convert an instance of Name to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java index b4b8b99a31f4..aa4bab0f2c08 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,6 +27,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * NumberOnly */ @@ -120,5 +139,89 @@ public NumberOnly[] newArray(int size) { return new NumberOnly[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("JustNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NumberOnly is not found in the empty JSON string", NumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NumberOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberOnly + * @throws IOException if the JSON string is invalid with respect to NumberOnly + */ + public static NumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NumberOnly.class); + } + + /** + * Convert an instance of NumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java index 0628c9213ae4..1e9ba61a9827 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java @@ -27,6 +27,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Order */ @@ -324,5 +343,94 @@ public Order[] newArray(int size) { return new Order[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("petId"); + openapiFields.add("quantity"); + openapiFields.add("shipDate"); + openapiFields.add("status"); + openapiFields.add("complete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Order + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Order.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Order is not found in the empty JSON string", Order.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Order.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Order.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Order' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Order.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Order value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Order read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Order given an JSON string + * + * @param jsonString JSON string + * @return An instance of Order + * @throws IOException if the JSON string is invalid with respect to Order + */ + public static Order fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Order.class); + } + + /** + * Convert an instance of Order to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java index 4a61f7034e53..9f2e6998b0da 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,6 +27,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * OuterComposite */ @@ -182,5 +201,91 @@ public OuterComposite[] newArray(int size) { return new OuterComposite[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("my_number"); + openapiFields.add("my_string"); + openapiFields.add("my_boolean"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OuterComposite + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (OuterComposite.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in OuterComposite is not found in the empty JSON string", OuterComposite.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OuterComposite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OuterComposite` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OuterComposite.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OuterComposite' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OuterComposite.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OuterComposite value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OuterComposite read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OuterComposite given an JSON string + * + * @param jsonString JSON string + * @return An instance of OuterComposite + * @throws IOException if the JSON string is invalid with respect to OuterComposite + */ + public static OuterComposite fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OuterComposite.class); + } + + /** + * Convert an instance of OuterComposite to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java index f28f1fb90b18..d317d654ca20 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java @@ -32,6 +32,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Pet */ @@ -342,5 +361,114 @@ public Pet[] newArray(int size) { return new Pet[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("category"); + openapiFields.add("name"); + openapiFields.add("photoUrls"); + openapiFields.add("tags"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("photoUrls"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Pet.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Pet is not found in the empty JSON string", Pet.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Pet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Pet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `category` + if (jsonObj.getAsJsonObject("category") != null) { + Category.validateJsonObject(jsonObj.getAsJsonObject("category")); + } + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the optional field `tags` (array) + if (jsonArraytags != null) { + for (int i = 0; i < jsonArraytags.size(); i++) { + Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Pet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pet read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Pet given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pet + * @throws IOException if the JSON string is invalid with respect to Pet + */ + public static Pet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pet.class); + } + + /** + * Convert an instance of Pet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index c892894a70d8..8a2b1836ceee 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ReadOnlyFirst */ @@ -149,5 +168,90 @@ public ReadOnlyFirst[] newArray(int size) { return new ReadOnlyFirst[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bar"); + openapiFields.add("baz"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReadOnlyFirst + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ReadOnlyFirst.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadOnlyFirst is not found in the empty JSON string", ReadOnlyFirst.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReadOnlyFirst.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadOnlyFirst` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadOnlyFirst.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadOnlyFirst' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadOnlyFirst.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadOnlyFirst value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadOnlyFirst read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReadOnlyFirst given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadOnlyFirst + * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst + */ + public static ReadOnlyFirst fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadOnlyFirst.class); + } + + /** + * Convert an instance of ReadOnlyFirst to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0304fb7454b7..47be999518a6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * SpecialModelName */ @@ -119,5 +138,89 @@ public SpecialModelName[] newArray(int size) { return new SpecialModelName[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("$special[property.name]"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SpecialModelName + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SpecialModelName.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SpecialModelName is not found in the empty JSON string", SpecialModelName.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SpecialModelName.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SpecialModelName` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SpecialModelName.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpecialModelName' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SpecialModelName.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SpecialModelName value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SpecialModelName read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SpecialModelName given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecialModelName + * @throws IOException if the JSON string is invalid with respect to SpecialModelName + */ + public static SpecialModelName fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpecialModelName.class); + } + + /** + * Convert an instance of SpecialModelName to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java index 1f040b328d2d..513f0419a4ee 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Tag */ @@ -150,5 +169,90 @@ public Tag[] newArray(int size) { return new Tag[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Tag + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Tag.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Tag.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Tag.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Tag' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Tag.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Tag value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Tag read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Tag given an JSON string + * + * @param jsonString JSON string + * @return An instance of Tag + * @throws IOException if the JSON string is invalid with respect to Tag + */ + public static Tag fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Tag.class); + } + + /** + * Convert an instance of Tag to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f84bf0c8e195..c090ad1a8137 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * TypeHolderDefault */ @@ -251,5 +270,105 @@ public TypeHolderDefault[] newArray(int size) { return new TypeHolderDefault[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("string_item"); + openapiFields.add("number_item"); + openapiFields.add("integer_item"); + openapiFields.add("bool_item"); + openapiFields.add("array_item"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("string_item"); + openapiRequiredFields.add("number_item"); + openapiRequiredFields.add("integer_item"); + openapiRequiredFields.add("bool_item"); + openapiRequiredFields.add("array_item"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TypeHolderDefault + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TypeHolderDefault.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TypeHolderDefault is not found in the empty JSON string", TypeHolderDefault.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TypeHolderDefault.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TypeHolderDefault` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TypeHolderDefault.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TypeHolderDefault.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TypeHolderDefault' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TypeHolderDefault.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TypeHolderDefault value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TypeHolderDefault read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TypeHolderDefault given an JSON string + * + * @param jsonString JSON string + * @return An instance of TypeHolderDefault + * @throws IOException if the JSON string is invalid with respect to TypeHolderDefault + */ + public static TypeHolderDefault fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TypeHolderDefault.class); + } + + /** + * Convert an instance of TypeHolderDefault to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 05f329b8fa55..9be2e51334f2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * TypeHolderExample */ @@ -282,5 +301,107 @@ public TypeHolderExample[] newArray(int size) { return new TypeHolderExample[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("string_item"); + openapiFields.add("number_item"); + openapiFields.add("float_item"); + openapiFields.add("integer_item"); + openapiFields.add("bool_item"); + openapiFields.add("array_item"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("string_item"); + openapiRequiredFields.add("number_item"); + openapiRequiredFields.add("float_item"); + openapiRequiredFields.add("integer_item"); + openapiRequiredFields.add("bool_item"); + openapiRequiredFields.add("array_item"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TypeHolderExample + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TypeHolderExample.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TypeHolderExample is not found in the empty JSON string", TypeHolderExample.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TypeHolderExample.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TypeHolderExample` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TypeHolderExample.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TypeHolderExample.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TypeHolderExample' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TypeHolderExample.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TypeHolderExample value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TypeHolderExample read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TypeHolderExample given an JSON string + * + * @param jsonString JSON string + * @return An instance of TypeHolderExample + * @throws IOException if the JSON string is invalid with respect to TypeHolderExample + */ + public static TypeHolderExample fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TypeHolderExample.class); + } + + /** + * Convert an instance of TypeHolderExample to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java index 04646e066755..d4098741d51d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java @@ -26,6 +26,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * User */ @@ -336,5 +355,96 @@ public User[] newArray(int size) { return new User[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("username"); + openapiFields.add("firstName"); + openapiFields.add("lastName"); + openapiFields.add("email"); + openapiFields.add("password"); + openapiFields.add("phone"); + openapiFields.add("userStatus"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to User + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (User.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java index e0dfd0b338c3..3a076ccef854 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,6 +29,25 @@ import android.os.Parcelable; import android.os.Parcel; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * XmlItem */ @@ -1062,5 +1081,117 @@ public XmlItem[] newArray(int size) { return new XmlItem[size]; } }; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("attribute_string"); + openapiFields.add("attribute_number"); + openapiFields.add("attribute_integer"); + openapiFields.add("attribute_boolean"); + openapiFields.add("wrapped_array"); + openapiFields.add("name_string"); + openapiFields.add("name_number"); + openapiFields.add("name_integer"); + openapiFields.add("name_boolean"); + openapiFields.add("name_array"); + openapiFields.add("name_wrapped_array"); + openapiFields.add("prefix_string"); + openapiFields.add("prefix_number"); + openapiFields.add("prefix_integer"); + openapiFields.add("prefix_boolean"); + openapiFields.add("prefix_array"); + openapiFields.add("prefix_wrapped_array"); + openapiFields.add("namespace_string"); + openapiFields.add("namespace_number"); + openapiFields.add("namespace_integer"); + openapiFields.add("namespace_boolean"); + openapiFields.add("namespace_array"); + openapiFields.add("namespace_wrapped_array"); + openapiFields.add("prefix_ns_string"); + openapiFields.add("prefix_ns_number"); + openapiFields.add("prefix_ns_integer"); + openapiFields.add("prefix_ns_boolean"); + openapiFields.add("prefix_ns_array"); + openapiFields.add("prefix_ns_wrapped_array"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to XmlItem + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (XmlItem.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in XmlItem is not found in the empty JSON string", XmlItem.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!XmlItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `XmlItem` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!XmlItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'XmlItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(XmlItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, XmlItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public XmlItem read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of XmlItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of XmlItem + * @throws IOException if the JSON string is invalid with respect to XmlItem + */ + public static XmlItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, XmlItem.class); + } + + /** + * Convert an instance of XmlItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES index 67db66f25828..79249be8d257 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES @@ -4,37 +4,48 @@ README.md api/openapi.yaml build.gradle build.sbt -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md docs/Animal.md docs/AnotherFakeApi.md +docs/Apple.md +docs/AppleReq.md docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfNumberOnly.md docs/ArrayTest.md -docs/BigCat.md -docs/BigCatAllOf.md +docs/Banana.md +docs/BananaReq.md +docs/BasquePig.md docs/Capitalization.md docs/Cat.md docs/CatAllOf.md docs/Category.md docs/ClassModel.md docs/Client.md +docs/ComplexQuadrilateral.md +docs/DanishPig.md +docs/DefaultApi.md +docs/DeprecatedObject.md docs/Dog.md docs/DogAllOf.md +docs/Drawing.md docs/EnumArrays.md docs/EnumClass.md docs/EnumTest.md +docs/EquilateralTriangle.md docs/FakeApi.md docs/FakeClassnameTags123Api.md docs/FileSchemaTestClass.md +docs/Foo.md docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/GrandparentAnimal.md docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineResponseDefault.md +docs/IsoscelesTriangle.md +docs/Mammal.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md @@ -43,21 +54,38 @@ docs/ModelFile.md docs/ModelList.md docs/ModelReturn.md docs/Name.md +docs/NullableClass.md +docs/NullableShape.md docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md docs/Order.md docs/OuterComposite.md docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/ParentPet.md docs/Pet.md docs/PetApi.md +docs/PetWithRequiredTags.md +docs/Pig.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md docs/ReadOnlyFirst.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md +docs/Triangle.md +docs/TriangleInterface.md docs/User.md docs/UserApi.md -docs/XmlItem.md +docs/Whale.md +docs/Zebra.md git_push.sh gradle.properties gradle/wrapper/gradle-wrapper.jar @@ -81,6 +109,7 @@ src/main/java/org/openapitools/client/ServerConfiguration.java src/main/java/org/openapitools/client/ServerVariable.java src/main/java/org/openapitools/client/StringUtil.java src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/DefaultApi.java src/main/java/org/openapitools/client/api/FakeApi.java src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java src/main/java/org/openapitools/client/api/PetApi.java @@ -94,34 +123,45 @@ src/main/java/org/openapitools/client/auth/OAuth.java src/main/java/org/openapitools/client/auth/OAuthFlow.java src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java src/main/java/org/openapitools/client/auth/RetryingOAuth.java -src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/Apple.java +src/main/java/org/openapitools/client/model/AppleReq.java src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java src/main/java/org/openapitools/client/model/ArrayTest.java -src/main/java/org/openapitools/client/model/BigCat.java -src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Banana.java +src/main/java/org/openapitools/client/model/BananaReq.java +src/main/java/org/openapitools/client/model/BasquePig.java src/main/java/org/openapitools/client/model/Capitalization.java src/main/java/org/openapitools/client/model/Cat.java src/main/java/org/openapitools/client/model/CatAllOf.java src/main/java/org/openapitools/client/model/Category.java src/main/java/org/openapitools/client/model/ClassModel.java src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +src/main/java/org/openapitools/client/model/DanishPig.java +src/main/java/org/openapitools/client/model/DeprecatedObject.java src/main/java/org/openapitools/client/model/Dog.java src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/Drawing.java src/main/java/org/openapitools/client/model/EnumArrays.java src/main/java/org/openapitools/client/model/EnumClass.java src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/EquilateralTriangle.java src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/Fruit.java +src/main/java/org/openapitools/client/model/FruitReq.java +src/main/java/org/openapitools/client/model/GmFruit.java +src/main/java/org/openapitools/client/model/GrandparentAnimal.java src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/InlineResponseDefault.java +src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +src/main/java/org/openapitools/client/model/Mammal.java src/main/java/org/openapitools/client/model/MapTest.java src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java src/main/java/org/openapitools/client/model/Model200Response.java @@ -130,15 +170,32 @@ src/main/java/org/openapitools/client/model/ModelFile.java src/main/java/org/openapitools/client/model/ModelList.java src/main/java/org/openapitools/client/model/ModelReturn.java src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NullableShape.java src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java src/main/java/org/openapitools/client/model/Order.java src/main/java/org/openapitools/client/model/OuterComposite.java src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/ParentPet.java src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/PetWithRequiredTags.java +src/main/java/org/openapitools/client/model/Pig.java +src/main/java/org/openapitools/client/model/Quadrilateral.java +src/main/java/org/openapitools/client/model/QuadrilateralInterface.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/ScaleneTriangle.java +src/main/java/org/openapitools/client/model/Shape.java +src/main/java/org/openapitools/client/model/ShapeInterface.java +src/main/java/org/openapitools/client/model/ShapeOrNull.java +src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java -src/main/java/org/openapitools/client/model/TypeHolderDefault.java -src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/Triangle.java +src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java -src/main/java/org/openapitools/client/model/XmlItem.java +src/main/java/org/openapitools/client/model/Whale.java +src/main/java/org/openapitools/client/model/Zebra.java diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index 6539220a83c6..50183621bd37 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -91,9 +91,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.call123testSpecialTags(body); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); @@ -114,15 +114,17 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums *FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -154,34 +156,44 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Animal](docs/Animal.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - - [BigCat](docs/BigCat.md) - - [BigCatAllOf](docs/BigCatAllOf.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) + - [BasquePig](docs/BasquePig.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [DanishPig](docs/DanishPig.md) + - [DeprecatedObject](docs/DeprecatedObject.md) - [Dog](docs/Dog.md) - [DogAllOf](docs/DogAllOf.md) + - [Drawing](docs/Drawing.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) + - [EquilateralTriangle](docs/EquilateralTriangle.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) - [FormatTest](docs/FormatTest.md) + - [Fruit](docs/Fruit.md) + - [FruitReq](docs/FruitReq.md) + - [GmFruit](docs/GmFruit.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [Mammal](docs/Mammal.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model200Response](docs/Model200Response.md) @@ -190,18 +202,35 @@ Class | Method | HTTP request | Description - [ModelList](docs/ModelList.md) - [ModelReturn](docs/ModelReturn.md) - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NullableShape](docs/NullableShape.md) - [NumberOnly](docs/NumberOnly.md) + - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) - [Order](docs/Order.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) + - [PetWithRequiredTags](docs/PetWithRequiredTags.md) + - [Pig](docs/Pig.md) + - [Quadrilateral](docs/Quadrilateral.md) + - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [ScaleneTriangle](docs/ScaleneTriangle.md) + - [Shape](docs/Shape.md) + - [ShapeInterface](docs/ShapeInterface.md) + - [ShapeOrNull](docs/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) + - [Triangle](docs/Triangle.md) + - [TriangleInterface](docs/TriangleInterface.md) - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) + - [Whale](docs/Whale.md) + - [Zebra](docs/Zebra.md) ## Documentation for Authorization @@ -219,10 +248,18 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key_query - **Location**: URL query string +### bearer_test + +- **Type**: HTTP basic authentication + ### http_basic_test - **Type**: HTTP basic authentication +### http_signature_test + +- **Type**: HTTP basic authentication + ### petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index 1f1a369ece5f..db801488ccb6 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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: @@ -9,7 +9,30 @@ info: title: OpenAPI Petstore version: 1.0.0 servers: -- url: http://petstore.swagger.io:80/v2 +- description: petstore server + url: http://{server}.swagger.io:{port}/v2 + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: https://localhost:8080/{version} + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable tags: - description: Everything about your Pets name: pet @@ -18,77 +41,65 @@ tags: - description: Operations about user name: user paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_default' + description: response + x-accepts: application/json /pet: post: operationId: addPet requestBody: - 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 + $ref: '#/components/requestBodies/Pet' responses: - "200": - content: {} - description: successful operation "405": - content: {} description: Invalid input security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json put: operationId: updatePet requestBody: - 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 + $ref: '#/components/requestBodies/Pet' responses: - "200": - content: {} - description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - description: Status values that need to be considered for filter + - deprecated: true + description: Status values that need to be considered for filter explode: false in: query name: status @@ -118,9 +129,9 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -144,7 +155,6 @@ paths: items: type: string type: array - uniqueItems: true style: form responses: "200": @@ -154,18 +164,16 @@ paths: items: $ref: '#/components/schemas/Pet' type: array - uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array - uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -177,23 +185,24 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: - "200": - content: {} - description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -208,12 +217,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -225,10 +236,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -240,13 +249,16 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -257,9 +269,9 @@ paths: status: description: Updated status of the pet type: string + type: object responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -275,13 +287,16 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -293,6 +308,7 @@ paths: description: file to upload format: binary type: string + type: object responses: "200": content: @@ -334,7 +350,7 @@ paths: operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -350,13 +366,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /store/order/{order_id}: delete: @@ -365,17 +379,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -387,6 +401,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -395,6 +410,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -406,10 +422,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -421,81 +435,65 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /user/createWithArray: post: operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /user/createWithList: post: operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /user/login: get: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -509,16 +507,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -529,7 +530,6 @@ paths: operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -541,17 +541,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -561,11 +561,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -577,10 +579,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -591,42 +591,36 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /fake_classname_test: patch: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -639,7 +633,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake: @@ -648,44 +641,60 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Someting wrong + security: + - bearer_test: [] summary: Fake endpoint to test group parameters (optional) tags: - fake @@ -699,6 +708,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -709,8 +719,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -718,10 +730,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -732,8 +746,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -741,25 +757,33 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: + $ref: '#/components/requestBodies/inline_object_2' content: application/x-www-form-urlencoded: schema: @@ -781,12 +805,11 @@ paths: - -efg - (xyz) type: string + type: object responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -797,12 +820,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -813,24 +831,23 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json post: - description: |- + description: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: + $ref: '#/components/requestBodies/inline_object_3' content: application/x-www-form-urlencoded: schema: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -881,7 +898,9 @@ paths: format: date type: string dateTime: + default: 2010-02-01T10:20:10.11111+01:00 description: None + example: 2020-02-02T20:20:20.22222Z format: date-time type: string password: @@ -898,21 +917,19 @@ paths: - double - number - pattern_without_delimiter - required: true + type: object responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] - summary: |- + summary: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake x-contentType: application/x-www-form-urlencoded @@ -923,11 +940,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -937,8 +953,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: '*/*' /fake/outer/string: post: @@ -946,11 +961,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -960,8 +974,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: '*/*' /fake/outer/boolean: post: @@ -969,11 +982,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -983,8 +995,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: '*/*' /fake/outer/composite: post: @@ -992,11 +1003,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -1006,13 +1016,13 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: '*/*' /fake/jsonFormData: get: operationId: testJsonFormData requestBody: + $ref: '#/components/requestBodies/inline_object_4' content: application/x-www-form-urlencoded: schema: @@ -1026,10 +1036,9 @@ paths: required: - param - param2 - required: true + type: object responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -1050,23 +1059,23 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-contentType: application/json x-accepts: application/json /fake/body-with-query-params: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1075,60 +1084,17 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-contentType: application/xml - x-accepts: application/json /another-fake/dummy: patch: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1139,7 +1105,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake/body-with-file-schema: @@ -1155,11 +1120,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake/test-query-parameters: @@ -1167,7 +1130,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1176,14 +1139,17 @@ paths: type: string type: array style: form - - in: query + - explode: false + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1211,7 +1177,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1221,13 +1186,16 @@ paths: operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_5' content: multipart/form-data: schema: @@ -1241,7 +1209,7 @@ paths: type: string required: - requiredFile - required: true + type: object responses: "200": content: @@ -1258,14 +1226,116 @@ paths: - pet x-contentType: multipart/form-data x-accepts: application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: application/json + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + x-accepts: application/json components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + 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 + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' + inline_object_2: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_2' + inline_object_3: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_3' + inline_object_4: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_4' + inline_object_5: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_5' schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string Order: example: petId: 6 quantity: 1 id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 + shipDate: 2020-02-02T20:20:20.000222Z complete: false status: placed properties: @@ -1279,6 +1349,7 @@ components: format: int32 type: integer shipDate: + example: 2020-02-02T20:20:20.000222Z format: date-time type: string status: @@ -1316,9 +1387,13 @@ components: lastName: lastName password: password userStatus: 6 + objectWithNoDeclaredPropsNullable: '{}' phone: phone + objectWithNoDeclaredProps: '{}' id: 0 + anyTypePropNullable: "" email: email + anyTypeProp: "" username: username properties: id: @@ -1341,6 +1416,25 @@ components: description: User Status format: int32 type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: test code generation for any type Here the 'type' attribute + is not specified, which means the value can be anything, including the + null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + anyTypePropNullable: + description: test code generation for any type Here the 'type' attribute + is not specified, which means the value can be anything, including the + null value, string, number, boolean, array or object. The 'nullable' attribute + does not change the allowed values. + nullable: true type: object xml: name: User @@ -1387,7 +1481,6 @@ components: items: type: string type: array - uniqueItems: true xml: name: photoUrl wrapped: true @@ -1425,21 +1518,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1459,7 +1543,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1470,7 +1553,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1478,7 +1560,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1486,11 +1567,12 @@ components: Cat: allOf: - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' + Address: + additionalProperties: + type: integer + type: object Animal: discriminator: propertyName: className @@ -1510,13 +1592,14 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 + multipleOf: 2 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1524,6 +1607,7 @@ components: number: maximum: 543.2 minimum: 32.1 + multipleOf: 32.5 type: number float: format: float @@ -1535,20 +1619,24 @@ components: maximum: 123.4 minimum: 67.8 type: number + decimal: + format: number + type: string string: pattern: /[a-z]/i type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ type: string binary: format: binary type: string date: + example: 2020-02-02 format: date type: string dateTime: + example: 2007-12-03T10:15:30+01:00 format: date-time type: string uuid: @@ -1560,8 +1648,14 @@ components: maxLength: 64 minLength: 10 type: string - BigDecimal: - format: number + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: ^\d{10}$ + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: /^image_\d{1,3}$/i type: string required: - byte @@ -1596,6 +1690,11 @@ components: - -1 format: int32 type: integer + enum_integer_only: + enum: + - 2 + - -2 + type: integer enum_number: enum: - 1.1 @@ -1604,141 +1703,69 @@ components: type: number outerEnum: $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' required: - enum_string_required type: object AdditionalPropertiesClass: properties: - map_string: + map_property: additionalProperties: type: string type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: + map_of_map_property: additionalProperties: additionalProperties: type: string type: object type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: type: object - anytype_1: + map_with_undeclared_properties_anytype_2: properties: {} type: object - anytype_2: + map_with_undeclared_properties_anytype_3: + additionalProperties: true type: object - anytype_3: - properties: {} + empty_map: + additionalProperties: false + description: an object with no declared properties and no undeclared properties, + hence it's an empty map. + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string type: object type: object - AdditionalPropertiesString: - additionalProperties: - type: string + MixedPropertiesAndAdditionalPropertiesClass: properties: - name: + uuid: + format: uuid + type: string + dateTime: + format: date-time type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer + List: properties: - name: + "123-list": type: string type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number + Client: + example: + client: client properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: + client: type: string type: object ReadOnlyFirst: @@ -1856,11 +1883,32 @@ components: type: array type: object OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed enum: - placed - approved - delivered type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer OuterComposite: example: my_string: my_string @@ -1910,243 +1958,511 @@ components: description: Test capitalization type: string type: object - TypeHolderDefault: + _special_model.name_: properties: - string_item: - default: what + $special[property.name]: + format: int64 + type: integer + _special_model.name_: type: string - number_item: - type: number - integer_item: + xml: + name: $special[model.name] + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true type: integer - bool_item: - default: true + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true type: boolean - array_item: + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: items: - type: integer + nullable: true + type: object + nullable: true type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object type: object - TypeHolderExample: + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true properties: - string_item: - example: what + cultivar: + pattern: ^[a-zA-Z\s]*$ type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float + origin: + pattern: /^[A-Z\s]*$/i + type: string + type: object + banana: + properties: + lengthCm: type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array + hasTeeth: + type: boolean + className: + type: string required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item + - className type: object - XmlItem: + zebra: + additionalProperties: true properties: - attribute_string: - example: string + type: + enum: + - plains + - mountain + - grevys type: string - xml: - attribute: true - attribute_number: - example: 1.234 + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true + sweet: type: boolean - xml: - attribute: true - wrapped_array: + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: items: - type: integer + $ref: '#/components/schemas/Shape' type: array - xml: - wrapped: true - name_string: - example: string + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: type: string - xml: - name: xml_name_string - name_number: - example: 1.234 + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true items: - type: integer - xml: - name: xml_name_array_item + $ref: '#/components/schemas/Bar' type: array - name_wrapped_array: + type: object + PetWithRequiredTags: + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: items: - type: integer - xml: - name: xml_name_wrapped_array_item + type: string type: array xml: - name: xml_name_wrapped_array + name: photoUrl wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: + tags: items: - type: integer - xml: - prefix: mn + $ref: '#/components/schemas/Tag' type: array xml: - prefix: kl + name: tag wrapped: true - namespace_string: - example: string + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: + required: + - name + - photoUrls + - tags + type: object + xml: + name: Pet + inline_response_default: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + inline_object_2: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) items: - type: integer - xml: - namespace: http://g.com/schema + default: $ + enum: + - '>' + - $ + type: string type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 + type: object + inline_object_3: + properties: + integer: + description: None + maximum: 100 + minimum: 10 type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + inline_object_4: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + inline_object_5: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile type: object - xml: - namespace: http://a.com/schema - prefix: pre Dog_allOf: properties: breed: @@ -2157,16 +2473,6 @@ components: declawed: type: boolean type: object - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object securitySchemes: petstore_auth: flows: @@ -2187,5 +2493,11 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/client/petstore/java/okhttp-gson/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson/docs/AdditionalPropertiesClass.md index f936ebe14261..3d032d4504ad 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/okhttp-gson/docs/AdditionalPropertiesClass.md @@ -7,17 +7,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mapString** | **Map<String, String>** | | [optional] -**mapNumber** | **Map<String, BigDecimal>** | | [optional] -**mapInteger** | **Map<String, Integer>** | | [optional] -**mapBoolean** | **Map<String, Boolean>** | | [optional] -**mapArrayInteger** | **Map<String, List<Integer>>** | | [optional] -**mapArrayAnytype** | **Map<String, List<Object>>** | | [optional] -**mapMapString** | **Map<String, Map<String, String>>** | | [optional] -**mapMapAnytype** | **Map<String, Map<String, Object>>** | | [optional] +**mapProperty** | **Map<String, String>** | | [optional] +**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] **anytype1** | **Object** | | [optional] -**anytype2** | **Object** | | [optional] -**anytype3** | **Object** | | [optional] +**mapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**mapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**mapWithUndeclaredPropertiesAnytype3** | **Map<String, Object>** | | [optional] +**emptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**mapWithUndeclaredPropertiesString** | **Map<String, String>** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md index 0565c2589b3c..149488eff9a0 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **call123testSpecialTags** -> Client call123testSpecialTags(body) +> Client call123testSpecialTags(client) To test special tags @@ -30,9 +30,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.call123testSpecialTags(body); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); @@ -49,7 +49,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Apple.md b/samples/client/petstore/java/okhttp-gson/docs/Apple.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Apple.md rename to samples/client/petstore/java/okhttp-gson/docs/Apple.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AppleReq.md b/samples/client/petstore/java/okhttp-gson/docs/AppleReq.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/AppleReq.md rename to samples/client/petstore/java/okhttp-gson/docs/AppleReq.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Banana.md b/samples/client/petstore/java/okhttp-gson/docs/Banana.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Banana.md rename to samples/client/petstore/java/okhttp-gson/docs/Banana.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BananaReq.md b/samples/client/petstore/java/okhttp-gson/docs/BananaReq.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/BananaReq.md rename to samples/client/petstore/java/okhttp-gson/docs/BananaReq.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BasquePig.md b/samples/client/petstore/java/okhttp-gson/docs/BasquePig.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/BasquePig.md rename to samples/client/petstore/java/okhttp-gson/docs/BasquePig.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCat.md b/samples/client/petstore/java/okhttp-gson/docs/ChildCat.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCat.md rename to samples/client/petstore/java/okhttp-gson/docs/ChildCat.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCatAllOf.md b/samples/client/petstore/java/okhttp-gson/docs/ChildCatAllOf.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCatAllOf.md rename to samples/client/petstore/java/okhttp-gson/docs/ChildCatAllOf.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ComplexQuadrilateral.md b/samples/client/petstore/java/okhttp-gson/docs/ComplexQuadrilateral.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/ComplexQuadrilateral.md rename to samples/client/petstore/java/okhttp-gson/docs/ComplexQuadrilateral.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DanishPig.md b/samples/client/petstore/java/okhttp-gson/docs/DanishPig.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/DanishPig.md rename to samples/client/petstore/java/okhttp-gson/docs/DanishPig.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md b/samples/client/petstore/java/okhttp-gson/docs/DefaultApi.md similarity index 82% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md rename to samples/client/petstore/java/okhttp-gson/docs/DefaultApi.md index c77f189afd06..311c4fa6bbc1 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/DefaultApi.md @@ -32,7 +32,11 @@ public class Example { InlineResponseDefault result = apiInstance.fooGet(); System.out.println(result); } catch (ApiException e) { - + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DeprecatedObject.md b/samples/client/petstore/java/okhttp-gson/docs/DeprecatedObject.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/DeprecatedObject.md rename to samples/client/petstore/java/okhttp-gson/docs/DeprecatedObject.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Drawing.md b/samples/client/petstore/java/okhttp-gson/docs/Drawing.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Drawing.md rename to samples/client/petstore/java/okhttp-gson/docs/Drawing.md diff --git a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md index 6b3aa33fae88..342b462ccc06 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md @@ -10,8 +10,12 @@ Name | Type | Description | Notes **enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] +**enumIntegerOnly** | [**EnumIntegerOnlyEnum**](#EnumIntegerOnlyEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | **OuterEnum** | | [optional] +**outerEnumInteger** | **OuterEnumInteger** | | [optional] +**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] @@ -44,6 +48,15 @@ NUMBER_MINUS_1 | -1 +## Enum: EnumIntegerOnlyEnum + +Name | Value +---- | ----- +NUMBER_2 | 2 +NUMBER_MINUS_2 | -2 + + + ## Enum: EnumNumberEnum Name | Value diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EquilateralTriangle.md b/samples/client/petstore/java/okhttp-gson/docs/EquilateralTriangle.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/EquilateralTriangle.md rename to samples/client/petstore/java/okhttp-gson/docs/EquilateralTriangle.md diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index ed2724757eef..3401bb6eeb03 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -4,15 +4,16 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint [**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 | +[**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums [**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 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**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 @@ -20,13 +21,11 @@ Method | HTTP request | Description [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | - -# **createXmlItem** -> createXmlItem(xmlItem) + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() -creates an XmlItem - -this route creates an XmlItem +Health check endpoint ### Example ```java @@ -43,11 +42,11 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body try { - apiInstance.createXmlItem(xmlItem); + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#createXmlItem"); + System.err.println("Exception when calling FakeApi#fakeHealthGet"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -58,14 +57,11 @@ public class Example { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | +This endpoint does not need any parameter. ### Return type -null (empty response body) +[**HealthCheckResult**](HealthCheckResult.md) ### Authorization @@ -73,13 +69,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - - **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | successful operation | - | +**200** | The instance started successfully | - | # **fakeOuterBooleanSerialize** @@ -135,7 +131,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: */* ### HTTP response details @@ -145,7 +141,7 @@ No authorization required # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -166,9 +162,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -185,7 +181,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -197,7 +193,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: */* ### HTTP response details @@ -259,7 +255,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: */* ### HTTP response details @@ -321,7 +317,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: */* ### HTTP response details @@ -329,9 +325,65 @@ No authorization required |-------------|-------------|------------------| **200** | Output string | - | + +# **getArrayOfEnums** +> List<OuterEnum> getArrayOfEnums() + +Array of Enums + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + List result = apiInstance.getArrayOfEnums(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#getArrayOfEnums"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Got named array of enums | - | + # **testBodyWithFileSchema** -> testBodyWithFileSchema(body) +> testBodyWithFileSchema(fileSchemaTestClass) @@ -352,9 +404,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass | + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | try { - apiInstance.testBodyWithFileSchema(body); + apiInstance.testBodyWithFileSchema(fileSchemaTestClass); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); System.err.println("Status code: " + e.getCode()); @@ -370,7 +422,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -392,7 +444,7 @@ No authorization required # **testBodyWithQueryParams** -> testBodyWithQueryParams(query, body) +> testBodyWithQueryParams(query, user) @@ -412,9 +464,9 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); String query = "query_example"; // String | - User body = new User(); // User | + User user = new User(); // User | try { - apiInstance.testBodyWithQueryParams(query, body); + apiInstance.testBodyWithQueryParams(query, user); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); System.err.println("Status code: " + e.getCode()); @@ -431,7 +483,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **String**| | - **body** | [**User**](User.md)| | + **user** | [**User**](User.md)| | ### Return type @@ -453,7 +505,7 @@ No authorization required # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -474,9 +526,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -493,7 +545,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -517,9 +569,9 @@ No authorization required # **testEndpointParameters** > testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```java @@ -553,7 +605,7 @@ public class Example { String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None LocalDate date = LocalDate.now(); // LocalDate | None - OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None + OffsetDateTime dateTime = OffsetDateTime.parse("OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))"); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None try { @@ -584,7 +636,7 @@ Name | Type | Description | Notes **string** | **String**| None | [optional] **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] + **dateTime** | **OffsetDateTime**| None | [optional] [default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))] **password** | **String**| None | [optional] **paramCallback** | **String**| None | [optional] @@ -697,6 +749,7 @@ Fake endpoint to test group parameters (optional) import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.FakeApi; @@ -704,6 +757,10 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); FakeApi apiInstance = new FakeApi(defaultClient); Integer requiredStringGroup = 56; // Integer | Required String in group parameters @@ -746,7 +803,7 @@ null (empty response body) ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers @@ -760,7 +817,7 @@ No authorization required # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties @@ -779,9 +836,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - Map param = new HashMap(); // Map | request body + Map requestBody = new HashMap(); // Map | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); System.err.println("Status code: " + e.getCode()); @@ -797,7 +854,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**Map<String, String>**](String.md)| request body | + **requestBody** | [**Map<String, String>**](String.md)| request body | ### Return type diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md index bd934e360718..dbd12c37f053 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -37,9 +37,9 @@ public class Example { //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -56,7 +56,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Foo.md b/samples/client/petstore/java/okhttp-gson/docs/Foo.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Foo.md rename to samples/client/petstore/java/okhttp-gson/docs/Foo.md diff --git a/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md index a35f0b3962c4..91da637f0880 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **number** | **BigDecimal** | | **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] +**decimal** | **BigDecimal** | | [optional] **string** | **String** | | [optional] **_byte** | **byte[]** | | **binary** | **File** | | [optional] @@ -20,7 +21,8 @@ Name | Type | Description | Notes **dateTime** | **OffsetDateTime** | | [optional] **uuid** | **UUID** | | [optional] **password** | **String** | | -**bigDecimal** | **BigDecimal** | | [optional] +**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] diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Fruit.md b/samples/client/petstore/java/okhttp-gson/docs/Fruit.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Fruit.md rename to samples/client/petstore/java/okhttp-gson/docs/Fruit.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FruitReq.md b/samples/client/petstore/java/okhttp-gson/docs/FruitReq.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/FruitReq.md rename to samples/client/petstore/java/okhttp-gson/docs/FruitReq.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md b/samples/client/petstore/java/okhttp-gson/docs/GmFruit.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md rename to samples/client/petstore/java/okhttp-gson/docs/GmFruit.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GrandparentAnimal.md b/samples/client/petstore/java/okhttp-gson/docs/GrandparentAnimal.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/GrandparentAnimal.md rename to samples/client/petstore/java/okhttp-gson/docs/GrandparentAnimal.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/HealthCheckResult.md b/samples/client/petstore/java/okhttp-gson/docs/HealthCheckResult.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/HealthCheckResult.md rename to samples/client/petstore/java/okhttp-gson/docs/HealthCheckResult.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/InlineResponseDefault.md b/samples/client/petstore/java/okhttp-gson/docs/InlineResponseDefault.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/InlineResponseDefault.md rename to samples/client/petstore/java/okhttp-gson/docs/InlineResponseDefault.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/IsoscelesTriangle.md b/samples/client/petstore/java/okhttp-gson/docs/IsoscelesTriangle.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/IsoscelesTriangle.md rename to samples/client/petstore/java/okhttp-gson/docs/IsoscelesTriangle.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Mammal.md b/samples/client/petstore/java/okhttp-gson/docs/Mammal.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Mammal.md rename to samples/client/petstore/java/okhttp-gson/docs/Mammal.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableClass.md b/samples/client/petstore/java/okhttp-gson/docs/NullableClass.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableClass.md rename to samples/client/petstore/java/okhttp-gson/docs/NullableClass.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableShape.md b/samples/client/petstore/java/okhttp-gson/docs/NullableShape.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableShape.md rename to samples/client/petstore/java/okhttp-gson/docs/NullableShape.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java/okhttp-gson/docs/ObjectWithDeprecatedFields.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/ObjectWithDeprecatedFields.md rename to samples/client/petstore/java/okhttp-gson/docs/ObjectWithDeprecatedFields.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/okhttp-gson/docs/OuterEnumDefaultValue.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumDefaultValue.md rename to samples/client/petstore/java/okhttp-gson/docs/OuterEnumDefaultValue.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumInteger.md b/samples/client/petstore/java/okhttp-gson/docs/OuterEnumInteger.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumInteger.md rename to samples/client/petstore/java/okhttp-gson/docs/OuterEnumInteger.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/okhttp-gson/docs/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumIntegerDefaultValue.md rename to samples/client/petstore/java/okhttp-gson/docs/OuterEnumIntegerDefaultValue.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ParentPet.md b/samples/client/petstore/java/okhttp-gson/docs/ParentPet.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/ParentPet.md rename to samples/client/petstore/java/okhttp-gson/docs/ParentPet.md diff --git a/samples/client/petstore/java/okhttp-gson/docs/Pet.md b/samples/client/petstore/java/okhttp-gson/docs/Pet.md index e9116d637187..8aab74536872 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Pet.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Pet.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **Set<String>** | | +**photoUrls** | **List<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md index d1aa160676c1..c71036f88afa 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store @@ -36,14 +36,15 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); System.err.println("Status code: " + e.getCode()); @@ -59,7 +60,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -67,7 +68,7 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -77,7 +78,6 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | successful operation | - | **405** | Invalid input | - | @@ -144,7 +144,6 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | successful operation | - | **400** | Invalid pet value | - | @@ -170,6 +169,7 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); @@ -202,7 +202,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -217,7 +217,7 @@ Name | Type | Description | Notes # **findPetsByTags** -> Set<Pet> findPetsByTags(tags) +> List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -238,14 +238,15 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Set tags = Arrays.asList(); // Set | Tags to filter by + List tags = Arrays.asList(); // List | Tags to filter by try { - Set result = apiInstance.findPetsByTags(tags); + List result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -262,15 +263,15 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**Set<String>**](String.md)| Tags to filter by | + **tags** | [**List<String>**](String.md)| Tags to filter by | ### Return type -[**Set<Pet>**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -356,7 +357,7 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet @@ -375,14 +376,15 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); System.err.println("Status code: " + e.getCode()); @@ -398,7 +400,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -406,7 +408,7 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -416,7 +418,6 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | successful operation | - | **400** | Invalid ID supplied | - | **404** | Pet not found | - | **405** | Validation exception | - | diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md b/samples/client/petstore/java/okhttp-gson/docs/PetWithRequiredTags.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md rename to samples/client/petstore/java/okhttp-gson/docs/PetWithRequiredTags.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pig.md b/samples/client/petstore/java/okhttp-gson/docs/Pig.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Pig.md rename to samples/client/petstore/java/okhttp-gson/docs/Pig.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md b/samples/client/petstore/java/okhttp-gson/docs/Pineapple.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md rename to samples/client/petstore/java/okhttp-gson/docs/Pineapple.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Quadrilateral.md b/samples/client/petstore/java/okhttp-gson/docs/Quadrilateral.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Quadrilateral.md rename to samples/client/petstore/java/okhttp-gson/docs/Quadrilateral.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/QuadrilateralInterface.md b/samples/client/petstore/java/okhttp-gson/docs/QuadrilateralInterface.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/QuadrilateralInterface.md rename to samples/client/petstore/java/okhttp-gson/docs/QuadrilateralInterface.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ScaleneTriangle.md b/samples/client/petstore/java/okhttp-gson/docs/ScaleneTriangle.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/ScaleneTriangle.md rename to samples/client/petstore/java/okhttp-gson/docs/ScaleneTriangle.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Shape.md b/samples/client/petstore/java/okhttp-gson/docs/Shape.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Shape.md rename to samples/client/petstore/java/okhttp-gson/docs/Shape.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeInterface.md b/samples/client/petstore/java/okhttp-gson/docs/ShapeInterface.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeInterface.md rename to samples/client/petstore/java/okhttp-gson/docs/ShapeInterface.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeOrNull.md b/samples/client/petstore/java/okhttp-gson/docs/ShapeOrNull.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeOrNull.md rename to samples/client/petstore/java/okhttp-gson/docs/ShapeOrNull.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/SimpleQuadrilateral.md b/samples/client/petstore/java/okhttp-gson/docs/SimpleQuadrilateral.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/SimpleQuadrilateral.md rename to samples/client/petstore/java/okhttp-gson/docs/SimpleQuadrilateral.md diff --git a/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md index 2692c1caafe1..352611142df0 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md +++ b/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **$specialPropertyName** | **Long** | | [optional] +**specialModelName** | **String** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md index a86b478e55ab..270388f5e444 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md @@ -203,7 +203,7 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet @@ -222,9 +222,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); - Order body = new Order(); // Order | order placed for purchasing the pet + Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -241,7 +241,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -253,7 +253,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/xml, application/json ### HTTP response details diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Triangle.md b/samples/client/petstore/java/okhttp-gson/docs/Triangle.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Triangle.md rename to samples/client/petstore/java/okhttp-gson/docs/Triangle.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/TriangleInterface.md b/samples/client/petstore/java/okhttp-gson/docs/TriangleInterface.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/TriangleInterface.md rename to samples/client/petstore/java/okhttp-gson/docs/TriangleInterface.md diff --git a/samples/client/petstore/java/okhttp-gson/docs/User.md b/samples/client/petstore/java/okhttp-gson/docs/User.md index 05ec5fb40b8f..c29bce5c1261 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/User.md +++ b/samples/client/petstore/java/okhttp-gson/docs/User.md @@ -15,6 +15,10 @@ Name | Type | Description | Notes **password** | **String** | | [optional] **phone** | **String** | | [optional] **userStatus** | **Integer** | User Status | [optional] +**objectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**objectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**anyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**anyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md index 7a90fb438b19..26a0642e3235 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -37,9 +37,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - User body = new User(); // User | Created user object + User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); System.err.println("Status code: " + e.getCode()); @@ -55,7 +55,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -67,7 +67,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined ### HTTP response details @@ -77,7 +77,7 @@ No authorization required # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array @@ -96,9 +96,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(); // List | List of user object + List user = Arrays.asList(); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); System.err.println("Status code: " + e.getCode()); @@ -114,7 +114,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -126,7 +126,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined ### HTTP response details @@ -136,7 +136,7 @@ No authorization required # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array @@ -155,9 +155,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(); // List | List of user object + List user = Arrays.asList(); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); System.err.println("Status code: " + e.getCode()); @@ -173,7 +173,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -185,7 +185,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined ### HTTP response details @@ -437,7 +437,7 @@ No authorization required # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -459,9 +459,9 @@ public class Example { UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | name that need to be deleted - User body = new User(); // User | Updated user object + User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); System.err.println("Status code: " + e.getCode()); @@ -478,7 +478,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -490,7 +490,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined ### HTTP response details diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Whale.md b/samples/client/petstore/java/okhttp-gson/docs/Whale.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Whale.md rename to samples/client/petstore/java/okhttp-gson/docs/Whale.md diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Zebra.md b/samples/client/petstore/java/okhttp-gson/docs/Zebra.md similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/docs/Zebra.md rename to samples/client/petstore/java/okhttp-gson/docs/Zebra.md diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index 43e3d9f548f1..71729a41614a 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -306,6 +306,16 @@ jackson-databind-nullable ${jackson-databind-nullable-version} + + javax.ws.rs + jsr311-api + 1.1.1 + + + javax.ws.rs + javax.ws.rs-api + 2.0 + junit diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index 499d1d864e82..0336656f5c42 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -97,7 +97,9 @@ public ApiClient() { // Setup authentications (key: authentication name, value: authentication). authentications.put("api_key", new ApiKeyAuth("header", "api_key")); authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("bearer_test", new HttpBearerAuth("bearer")); authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("http_signature_test", new HttpBearerAuth("signature")); authentications.put("petstore_auth", new OAuth()); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); @@ -116,7 +118,9 @@ public ApiClient(OkHttpClient client) { // Setup authentications (key: authentication name, value: authentication). authentications.put("api_key", new ApiKeyAuth("header", "api_key")); authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("bearer_test", new HttpBearerAuth("bearer")); authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("http_signature_test", new HttpBearerAuth("signature")); authentications.put("petstore_auth", new OAuth()); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); @@ -185,7 +189,9 @@ public ApiClient(String basePath, String clientId, String clientSecret, Map T handleResponse(Response response, Type returnType) throws ApiExcept /** * Build HTTP call with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1192,6 +1212,7 @@ public Call buildCall(String baseUrl, String path, String method, List que /** * Build an HTTP request with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1260,6 +1281,7 @@ public Request buildRequest(String baseUrl, String path, String method, List cookieParams, Request.Builde * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiException.java index 5851f0405ade..60e4f9a5e7e6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiException.java @@ -16,6 +16,8 @@ import java.util.Map; import java.util.List; +import javax.ws.rs.core.GenericType; + /** *

    ApiException class.

    */ @@ -25,6 +27,8 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorObject = null; + private GenericType errorObjectType = null; /** *

    Constructor for ApiException.

    @@ -151,4 +155,40 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the error object type. + * + * @return Error object type + */ + public GenericType getErrorObjectType() { + return errorObjectType; + } + + /** + * Set the error object type. + * + * @param errorObjectType object type + */ + public void setErrorObjectType(GenericType errorObjectType) { + this.errorObjectType = errorObjectType; + } + + /** + * Get the error object. + * + * @return Error object + */ + public Object getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject(Object errorObject) { + this.errorObject = errorObject; + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index 274416e5dedc..a4a6807e3781 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -27,7 +27,6 @@ import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; -import org.openapitools.client.model.*; import okio.ByteString; import java.io.IOException; @@ -41,57 +40,150 @@ import java.util.Map; import java.util.HashMap; +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() - .registerTypeSelector(Animal.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.Animal.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); + classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); + classByDiscriminatorValue.put("Animal", org.openapitools.client.model.Animal.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "className")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Cat.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BigCat", BigCat.class); - classByDiscriminatorValue.put("Cat", Cat.class); - classByDiscriminatorValue.put("Dog", Dog.class); - classByDiscriminatorValue.put("Animal", Animal.class); + classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } }) - .registerTypeSelector(BigCat.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.Dog.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BigCat", BigCat.class); + classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } }) - .registerTypeSelector(Cat.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.GrandparentAnimal.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("ParentPet", org.openapitools.client.model.ParentPet.class); + classByDiscriminatorValue.put("GrandparentAnimal", org.openapitools.client.model.GrandparentAnimal.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "pet_type")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Mammal.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("BigCat", BigCat.class); - classByDiscriminatorValue.put("Cat", Cat.class); + classByDiscriminatorValue.put("Pig", org.openapitools.client.model.Pig.class); + classByDiscriminatorValue.put("whale", org.openapitools.client.model.Whale.class); + classByDiscriminatorValue.put("zebra", org.openapitools.client.model.Zebra.class); + classByDiscriminatorValue.put("mammal", org.openapitools.client.model.Mammal.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } }) - .registerTypeSelector(Dog.class, new TypeSelector() { + .registerTypeSelector(org.openapitools.client.model.NullableShape.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); + classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); + classByDiscriminatorValue.put("NullableShape", org.openapitools.client.model.NullableShape.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "shapeType")); + } + }) + .registerTypeSelector(org.openapitools.client.model.ParentPet.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("ParentPet", org.openapitools.client.model.ParentPet.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "pet_type")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Pig.class, new TypeSelector() { @Override - public Class getClassForElement(JsonElement readElement) { + public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); - classByDiscriminatorValue.put("Dog", Dog.class); + classByDiscriminatorValue.put("BasquePig", org.openapitools.client.model.BasquePig.class); + classByDiscriminatorValue.put("DanishPig", org.openapitools.client.model.DanishPig.class); + classByDiscriminatorValue.put("Pig", org.openapitools.client.model.Pig.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } + }) + .registerTypeSelector(org.openapitools.client.model.Quadrilateral.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("ComplexQuadrilateral", org.openapitools.client.model.ComplexQuadrilateral.class); + classByDiscriminatorValue.put("SimpleQuadrilateral", org.openapitools.client.model.SimpleQuadrilateral.class); + classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "quadrilateralType")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Shape.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); + classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); + classByDiscriminatorValue.put("Shape", org.openapitools.client.model.Shape.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "shapeType")); + } + }) + .registerTypeSelector(org.openapitools.client.model.ShapeOrNull.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); + classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); + classByDiscriminatorValue.put("ShapeOrNull", org.openapitools.client.model.ShapeOrNull.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "shapeType")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Triangle.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("EquilateralTriangle", org.openapitools.client.model.EquilateralTriangle.class); + classByDiscriminatorValue.put("IsoscelesTriangle", org.openapitools.client.model.IsoscelesTriangle.class); + classByDiscriminatorValue.put("ScaleneTriangle", org.openapitools.client.model.ScaleneTriangle.class); + classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "triangleType")); + } }) ; GsonBuilder builder = fireBuilder.createGsonBuilder(); @@ -121,13 +213,81 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - public JSON() { + { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(byte[].class, byteArrayAdapter) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Apple.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AppleReq.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfArrayOfNumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfNumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Banana.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.BananaReq.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.BasquePig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Capitalization.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Cat.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.CatAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Category.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ClassModel.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Client.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ComplexQuadrilateral.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.DanishPig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.DeprecatedObject.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Dog.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.DogAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Drawing.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EnumArrays.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EquilateralTriangle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FileSchemaTestClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Foo.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FormatTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Fruit.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FruitReq.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.GmFruit.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.HasOnlyReadOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.HealthCheckResult.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.InlineResponseDefault.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.IsoscelesTriangle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Mammal.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.MapTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.MixedPropertiesAndAdditionalPropertiesClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Model200Response.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelApiResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelFile.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelList.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelReturn.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Name.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.NullableClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.NullableShape.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.NumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ObjectWithDeprecatedFields.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Order.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.OuterComposite.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.PetWithRequiredTags.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ReadOnlyFirst.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ScaleneTriangle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Shape.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ShapeInterface.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ShapeOrNull.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.SimpleQuadrilateral.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.SpecialModelName.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Triangle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.TriangleInterface.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.User.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Whale.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Zebra.CustomTypeAdapterFactory()) .create(); } @@ -136,7 +296,7 @@ public JSON() { * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -144,23 +304,13 @@ public Gson getGson() { * Set Gson. * * @param gson Gson - * @return JSON */ - public JSON setGson(Gson gson) { - this.gson = gson; - return this; + public static void setGson(Gson gson) { + JSON.gson = gson; } - /** - * Configure the parser to be liberal in what it accepts. - * - * @param lenientOnJson Set it to true to ignore some syntax errors - * @return JSON - * @see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html - */ - public JSON setLenientOnJson(boolean lenientOnJson) { + public static void setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; - return this; } /** @@ -169,7 +319,7 @@ public JSON setLenientOnJson(boolean lenientOnJson) { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -182,11 +332,11 @@ public String serialize(Object obj) { * @return The deserialized Java object */ @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { @@ -206,7 +356,7 @@ public T deserialize(String body, Type returnType) { /** * Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { + public static class ByteArrayAdapter extends TypeAdapter { @Override public void write(JsonWriter out, byte[] value) throws IOException { @@ -278,7 +428,7 @@ public OffsetDateTime read(JsonReader in) throws IOException { /** * Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -316,14 +466,12 @@ public LocalDate read(JsonReader in) throws IOException { } } - public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); - return this; } /** @@ -437,14 +585,11 @@ public Date read(JsonReader in) throws IOException { } } - public JSON setDateFormat(DateFormat dateFormat) { + public static void setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); - return this; } - public JSON setSqlDateFormat(DateFormat dateFormat) { + public static void setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); - return this; } - } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 5789ec8083be..0c245e718f44 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class AnotherFakeApi { private ApiClient localVarApiClient; @@ -74,7 +75,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for call123testSpecialTags - * @param body client model (required) + * @param client client model (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -84,9 +85,8 @@ public void setCustomBaseUrl(String customBaseUrl) { 200 successful operation - */ - public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call call123testSpecialTagsCall(Client client, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -99,7 +99,7 @@ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _c basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = client; // create path and map variables String localVarPath = "/another-fake/dummy"; @@ -131,15 +131,15 @@ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _c } @SuppressWarnings("rawtypes") - private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling call123testSpecialTags(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling call123testSpecialTags(Async)"); } - okhttp3.Call localVarCall = call123testSpecialTagsCall(body, _callback); + okhttp3.Call localVarCall = call123testSpecialTagsCall(client, _callback); return localVarCall; } @@ -147,7 +147,7 @@ private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client body, final /** * To test special tags * To test special tags and operation ID starting with number - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -156,15 +156,15 @@ private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client body, final 200 successful operation - */ - public Client call123testSpecialTags(Client body) throws ApiException { - ApiResponse localVarResp = call123testSpecialTagsWithHttpInfo(body); + public Client call123testSpecialTags(Client client) throws ApiException { + ApiResponse localVarResp = call123testSpecialTagsWithHttpInfo(client); return localVarResp.getData(); } /** * To test special tags * To test special tags and operation ID starting with number - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -173,16 +173,22 @@ public Client call123testSpecialTags(Client body) throws ApiException { 200 successful operation - */ - public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throws ApiException { - okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { + okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(client, null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** * To test special tags (asynchronously) * To test special tags and operation ID starting with number - * @param body client model (required) + * @param client client model (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -192,9 +198,9 @@ public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throw 200 successful operation - */ - public okhttp3.Call call123testSpecialTagsAsync(Client body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call call123testSpecialTagsAsync(Client client, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(client, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java similarity index 85% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java index 7741b8200a9c..4a11f75dddf0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -38,6 +38,8 @@ public class DefaultApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public DefaultApi() { this(Configuration.getDefaultApiClient()); @@ -55,6 +57,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for fooGet * @param _callback Callback for upload/download progress @@ -67,6 +85,19 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call fooGetCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -95,7 +126,7 @@ public okhttp3.Call fooGetCall(final ApiCallback _callback) throws ApiException } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 450dbb1a5b7a..90c0357a07be 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -31,17 +31,19 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterEnum; import org.openapitools.client.model.User; -import org.openapitools.client.model.XmlItem; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeApi { private ApiClient localVarApiClient; @@ -81,20 +83,18 @@ public void setCustomBaseUrl(String customBaseUrl) { } /** - * Build call for createXmlItem - * @param xmlItem XmlItem Body (required) + * Build call for fakeHealthGet * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
    Status Code Description Response Headers
    200 successful operation -
    200 The instance started successfully -
    */ - public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { + public okhttp3.Call fakeHealthGetCall(final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -107,10 +107,10 @@ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callba basePath = null; } - Object localVarPostBody = xmlItem; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fake/create_xml_item"; + String localVarPath = "/fake/health"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -119,7 +119,7 @@ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callba Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -127,7 +127,7 @@ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callba } final String[] localVarContentTypes = { - "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -135,72 +135,74 @@ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callba } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createXmlItemValidateBeforeCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'xmlItem' is set - if (xmlItem == null) { - throw new ApiException("Missing the required parameter 'xmlItem' when calling createXmlItem(Async)"); - } + private okhttp3.Call fakeHealthGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createXmlItemCall(xmlItem, _callback); + okhttp3.Call localVarCall = fakeHealthGetCall(_callback); return localVarCall; } /** - * creates an XmlItem - * this route creates an XmlItem - * @param xmlItem XmlItem Body (required) + * Health check endpoint + * + * @return HealthCheckResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
    Status Code Description Response Headers
    200 successful operation -
    200 The instance started successfully -
    */ - public void createXmlItem(XmlItem xmlItem) throws ApiException { - createXmlItemWithHttpInfo(xmlItem); + public HealthCheckResult fakeHealthGet() throws ApiException { + ApiResponse localVarResp = fakeHealthGetWithHttpInfo(); + return localVarResp.getData(); } /** - * creates an XmlItem - * this route creates an XmlItem - * @param xmlItem XmlItem Body (required) - * @return ApiResponse<Void> + * Health check endpoint + * + * @return ApiResponse<HealthCheckResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
    Status Code Description Response Headers
    200 successful operation -
    200 The instance started successfully -
    */ - public ApiResponse createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiException { - okhttp3.Call localVarCall = createXmlItemValidateBeforeCall(xmlItem, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = fakeHealthGetValidateBeforeCall(null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** - * creates an XmlItem (asynchronously) - * this route creates an XmlItem - * @param xmlItem XmlItem Body (required) + * Health check endpoint (asynchronously) + * * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - +
    Status Code Description Response Headers
    200 successful operation -
    200 The instance started successfully -
    */ - public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { + public okhttp3.Call fakeHealthGetAsync(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createXmlItemValidateBeforeCall(xmlItem, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = fakeHealthGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** @@ -217,7 +219,6 @@ public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback */ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -250,7 +251,7 @@ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallbac } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -301,8 +302,14 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -327,7 +334,7 @@ public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallba } /** * Build call for fakeOuterCompositeSerialize - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -337,9 +344,8 @@ public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallba 200 Output composite - */ - public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -352,7 +358,7 @@ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final A basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = outerComposite; // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -372,7 +378,7 @@ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final A } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -384,10 +390,10 @@ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final A } @SuppressWarnings("rawtypes") - private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = fakeOuterCompositeSerializeCall(body, _callback); + okhttp3.Call localVarCall = fakeOuterCompositeSerializeCall(outerComposite, _callback); return localVarCall; } @@ -395,7 +401,7 @@ private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposit /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -404,15 +410,15 @@ private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposit 200 Output composite - */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - ApiResponse localVarResp = fakeOuterCompositeSerializeWithHttpInfo(body); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + ApiResponse localVarResp = fakeOuterCompositeSerializeWithHttpInfo(outerComposite); return localVarResp.getData(); } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return ApiResponse<OuterComposite> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -421,16 +427,22 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Ap 200 Output composite - */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { + okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** * (asynchronously) * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -440,9 +452,9 @@ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(Outer 200 Output composite - */ - public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -461,7 +473,6 @@ public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final */ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -494,7 +505,7 @@ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallb } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -545,8 +556,14 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -583,7 +600,6 @@ public okhttp3.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCall */ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -616,7 +632,7 @@ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -667,8 +683,14 @@ public String fakeOuterStringSerialize(String body) throws ApiException { */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { okhttp3.Call localVarCall = fakeOuterStringSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -691,9 +713,132 @@ public okhttp3.Call fakeOuterStringSerializeAsync(String body, final ApiCallback localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getArrayOfEnums + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Got named array of enums -
    + */ + public okhttp3.Call getArrayOfEnumsCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/array-of-enums"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getArrayOfEnumsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getArrayOfEnumsCall(_callback); + return localVarCall; + + } + + /** + * Array of Enums + * + * @return List<OuterEnum> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Got named array of enums -
    + */ + public List getArrayOfEnums() throws ApiException { + ApiResponse> localVarResp = getArrayOfEnumsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Array of Enums + * + * @return ApiResponse<List<OuterEnum>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Got named array of enums -
    + */ + public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getArrayOfEnumsValidateBeforeCall(null); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } + } + + /** + * Array of Enums (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Got named array of enums -
    + */ + public okhttp3.Call getArrayOfEnumsAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getArrayOfEnumsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for testBodyWithFileSchema - * @param body (required) + * @param fileSchemaTestClass (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -703,9 +848,8 @@ public okhttp3.Call fakeOuterStringSerializeAsync(String body, final ApiCallback 200 Success - */ - public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -718,7 +862,7 @@ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final A basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = fileSchemaTestClass; // create path and map variables String localVarPath = "/fake/body-with-file-schema"; @@ -750,15 +894,15 @@ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final A } @SuppressWarnings("rawtypes") - private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testBodyWithFileSchema(Async)"); + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) { + throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)"); } - okhttp3.Call localVarCall = testBodyWithFileSchemaCall(body, _callback); + okhttp3.Call localVarCall = testBodyWithFileSchemaCall(fileSchemaTestClass, _callback); return localVarCall; } @@ -766,7 +910,7 @@ private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClas /** * * For this test, the body for this request much reference a schema named `File`. - * @param body (required) + * @param fileSchemaTestClass (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -774,14 +918,14 @@ private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClas
    200 Success -
    */ - public void testBodyWithFileSchema(FileSchemaTestClass body) throws ApiException { - testBodyWithFileSchemaWithHttpInfo(body); + public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException { + testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); } /** * * For this test, the body for this request much reference a schema named `File`. - * @param body (required) + * @param fileSchemaTestClass (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -790,15 +934,15 @@ public void testBodyWithFileSchema(FileSchemaTestClass body) throws ApiException 200 Success - */ - public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws ApiException { - okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(body, null); + public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException { + okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, null); return localVarApiClient.execute(localVarCall); } /** * (asynchronously) * For this test, the body for this request much reference a schema named `File`. - * @param body (required) + * @param fileSchemaTestClass (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -808,16 +952,16 @@ public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass 200 Success - */ - public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for testBodyWithQueryParams * @param query (required) - * @param body (required) + * @param user (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -827,9 +971,8 @@ public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass body, final 200 Success - */ - public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testBodyWithQueryParamsCall(String query, User user, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -842,7 +985,7 @@ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final A basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = user; // create path and map variables String localVarPath = "/fake/body-with-query-params"; @@ -878,20 +1021,20 @@ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final A } @SuppressWarnings("rawtypes") - private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, User body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, User user, final ApiCallback _callback) throws ApiException { // verify the required parameter 'query' is set if (query == null) { throw new ApiException("Missing the required parameter 'query' when calling testBodyWithQueryParams(Async)"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testBodyWithQueryParams(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling testBodyWithQueryParams(Async)"); } - okhttp3.Call localVarCall = testBodyWithQueryParamsCall(query, body, _callback); + okhttp3.Call localVarCall = testBodyWithQueryParamsCall(query, user, _callback); return localVarCall; } @@ -900,7 +1043,7 @@ private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, Use * * * @param query (required) - * @param body (required) + * @param user (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -908,15 +1051,15 @@ private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, Use
    200 Success -
    */ - public void testBodyWithQueryParams(String query, User body) throws ApiException { - testBodyWithQueryParamsWithHttpInfo(query, body); + public void testBodyWithQueryParams(String query, User user) throws ApiException { + testBodyWithQueryParamsWithHttpInfo(query, user); } /** * * * @param query (required) - * @param body (required) + * @param user (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -925,8 +1068,8 @@ public void testBodyWithQueryParams(String query, User body) throws ApiException 200 Success - */ - public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User body) throws ApiException { - okhttp3.Call localVarCall = testBodyWithQueryParamsValidateBeforeCall(query, body, null); + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { + okhttp3.Call localVarCall = testBodyWithQueryParamsValidateBeforeCall(query, user, null); return localVarApiClient.execute(localVarCall); } @@ -934,7 +1077,7 @@ public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User * (asynchronously) * * @param query (required) - * @param body (required) + * @param user (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -944,15 +1087,15 @@ public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User 200 Success - */ - public okhttp3.Call testBodyWithQueryParamsAsync(String query, User body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testBodyWithQueryParamsAsync(String query, User user, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = testBodyWithQueryParamsValidateBeforeCall(query, body, _callback); + okhttp3.Call localVarCall = testBodyWithQueryParamsValidateBeforeCall(query, user, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for testClientModel - * @param body client model (required) + * @param client client model (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -962,9 +1105,8 @@ public okhttp3.Call testBodyWithQueryParamsAsync(String query, User body, final 200 successful operation - */ - public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testClientModelCall(Client client, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -977,7 +1119,7 @@ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = client; // create path and map variables String localVarPath = "/fake"; @@ -1009,15 +1151,15 @@ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback } @SuppressWarnings("rawtypes") - private okhttp3.Call testClientModelValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call testClientModelValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClientModel(Async)"); } - okhttp3.Call localVarCall = testClientModelCall(body, _callback); + okhttp3.Call localVarCall = testClientModelCall(client, _callback); return localVarCall; } @@ -1025,7 +1167,7 @@ private okhttp3.Call testClientModelValidateBeforeCall(Client body, final ApiCal /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1034,15 +1176,15 @@ private okhttp3.Call testClientModelValidateBeforeCall(Client body, final ApiCal 200 successful operation - */ - public Client testClientModel(Client body) throws ApiException { - ApiResponse localVarResp = testClientModelWithHttpInfo(body); + public Client testClientModel(Client client) throws ApiException { + ApiResponse localVarResp = testClientModelWithHttpInfo(client); return localVarResp.getData(); } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1051,16 +1193,22 @@ public Client testClientModel(Client body) throws ApiException { 200 successful operation - */ - public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - okhttp3.Call localVarCall = testClientModelValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + okhttp3.Call localVarCall = testClientModelValidateBeforeCall(client, null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** * To test \"client\" model (asynchronously) * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1070,9 +1218,9 @@ public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiEx 200 successful operation - */ - public okhttp3.Call testClientModelAsync(Client body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testClientModelAsync(Client client, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = testClientModelValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = testClientModelValidateBeforeCall(client, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -1090,7 +1238,7 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback * @param string None (optional) * @param binary None (optional) * @param date None (optional) - * @param dateTime None (optional) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) * @param password None (optional) * @param paramCallback None (optional) * @param _callback Callback for upload/download progress @@ -1105,7 +1253,6 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1235,8 +1382,8 @@ private okhttp3.Call testEndpointParametersValidateBeforeCall(BigDecimal number, } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param number None (required) * @param _double None (required) * @param patternWithoutDelimiter None (required) @@ -1248,7 +1395,7 @@ private okhttp3.Call testEndpointParametersValidateBeforeCall(BigDecimal number, * @param string None (optional) * @param binary None (optional) * @param date None (optional) - * @param dateTime None (optional) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) * @param password None (optional) * @param paramCallback None (optional) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1264,8 +1411,8 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param number None (required) * @param _double None (required) * @param patternWithoutDelimiter None (required) @@ -1277,7 +1424,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @param string None (optional) * @param binary None (optional) * @param date None (optional) - * @param dateTime None (optional) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) * @param password None (optional) * @param paramCallback None (optional) * @return ApiResponse<Void> @@ -1295,8 +1442,8 @@ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, D } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 (asynchronously) - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 (asynchronously) + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param number None (required) * @param _double None (required) * @param patternWithoutDelimiter None (required) @@ -1308,7 +1455,7 @@ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, D * @param string None (optional) * @param binary None (optional) * @param date None (optional) - * @param dateTime None (optional) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) * @param password None (optional) * @param paramCallback None (optional) * @param _callback The callback to be executed when the API call finishes @@ -1349,7 +1496,6 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1382,7 +1528,7 @@ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, S } if (enumQueryStringArray != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); } if (enumQueryString != null) { @@ -1511,7 +1657,6 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1575,7 +1720,7 @@ private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolea localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] { "bearer_test" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -1736,7 +1881,7 @@ public APItestGroupParametersRequest testGroupParameters(Integer requiredStringG } /** * Build call for testInlineAdditionalProperties - * @param param request body (required) + * @param requestBody request body (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1746,9 +1891,8 @@ public APItestGroupParametersRequest testGroupParameters(Integer requiredStringG 200 successful operation - */ - public okhttp3.Call testInlineAdditionalPropertiesCall(Map param, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testInlineAdditionalPropertiesCall(Map requestBody, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1761,7 +1905,7 @@ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param basePath = null; } - Object localVarPostBody = param; + Object localVarPostBody = requestBody; // create path and map variables String localVarPath = "/fake/inline-additionalProperties"; @@ -1793,15 +1937,15 @@ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param } @SuppressWarnings("rawtypes") - private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map param, final ApiCallback _callback) throws ApiException { + private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map requestBody, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException("Missing the required parameter 'param' when calling testInlineAdditionalProperties(Async)"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties(Async)"); } - okhttp3.Call localVarCall = testInlineAdditionalPropertiesCall(param, _callback); + okhttp3.Call localVarCall = testInlineAdditionalPropertiesCall(requestBody, _callback); return localVarCall; } @@ -1809,7 +1953,7 @@ private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map @@ -1817,14 +1961,14 @@ private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map 200 successful operation - */ - public void testInlineAdditionalProperties(Map param) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(param); + public void testInlineAdditionalProperties(Map requestBody) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(requestBody); } /** * test inline additionalProperties * - * @param param request body (required) + * @param requestBody request body (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1833,15 +1977,15 @@ public void testInlineAdditionalProperties(Map param) throws Api 200 successful operation - */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map param) throws ApiException { - okhttp3.Call localVarCall = testInlineAdditionalPropertiesValidateBeforeCall(param, null); + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws ApiException { + okhttp3.Call localVarCall = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, null); return localVarApiClient.execute(localVarCall); } /** * test inline additionalProperties (asynchronously) * - * @param param request body (required) + * @param requestBody request body (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1851,9 +1995,9 @@ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map 200 successful operation - */ - public okhttp3.Call testInlineAdditionalPropertiesAsync(Map param, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testInlineAdditionalPropertiesAsync(Map requestBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = testInlineAdditionalPropertiesValidateBeforeCall(param, _callback); + okhttp3.Call localVarCall = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } @@ -1872,7 +2016,6 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -2015,7 +2158,6 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api */ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -2040,7 +2182,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li Map localVarFormParams = new HashMap(); if (pipe != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "pipe", pipe)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "pipe", pipe)); } if (ioutil != null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index e9e0d6cb8c9f..ad78a8e0872d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeClassnameTags123Api { private ApiClient localVarApiClient; @@ -74,7 +75,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for testClassname - * @param body client model (required) + * @param client client model (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -84,9 +85,8 @@ public void setCustomBaseUrl(String customBaseUrl) { 200 successful operation - */ - public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testClassnameCall(Client client, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -99,7 +99,7 @@ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = client; // create path and map variables String localVarPath = "/fake_classname_test"; @@ -131,15 +131,15 @@ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) } @SuppressWarnings("rawtypes") - private okhttp3.Call testClassnameValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call testClassnameValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClassname(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClassname(Async)"); } - okhttp3.Call localVarCall = testClassnameCall(body, _callback); + okhttp3.Call localVarCall = testClassnameCall(client, _callback); return localVarCall; } @@ -147,7 +147,7 @@ private okhttp3.Call testClassnameValidateBeforeCall(Client body, final ApiCallb /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -156,15 +156,15 @@ private okhttp3.Call testClassnameValidateBeforeCall(Client body, final ApiCallb 200 successful operation - */ - public Client testClassname(Client body) throws ApiException { - ApiResponse localVarResp = testClassnameWithHttpInfo(body); + public Client testClassname(Client client) throws ApiException { + ApiResponse localVarResp = testClassnameWithHttpInfo(client); return localVarResp.getData(); } /** * To test class name in snake case * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -173,16 +173,22 @@ public Client testClassname(Client body) throws ApiException { 200 successful operation - */ - public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - okhttp3.Call localVarCall = testClassnameValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + okhttp3.Call localVarCall = testClassnameValidateBeforeCall(client, null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** * To test class name in snake case (asynchronously) * To test class name in snake case - * @param body client model (required) + * @param client client model (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -192,9 +198,9 @@ public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiExce 200 successful operation - */ - public okhttp3.Call testClassnameAsync(Client body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call testClassnameAsync(Client client, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = testClassnameValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = testClassnameValidateBeforeCall(client, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java index f3f8e2d557ce..d0e37b16f242 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java @@ -30,13 +30,13 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import java.util.Set; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class PetApi { private ApiClient localVarApiClient; @@ -77,22 +77,20 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for addPet - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    */ - public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addPetCall(Pet pet, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] { "http://petstore.swagger.io/v2", "http://path-server-test.petstore.local/v2" }; // Determine Base Path to Use if (localCustomBaseUrl != null){ @@ -103,7 +101,7 @@ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws Api basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = pet; // create path and map variables String localVarPath = "/pet"; @@ -130,20 +128,20 @@ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws Api localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call addPetValidateBeforeCall(Pet body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call addPetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); } - okhttp3.Call localVarCall = addPetCall(body, _callback); + okhttp3.Call localVarCall = addPetCall(pet, _callback); return localVarCall; } @@ -151,54 +149,51 @@ private okhttp3.Call addPetValidateBeforeCall(Pet body, final ApiCallback _callb /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    */ - public void addPet(Pet body) throws ApiException { - addPetWithHttpInfo(body); + public void addPet(Pet pet) throws ApiException { + addPetWithHttpInfo(pet); } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    */ - public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - okhttp3.Call localVarCall = addPetValidateBeforeCall(body, null); + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + okhttp3.Call localVarCall = addPetValidateBeforeCall(pet, null); return localVarApiClient.execute(localVarCall); } /** * Add a new pet to the store (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    */ - public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addPetAsync(Pet pet, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = addPetValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = addPetValidateBeforeCall(pet, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } @@ -212,13 +207,11 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid pet value -
    */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -290,7 +283,6 @@ private okhttp3.Call deletePetValidateBeforeCall(Long petId, String apiKey, fina * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid pet value -
    */ @@ -308,7 +300,6 @@ public void deletePet(Long petId, String apiKey) throws ApiException { * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid pet value -
    */ @@ -328,7 +319,6 @@ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid pet value -
    */ @@ -353,7 +343,6 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -397,7 +386,7 @@ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -448,8 +437,14 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -488,9 +483,8 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback * @deprecated */ @Deprecated - public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _callback) throws ApiException { + public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -534,13 +528,13 @@ public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _call localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call findPetsByTagsValidateBeforeCall(Set tags, final ApiCallback _callback) throws ApiException { + private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final ApiCallback _callback) throws ApiException { // verify the required parameter 'tags' is set if (tags == null) { @@ -557,7 +551,7 @@ private okhttp3.Call findPetsByTagsValidateBeforeCall(Set tags, final Ap * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return Set<Pet> + * @return List<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -568,8 +562,8 @@ private okhttp3.Call findPetsByTagsValidateBeforeCall(Set tags, final Ap * @deprecated */ @Deprecated - public Set findPetsByTags(Set tags) throws ApiException { - ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); + public List findPetsByTags(List tags) throws ApiException { + ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); return localVarResp.getData(); } @@ -577,7 +571,7 @@ public Set findPetsByTags(Set tags) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return ApiResponse<Set<Pet>> + * @return ApiResponse<List<Pet>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
    @@ -588,10 +582,16 @@ public Set findPetsByTags(Set tags) throws ApiException { * @deprecated */ @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { + public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -610,10 +610,10 @@ public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws * @deprecated */ @Deprecated - public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback> _callback) throws ApiException { + public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -633,7 +633,6 @@ public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback getPetByIdWithHttpInfo(Long petId) throws ApiException { okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -755,24 +760,22 @@ public okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback _callback } /** * Build call for updatePet - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
    -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    */ - public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updatePetCall(Pet pet, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] { "http://petstore.swagger.io/v2", "http://path-server-test.petstore.local/v2" }; // Determine Base Path to Use if (localCustomBaseUrl != null){ @@ -783,7 +786,7 @@ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = pet; // create path and map variables String localVarPath = "/pet"; @@ -810,20 +813,20 @@ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updatePetValidateBeforeCall(Pet body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updatePetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); } - okhttp3.Call localVarCall = updatePetCall(body, _callback); + okhttp3.Call localVarCall = updatePetCall(pet, _callback); return localVarCall; } @@ -831,60 +834,57 @@ private okhttp3.Call updatePetValidateBeforeCall(Pet body, final ApiCallback _ca /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    */ - public void updatePet(Pet body) throws ApiException { - updatePetWithHttpInfo(body); + public void updatePet(Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    */ - public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - okhttp3.Call localVarCall = updatePetValidateBeforeCall(body, null); + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + okhttp3.Call localVarCall = updatePetValidateBeforeCall(pet, null); return localVarApiClient.execute(localVarCall); } /** * Update an existing pet (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    */ - public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updatePetAsync(Pet pet, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updatePetValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = updatePetValidateBeforeCall(pet, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } @@ -904,7 +904,6 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1044,7 +1043,6 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1146,8 +1144,14 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _ */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -1188,7 +1192,6 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -1295,8 +1298,14 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { okhttp3.Call localVarCall = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java index e17f7df6c482..e3d425cd3964 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class StoreApi { private ApiClient localVarApiClient; @@ -87,7 +88,6 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -213,7 +213,6 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -295,8 +294,14 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getInventoryValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -334,7 +339,6 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -428,8 +432,14 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -456,7 +466,7 @@ public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _ca } /** * Build call for placeOrder - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -467,9 +477,8 @@ public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _ca 400 Invalid Order - */ - public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call placeOrderCall(Order order, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -482,7 +491,7 @@ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) thro basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = order; // create path and map variables String localVarPath = "/store/order"; @@ -502,7 +511,7 @@ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) thro } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -514,15 +523,15 @@ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) thro } @SuppressWarnings("rawtypes") - private okhttp3.Call placeOrderValidateBeforeCall(Order body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call placeOrderValidateBeforeCall(Order order, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling placeOrder(Async)"); + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)"); } - okhttp3.Call localVarCall = placeOrderCall(body, _callback); + okhttp3.Call localVarCall = placeOrderCall(order, _callback); return localVarCall; } @@ -530,7 +539,7 @@ private okhttp3.Call placeOrderValidateBeforeCall(Order body, final ApiCallback /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -540,15 +549,15 @@ private okhttp3.Call placeOrderValidateBeforeCall(Order body, final ApiCallback 400 Invalid Order - */ - public Order placeOrder(Order body) throws ApiException { - ApiResponse localVarResp = placeOrderWithHttpInfo(body); + public Order placeOrder(Order order) throws ApiException { + ApiResponse localVarResp = placeOrderWithHttpInfo(order); return localVarResp.getData(); } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return ApiResponse<Order> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -558,16 +567,22 @@ public Order placeOrder(Order body) throws ApiException { 400 Invalid Order - */ - public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - okhttp3.Call localVarCall = placeOrderValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** * Place an order for a pet (asynchronously) * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -578,9 +593,9 @@ public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException 400 Invalid Order - */ - public okhttp3.Call placeOrderAsync(Order body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call placeOrderAsync(Order order, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = placeOrderValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index 627f78804878..1c82fdd82188 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -35,6 +35,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class UserApi { private ApiClient localVarApiClient; @@ -75,7 +76,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createUser - * @param body Created user object (required) + * @param user Created user object (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -85,9 +86,8 @@ public void setCustomBaseUrl(String customBaseUrl) { 0 successful operation - */ - public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUserCall(User user, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -100,7 +100,7 @@ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throw basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user"; @@ -120,7 +120,7 @@ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throw } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -132,15 +132,15 @@ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throw } @SuppressWarnings("rawtypes") - private okhttp3.Call createUserValidateBeforeCall(User body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createUserValidateBeforeCall(User user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUser(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); } - okhttp3.Call localVarCall = createUserCall(body, _callback); + okhttp3.Call localVarCall = createUserCall(user, _callback); return localVarCall; } @@ -148,7 +148,7 @@ private okhttp3.Call createUserValidateBeforeCall(User body, final ApiCallback _ /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -156,14 +156,14 @@ private okhttp3.Call createUserValidateBeforeCall(User body, final ApiCallback _
    0 successful operation -
    */ - public void createUser(User body) throws ApiException { - createUserWithHttpInfo(body); + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -172,15 +172,15 @@ public void createUser(User body) throws ApiException { 0 successful operation - */ - public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - okhttp3.Call localVarCall = createUserValidateBeforeCall(body, null); + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + okhttp3.Call localVarCall = createUserValidateBeforeCall(user, null); return localVarApiClient.execute(localVarCall); } /** * Create user (asynchronously) * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -190,15 +190,15 @@ public ApiResponse createUserWithHttpInfo(User body) throws ApiException { 0 successful operation - */ - public okhttp3.Call createUserAsync(User body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUserAsync(User user, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createUserValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = createUserValidateBeforeCall(user, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for createUsersWithArrayInput - * @param body List of user object (required) + * @param user List of user object (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -208,9 +208,8 @@ public okhttp3.Call createUserAsync(User body, final ApiCallback _callback 0 successful operation - */ - public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUsersWithArrayInputCall(List user, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -223,7 +222,7 @@ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCall basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user/createWithArray"; @@ -243,7 +242,7 @@ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCall } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -255,15 +254,15 @@ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCall } @SuppressWarnings("rawtypes") - private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUsersWithArrayInput(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithArrayInput(Async)"); } - okhttp3.Call localVarCall = createUsersWithArrayInputCall(body, _callback); + okhttp3.Call localVarCall = createUsersWithArrayInputCall(user, _callback); return localVarCall; } @@ -271,7 +270,7 @@ private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List body /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -279,14 +278,14 @@ private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List body
    0 successful operation -
    */ - public void createUsersWithArrayInput(List body) throws ApiException { - createUsersWithArrayInputWithHttpInfo(body); + public void createUsersWithArrayInput(List user) throws ApiException { + createUsersWithArrayInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -295,15 +294,15 @@ public void createUsersWithArrayInput(List body) throws ApiException { 0 successful operation - */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { - okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(body, null); + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { + okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(user, null); return localVarApiClient.execute(localVarCall); } /** * Creates list of users with given input array (asynchronously) * - * @param body List of user object (required) + * @param user List of user object (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -313,15 +312,15 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) 0 successful operation - */ - public okhttp3.Call createUsersWithArrayInputAsync(List body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUsersWithArrayInputAsync(List user, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(user, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for createUsersWithListInput - * @param body List of user object (required) + * @param user List of user object (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -331,9 +330,8 @@ public okhttp3.Call createUsersWithArrayInputAsync(List body, final ApiCal 0 successful operation - */ - public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUsersWithListInputCall(List user, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -346,7 +344,7 @@ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallb basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user/createWithList"; @@ -366,7 +364,7 @@ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallb } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -378,15 +376,15 @@ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallb } @SuppressWarnings("rawtypes") - private okhttp3.Call createUsersWithListInputValidateBeforeCall(List body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createUsersWithListInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUsersWithListInput(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithListInput(Async)"); } - okhttp3.Call localVarCall = createUsersWithListInputCall(body, _callback); + okhttp3.Call localVarCall = createUsersWithListInputCall(user, _callback); return localVarCall; } @@ -394,7 +392,7 @@ private okhttp3.Call createUsersWithListInputValidateBeforeCall(List body, /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -402,14 +400,14 @@ private okhttp3.Call createUsersWithListInputValidateBeforeCall(List body,
    0 successful operation -
    */ - public void createUsersWithListInput(List body) throws ApiException { - createUsersWithListInputWithHttpInfo(body); + public void createUsersWithListInput(List user) throws ApiException { + createUsersWithListInputWithHttpInfo(user); } /** * Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -418,15 +416,15 @@ public void createUsersWithListInput(List body) throws ApiException { 0 successful operation - */ - public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { - okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(body, null); + public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { + okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(user, null); return localVarApiClient.execute(localVarCall); } /** * Creates list of users with given input array (asynchronously) * - * @param body List of user object (required) + * @param user List of user object (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -436,9 +434,9 @@ public ApiResponse createUsersWithListInputWithHttpInfo(List body) t 0 successful operation - */ - public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUsersWithListInputAsync(List user, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(body, _callback); + okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(user, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } @@ -457,7 +455,6 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -586,7 +583,6 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -680,8 +676,14 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -722,7 +724,6 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -828,8 +829,14 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -867,7 +874,6 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -971,7 +977,7 @@ public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws Ap /** * Build call for updateUser * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -982,9 +988,8 @@ public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws Ap 404 User not found - */ - public okhttp3.Call updateUserCall(String username, User body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateUserCall(String username, User user, final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { }; @@ -997,7 +1002,7 @@ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback basePath = null; } - Object localVarPostBody = body; + Object localVarPostBody = user; // create path and map variables String localVarPath = "/user/{username}" @@ -1018,7 +1023,7 @@ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1030,20 +1035,20 @@ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback } @SuppressWarnings("rawtypes") - private okhttp3.Call updateUserValidateBeforeCall(String username, User body, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateUserValidateBeforeCall(String username, User user, final ApiCallback _callback) throws ApiException { // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updateUser(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); } - okhttp3.Call localVarCall = updateUserCall(username, body, _callback); + okhttp3.Call localVarCall = updateUserCall(username, user, _callback); return localVarCall; } @@ -1052,7 +1057,7 @@ private okhttp3.Call updateUserValidateBeforeCall(String username, User body, fi * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1061,15 +1066,15 @@ private okhttp3.Call updateUserValidateBeforeCall(String username, User body, fi
    404 User not found -
    */ - public void updateUser(String username, User body) throws ApiException { - updateUserWithHttpInfo(username, body); + public void updateUser(String username, User user) throws ApiException { + updateUserWithHttpInfo(username, user); } /** * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1079,8 +1084,8 @@ public void updateUser(String username, User body) throws ApiException { 404 User not found - */ - public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, body, null); + public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { + okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, user, null); return localVarApiClient.execute(localVarCall); } @@ -1088,7 +1093,7 @@ public ApiResponse updateUserWithHttpInfo(String username, User body) thro * Updated user (asynchronously) * This can only be done by the logged in user. * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1099,9 +1104,9 @@ public ApiResponse updateUserWithHttpInfo(String username, User body) thro 404 User not found - */ - public okhttp3.Call updateUserAsync(String username, User body, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateUserAsync(String username, User user, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, body, _callback); + okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, user, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index a37cbdd5a55e..7b630bb57e77 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -28,22 +28,31 @@ public class RetryingOAuth extends OAuth implements Interceptor { private TokenRequestBuilder tokenRequestBuilder; + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); this.tokenRequestBuilder = tokenRequestBuilder; } + /** + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { this(new OkHttpClient(), tokenRequestBuilder); } /** - @param tokenUrl The token URL to be used for this OAuth2 flow. - Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - The value must be an absolute URL. - @param clientId The OAuth2 client ID for the "clientCredentials" flow. - @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - */ + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ public RetryingOAuth( String tokenUrl, String clientId, @@ -62,6 +71,11 @@ public RetryingOAuth( } } + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ public void setFlow(OAuthFlow flow) { switch(flow) { case ACCESS_CODE: @@ -147,8 +161,12 @@ private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAut } } - /* + /** * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { @@ -165,10 +183,21 @@ public synchronized boolean updateAccessToken(String requestAccessToken) throws return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); } + /** + * Gets the token request builder + * + * @return A token request builder + * @throws java.io.IOException If fail to update the access token + */ public TokenRequestBuilder getTokenRequestBuilder() { return tokenRequestBuilder; } + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { this.tokenRequestBuilder = tokenRequestBuilder; } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index 1b5a3cd22390..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * AdditionalPropertiesAnyType - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public AdditionalPropertiesAnyType() { - } - - public AdditionalPropertiesAnyType name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java deleted file mode 100644 index 6835e103b62d..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * AdditionalPropertiesArray - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesArray extends HashMap { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public AdditionalPropertiesArray() { - } - - public AdditionalPropertiesArray name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index 3f2f1b3ba823..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * AdditionalPropertiesBoolean - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public AdditionalPropertiesBoolean() { - } - - public AdditionalPropertiesBoolean name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 21db6cb109ff..d5f4dc14d804 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -23,377 +23,283 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; /** * AdditionalPropertiesClass */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { - public static final String SERIALIZED_NAME_MAP_STRING = "map_string"; - @SerializedName(SERIALIZED_NAME_MAP_STRING) - private Map mapString = null; - - public static final String SERIALIZED_NAME_MAP_NUMBER = "map_number"; - @SerializedName(SERIALIZED_NAME_MAP_NUMBER) - private Map mapNumber = null; - - public static final String SERIALIZED_NAME_MAP_INTEGER = "map_integer"; - @SerializedName(SERIALIZED_NAME_MAP_INTEGER) - private Map mapInteger = null; - - public static final String SERIALIZED_NAME_MAP_BOOLEAN = "map_boolean"; - @SerializedName(SERIALIZED_NAME_MAP_BOOLEAN) - private Map mapBoolean = null; - - public static final String SERIALIZED_NAME_MAP_ARRAY_INTEGER = "map_array_integer"; - @SerializedName(SERIALIZED_NAME_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = null; - - public static final String SERIALIZED_NAME_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @SerializedName(SERIALIZED_NAME_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = null; + public static final String SERIALIZED_NAME_MAP_PROPERTY = "map_property"; + @SerializedName(SERIALIZED_NAME_MAP_PROPERTY) + private Map mapProperty = null; - public static final String SERIALIZED_NAME_MAP_MAP_STRING = "map_map_string"; - @SerializedName(SERIALIZED_NAME_MAP_MAP_STRING) - private Map> mapMapString = null; - - public static final String SERIALIZED_NAME_MAP_MAP_ANYTYPE = "map_map_anytype"; - @SerializedName(SERIALIZED_NAME_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = null; + public static final String SERIALIZED_NAME_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + @SerializedName(SERIALIZED_NAME_MAP_OF_MAP_PROPERTY) + private Map> mapOfMapProperty = null; public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; @SerializedName(SERIALIZED_NAME_ANYTYPE1) - private Object anytype1; - - public static final String SERIALIZED_NAME_ANYTYPE2 = "anytype_2"; - @SerializedName(SERIALIZED_NAME_ANYTYPE2) - private Object anytype2; - - public static final String SERIALIZED_NAME_ANYTYPE3 = "anytype_3"; - @SerializedName(SERIALIZED_NAME_ANYTYPE3) - private Object anytype3; - - public AdditionalPropertiesClass() { - } - - public AdditionalPropertiesClass mapString(Map mapString) { - - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + private Object anytype1 = null; - public Map getMapString() { - return mapString; - } + public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1"; + @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) + private Object mapWithUndeclaredPropertiesAnytype1; + public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2"; + @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) + private Object mapWithUndeclaredPropertiesAnytype2; - public void setMapString(Map mapString) { - this.mapString = mapString; - } + public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3"; + @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) + private Map mapWithUndeclaredPropertiesAnytype3 = null; + public static final String SERIALIZED_NAME_EMPTY_MAP = "empty_map"; + @SerializedName(SERIALIZED_NAME_EMPTY_MAP) + private Object emptyMap; - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - - this.mapNumber = mapNumber; - return this; - } + public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; + @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_STRING) + private Map mapWithUndeclaredPropertiesString = null; - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Map getMapNumber() { - return mapNumber; - } - - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; + public AdditionalPropertiesClass() { } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { + public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapInteger = mapInteger; + this.mapProperty = mapProperty; return this; } - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); } - this.mapInteger.put(key, mapIntegerItem); + this.mapProperty.put(key, mapPropertyItem); return this; } /** - * Get mapInteger - * @return mapInteger + * Get mapProperty + * @return mapProperty **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public Map getMapInteger() { - return mapInteger; + public Map getMapProperty() { + return mapProperty; } - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapBoolean = mapBoolean; + this.mapOfMapProperty = mapOfMapProperty; return this; } - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); } - this.mapBoolean.put(key, mapBooleanItem); + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } /** - * Get mapBoolean - * @return mapBoolean + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public Map getMapBoolean() { - return mapBoolean; + public Map> getMapOfMapProperty() { + return mapOfMapProperty; } - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; } - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + public AdditionalPropertiesClass anytype1(Object anytype1) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); - } - this.mapArrayInteger.put(key, mapArrayIntegerItem); + this.anytype1 = anytype1; return this; } /** - * Get mapArrayInteger - * @return mapArrayInteger + * Get anytype1 + * @return anytype1 **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public Map> getMapArrayInteger() { - return mapArrayInteger; + public Object getAnytype1() { + return anytype1; } - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; } - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); - } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; return this; } /** - * Get mapArrayAnytype - * @return mapArrayAnytype + * Get mapWithUndeclaredPropertiesAnytype1 + * @return mapWithUndeclaredPropertiesAnytype1 **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public Map> getMapArrayAnytype() { - return mapArrayAnytype; + public Object getMapWithUndeclaredPropertiesAnytype1() { + return mapWithUndeclaredPropertiesAnytype1; } - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; + public void setMapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; } - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); - } - this.mapMapString.put(key, mapMapStringItem); + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; return this; } /** - * Get mapMapString - * @return mapMapString + * Get mapWithUndeclaredPropertiesAnytype2 + * @return mapWithUndeclaredPropertiesAnytype2 **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public Map> getMapMapString() { - return mapMapString; + public Object getMapWithUndeclaredPropertiesAnytype2() { + return mapWithUndeclaredPropertiesAnytype2; } - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; + public void setMapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; } - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { - this.mapMapAnytype = mapMapAnytype; + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; return this; } - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(String key, Object mapWithUndeclaredPropertiesAnytype3Item) { + if (this.mapWithUndeclaredPropertiesAnytype3 == null) { + this.mapWithUndeclaredPropertiesAnytype3 = new HashMap(); } - this.mapMapAnytype.put(key, mapMapAnytypeItem); + this.mapWithUndeclaredPropertiesAnytype3.put(key, mapWithUndeclaredPropertiesAnytype3Item); return this; } /** - * Get mapMapAnytype - * @return mapMapAnytype + * Get mapWithUndeclaredPropertiesAnytype3 + * @return mapWithUndeclaredPropertiesAnytype3 **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public Map> getMapMapAnytype() { - return mapMapAnytype; + public Map getMapWithUndeclaredPropertiesAnytype3() { + return mapWithUndeclaredPropertiesAnytype3; } - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; + public void setMapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; } - public AdditionalPropertiesClass anytype1(Object anytype1) { + public AdditionalPropertiesClass emptyMap(Object emptyMap) { - this.anytype1 = anytype1; + this.emptyMap = emptyMap; return this; } /** - * Get anytype1 - * @return anytype1 + * an object with no declared properties and no undeclared properties, hence it's an empty map. + * @return emptyMap **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(value = "an object with no declared properties and no undeclared properties, hence it's an empty map.") - public Object getAnytype1() { - return anytype1; + public Object getEmptyMap() { + return emptyMap; } - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; + public void setEmptyMap(Object emptyMap) { + this.emptyMap = emptyMap; } - public AdditionalPropertiesClass anytype2(Object anytype2) { + public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { - this.anytype2 = anytype2; + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; return this; } - /** - * Get anytype2 - * @return anytype2 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Object getAnytype2() { - return anytype2; - } - - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - - public AdditionalPropertiesClass anytype3(Object anytype3) { - - this.anytype3 = anytype3; + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String key, String mapWithUndeclaredPropertiesStringItem) { + if (this.mapWithUndeclaredPropertiesString == null) { + this.mapWithUndeclaredPropertiesString = new HashMap(); + } + this.mapWithUndeclaredPropertiesString.put(key, mapWithUndeclaredPropertiesStringItem); return this; } /** - * Get anytype3 - * @return anytype3 + * Get mapWithUndeclaredPropertiesString + * @return mapWithUndeclaredPropertiesString **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public Object getAnytype3() { - return anytype3; + public Map getMapWithUndeclaredPropertiesString() { + return mapWithUndeclaredPropertiesString; } - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; + public void setMapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; } @@ -406,39 +312,44 @@ public boolean equals(Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); + Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && + Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && + Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && + Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && + Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapProperty, mapOfMapProperty, anytype1, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype1: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype1)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype2: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype2)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype3: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype3)).append("\n"); + sb.append(" emptyMap: ").append(toIndentedString(emptyMap)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesString: ").append(toIndentedString(mapWithUndeclaredPropertiesString)).append("\n"); sb.append("}"); return sb.toString(); } @@ -454,5 +365,96 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("map_property"); + openapiFields.add("map_of_map_property"); + openapiFields.add("anytype_1"); + openapiFields.add("map_with_undeclared_properties_anytype_1"); + openapiFields.add("map_with_undeclared_properties_anytype_2"); + openapiFields.add("map_with_undeclared_properties_anytype_3"); + openapiFields.add("empty_map"); + openapiFields.add("map_with_undeclared_properties_string"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesClass is not found in the empty JSON string", AdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesClass read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass + */ + public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class); + } + + /** + * Convert an instance of AdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java deleted file mode 100644 index c90f346b182d..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * AdditionalPropertiesInteger - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesInteger extends HashMap { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public AdditionalPropertiesInteger() { - } - - public AdditionalPropertiesInteger name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java deleted file mode 100644 index b9a1d371fd30..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; - -/** - * AdditionalPropertiesNumber - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesNumber extends HashMap { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public AdditionalPropertiesNumber() { - } - - public AdditionalPropertiesNumber name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java deleted file mode 100644 index a61d030c6c01..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * AdditionalPropertiesObject - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesObject extends HashMap { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public AdditionalPropertiesObject() { - } - - public AdditionalPropertiesObject name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java deleted file mode 100644 index 4745fed6651c..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * AdditionalPropertiesString - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesString extends HashMap { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public AdditionalPropertiesString() { - } - - public AdditionalPropertiesString name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java index 24f916d3add3..de69f3d6d73c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java @@ -23,10 +23,28 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.openapitools.client.model.BigCat; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Animal */ @@ -129,5 +147,68 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Animal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Animal.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Animal is not found in the empty JSON string", Animal.openapiRequiredFields.toString())); + } + } + + String discriminatorValue = jsonObj.get("className").getAsString(); + switch (discriminatorValue) { + case "Cat": + Cat.validateJsonObject(jsonObj); + break; + case "Dog": + Dog.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + } + + + /** + * Create an instance of Animal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Animal + * @throws IOException if the JSON string is invalid with respect to Animal + */ + public static Animal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Animal.class); + } + + /** + * Convert an instance of Animal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Apple.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Apple.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AppleReq.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AppleReq.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 8c7d76947343..d375bd8a4886 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -27,6 +27,25 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ArrayOfArrayOfNumberOnly */ @@ -107,5 +126,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ArrayArrayNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayOfArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayOfArrayOfNumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfArrayOfNumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayOfArrayOfNumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayOfArrayOfNumberOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2408d2577088..9ec157ed1515 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -27,6 +27,25 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ArrayOfNumberOnly */ @@ -107,5 +126,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ArrayNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayOfNumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfNumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayOfNumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayOfNumberOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly + */ + public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java index 1c7469d68e08..66d23d236a84 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -27,6 +27,25 @@ import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ArrayTest */ @@ -181,5 +200,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("array_of_string"); + openapiFields.add("array_array_of_integer"); + openapiFields.add("array_array_of_model"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTest + * @throws IOException if the JSON string is invalid with respect to ArrayTest + */ + public static ArrayTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayTest.class); + } + + /** + * Convert an instance of ArrayTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Banana.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Banana.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BananaReq.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BananaReq.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BasquePig.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BasquePig.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java deleted file mode 100644 index 37b2bb735b9c..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.BigCatAllOf; -import org.openapitools.client.model.Cat; - -/** - * BigCat - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BigCat extends Cat { - /** - * Gets or Sets kind - */ - @JsonAdapter(KindEnum.Adapter.class) - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KindEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KindEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private KindEnum kind; - - public BigCat() { - this.className = this.getClass().getSimpleName(); - } - - public BigCat kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public KindEnum getKind() { - return kind; - } - - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java deleted file mode 100644 index 8334448ffdfc..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * BigCatAllOf - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BigCatAllOf { - /** - * Gets or Sets kind - */ - @JsonAdapter(KindEnum.Adapter.class) - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public KindEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return KindEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_KIND = "kind"; - @SerializedName(SERIALIZED_NAME_KIND) - private KindEnum kind; - - public BigCatAllOf() { - } - - public BigCatAllOf kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public KindEnum getKind() { - return kind; - } - - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java index a99f3586985f..ce4095ed0e52 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Capitalization */ @@ -241,5 +260,94 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("smallCamel"); + openapiFields.add("CapitalCamel"); + openapiFields.add("small_Snake"); + openapiFields.add("Capital_Snake"); + openapiFields.add("SCA_ETH_Flow_Points"); + openapiFields.add("ATT_NAME"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Capitalization + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Capitalization.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Capitalization is not found in the empty JSON string", Capitalization.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Capitalization.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Capitalization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Capitalization.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Capitalization' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Capitalization.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Capitalization value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Capitalization read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Capitalization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Capitalization + * @throws IOException if the JSON string is invalid with respect to Capitalization + */ + public static Capitalization fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Capitalization.class); + } + + /** + * Convert an instance of Capitalization to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java index b226ce008f24..a81d5016bf72 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java @@ -24,9 +24,27 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import org.openapitools.client.model.CatAllOf; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Cat */ @@ -102,5 +120,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("declawed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Cat + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Cat.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Cat is not found in the empty JSON string", Cat.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Cat.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Cat` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Cat.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Cat.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Cat' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Cat.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Cat value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Cat read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Cat given an JSON string + * + * @param jsonString JSON string + * @return An instance of Cat + * @throws IOException if the JSON string is invalid with respect to Cat + */ + public static Cat fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Cat.class); + } + + /** + * Convert an instance of Cat to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java index 39c740ffe3fb..6a2c50e1c046 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * CatAllOf */ @@ -96,5 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("declawed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CatAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CatAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CatAllOf is not found in the empty JSON string", CatAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CatAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatAllOf + * @throws IOException if the JSON string is invalid with respect to CatAllOf + */ + public static CatAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatAllOf.class); + } + + /** + * Convert an instance of CatAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java index 9d7c0e4a1cdc..d23447f518de 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Category */ @@ -125,5 +144,98 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Category + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Category.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Category is not found in the empty JSON string", Category.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Category.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Category` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Category.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Category.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Category' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Category.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Category value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Category read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Category given an JSON string + * + * @param jsonString JSON string + * @return An instance of Category + * @throws IOException if the JSON string is invalid with respect to Category + */ + public static Category fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Category.class); + } + + /** + * Convert an instance of Category to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ChildCatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ChildCatAllOf.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ChildCatAllOf.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ChildCatAllOf.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java index eb1d43e00eb1..8fb1b2f83d15 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing model with \"_class\" property */ @@ -97,5 +116,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("_class"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClassModel + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ClassModel.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ClassModel is not found in the empty JSON string", ClassModel.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClassModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClassModel` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClassModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClassModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClassModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClassModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClassModel read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClassModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClassModel + * @throws IOException if the JSON string is invalid with respect to ClassModel + */ + public static ClassModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClassModel.class); + } + + /** + * Convert an instance of ClassModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java index 8e5e1694acee..a52cc0be31af 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Client */ @@ -96,5 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("client"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Client + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Client.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Client is not found in the empty JSON string", Client.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Client.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Client` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Client.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Client' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Client.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Client value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Client read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Client given an JSON string + * + * @param jsonString JSON string + * @return An instance of Client + * @throws IOException if the JSON string is invalid with respect to Client + */ + public static Client fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Client.class); + } + + /** + * Convert an instance of Client to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DanishPig.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DanishPig.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DeprecatedObject.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DeprecatedObject.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java index d4935b3df275..24062284ab56 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java @@ -26,6 +26,25 @@ import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Dog */ @@ -101,5 +120,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("breed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Dog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Dog.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Dog is not found in the empty JSON string", Dog.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Dog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Dog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Dog.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Dog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Dog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Dog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Dog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Dog read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Dog given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dog + * @throws IOException if the JSON string is invalid with respect to Dog + */ + public static Dog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Dog.class); + } + + /** + * Convert an instance of Dog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java index b1f42a5f6209..6053b9169b79 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * DogAllOf */ @@ -96,5 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("breed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DogAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DogAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DogAllOf is not found in the empty JSON string", DogAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DogAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DogAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DogAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DogAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DogAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DogAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DogAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DogAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of DogAllOf + * @throws IOException if the JSON string is invalid with respect to DogAllOf + */ + public static DogAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DogAllOf.class); + } + + /** + * Convert an instance of DogAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java index 2b249f35495e..6b64ece26660 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -26,6 +26,25 @@ import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * EnumArrays */ @@ -229,5 +248,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("just_symbol"); + openapiFields.add("array_enum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumArrays + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumArrays.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumArrays is not found in the empty JSON string", EnumArrays.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumArrays.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumArrays` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnumArrays.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnumArrays' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnumArrays.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnumArrays value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EnumArrays read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EnumArrays given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumArrays + * @throws IOException if the JSON string is invalid with respect to EnumArrays + */ + public static EnumArrays fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumArrays.class); + } + + /** + * Convert an instance of EnumArrays to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java index 55ddcb829be4..b25fad66483e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -24,6 +24,29 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; /** * EnumTest @@ -187,6 +210,57 @@ public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ENUM_INTEGER) private EnumIntegerEnum enumInteger; + /** + * Gets or Sets enumIntegerOnly + */ + @JsonAdapter(EnumIntegerOnlyEnum.Adapter.class) + public enum EnumIntegerOnlyEnum { + NUMBER_2(2), + + NUMBER_MINUS_2(-2); + + private Integer value; + + EnumIntegerOnlyEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumIntegerOnlyEnum fromValue(Integer value) { + for (EnumIntegerOnlyEnum b : EnumIntegerOnlyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumIntegerOnlyEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumIntegerOnlyEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return EnumIntegerOnlyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ENUM_INTEGER_ONLY = "enum_integer_only"; + @SerializedName(SERIALIZED_NAME_ENUM_INTEGER_ONLY) + private EnumIntegerOnlyEnum enumIntegerOnly; + /** * Gets or Sets enumNumber */ @@ -242,6 +316,18 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public static final String SERIALIZED_NAME_OUTER_ENUM_INTEGER = "outerEnumInteger"; + @SerializedName(SERIALIZED_NAME_OUTER_ENUM_INTEGER) + private OuterEnumInteger outerEnumInteger; + + public static final String SERIALIZED_NAME_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + @SerializedName(SERIALIZED_NAME_OUTER_ENUM_DEFAULT_VALUE) + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + public static final String SERIALIZED_NAME_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + @SerializedName(SERIALIZED_NAME_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + public EnumTest() { } @@ -314,6 +400,29 @@ public void setEnumInteger(EnumIntegerEnum enumInteger) { } + public EnumTest enumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { + + this.enumIntegerOnly = enumIntegerOnly; + return this; + } + + /** + * Get enumIntegerOnly + * @return enumIntegerOnly + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EnumIntegerOnlyEnum getEnumIntegerOnly() { + return enumIntegerOnly; + } + + + public void setEnumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { + this.enumIntegerOnly = enumIntegerOnly; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -360,6 +469,75 @@ public void setOuterEnum(OuterEnum outerEnum) { } + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -372,13 +550,28 @@ public boolean equals(Object o) { return Objects.equals(this.enumString, enumTest.enumString) && Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumIntegerOnly, enumTest.enumIntegerOnly) && Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); + Objects.equals(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override @@ -388,8 +581,12 @@ public String toString() { sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumIntegerOnly: ").append(toIndentedString(enumIntegerOnly)).append("\n"); sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); sb.append("}"); return sb.toString(); } @@ -405,5 +602,105 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enum_string"); + openapiFields.add("enum_string_required"); + openapiFields.add("enum_integer"); + openapiFields.add("enum_integer_only"); + openapiFields.add("enum_number"); + openapiFields.add("outerEnum"); + openapiFields.add("outerEnumInteger"); + openapiFields.add("outerEnumDefaultValue"); + openapiFields.add("outerEnumIntegerDefaultValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enum_string_required"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumTest is not found in the empty JSON string", EnumTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnumTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnumTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnumTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnumTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnumTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EnumTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EnumTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumTest + * @throws IOException if the JSON string is invalid with respect to EnumTest + */ + public static EnumTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumTest.class); + } + + /** + * Convert an instance of EnumTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EquilateralTriangle.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EquilateralTriangle.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4c0ebf716d9a..4bb4e340969d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -27,6 +27,25 @@ import java.util.List; import org.openapitools.client.model.ModelFile; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * FileSchemaTestClass */ @@ -136,5 +155,101 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("file"); + openapiFields.add("files"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FileSchemaTestClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FileSchemaTestClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FileSchemaTestClass is not found in the empty JSON string", FileSchemaTestClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FileSchemaTestClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileSchemaTestClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `file` + if (jsonObj.getAsJsonObject("file") != null) { + ModelFile.validateJsonObject(jsonObj.getAsJsonObject("file")); + } + JsonArray jsonArrayfiles = jsonObj.getAsJsonArray("files"); + // validate the optional field `files` (array) + if (jsonArrayfiles != null) { + for (int i = 0; i < jsonArrayfiles.size(); i++) { + ModelFile.validateJsonObject(jsonArrayfiles.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FileSchemaTestClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FileSchemaTestClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FileSchemaTestClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FileSchemaTestClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FileSchemaTestClass read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FileSchemaTestClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileSchemaTestClass + * @throws IOException if the JSON string is invalid with respect to FileSchemaTestClass + */ + public static FileSchemaTestClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FileSchemaTestClass.class); + } + + /** + * Convert an instance of FileSchemaTestClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Foo.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Foo.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java index 52900682b0f7..48923c990846 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -29,6 +29,25 @@ import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * FormatTest */ @@ -58,6 +77,10 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_DOUBLE) private Double _double; + public static final String SERIALIZED_NAME_DECIMAL = "decimal"; + @SerializedName(SERIALIZED_NAME_DECIMAL) + private BigDecimal decimal; + public static final String SERIALIZED_NAME_STRING = "string"; @SerializedName(SERIALIZED_NAME_STRING) private String string; @@ -86,9 +109,13 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_PASSWORD) private String password; - public static final String SERIALIZED_NAME_BIG_DECIMAL = "BigDecimal"; - @SerializedName(SERIALIZED_NAME_BIG_DECIMAL) - private BigDecimal bigDecimal; + public static final String SERIALIZED_NAME_PATTERN_WITH_DIGITS = "pattern_with_digits"; + @SerializedName(SERIALIZED_NAME_PATTERN_WITH_DIGITS) + private String patternWithDigits; + + public static final String SERIALIZED_NAME_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + @SerializedName(SERIALIZED_NAME_PATTERN_WITH_DIGITS_AND_DELIMITER) + private String patternWithDigitsAndDelimiter; public FormatTest() { } @@ -241,6 +268,29 @@ public void setDouble(Double _double) { } + public FormatTest decimal(BigDecimal decimal) { + + this.decimal = decimal; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BigDecimal getDecimal() { + return decimal; + } + + + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest string(String string) { this.string = string; @@ -321,7 +371,7 @@ public FormatTest date(LocalDate date) { * @return date **/ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @ApiModelProperty(example = "Sun Feb 02 00:00:00 UTC 2020", required = true, value = "") public LocalDate getDate() { return date; @@ -344,7 +394,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * @return dateTime **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(example = "2007-12-03T10:15:30+01:00", value = "") public OffsetDateTime getDateTime() { return dateTime; @@ -402,26 +452,49 @@ public void setPassword(String password) { } - public FormatTest bigDecimal(BigDecimal bigDecimal) { + public FormatTest patternWithDigits(String patternWithDigits) { - this.bigDecimal = bigDecimal; + this.patternWithDigits = patternWithDigits; return this; } /** - * Get bigDecimal - * @return bigDecimal + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.") - public BigDecimal getBigDecimal() { - return bigDecimal; + public String getPatternWithDigits() { + return patternWithDigits; } - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } @@ -440,6 +513,7 @@ public boolean equals(Object o) { Objects.equals(this.number, formatTest.number) && Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && @@ -447,12 +521,13 @@ public boolean equals(Object o) { Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); } @Override @@ -465,6 +540,7 @@ public String toString() { sb.append(" number: ").append(toIndentedString(number)).append("\n"); sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); sb.append(" string: ").append(toIndentedString(string)).append("\n"); sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); @@ -472,7 +548,8 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); sb.append("}"); return sb.toString(); } @@ -488,5 +565,115 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("integer"); + openapiFields.add("int32"); + openapiFields.add("int64"); + openapiFields.add("number"); + openapiFields.add("float"); + openapiFields.add("double"); + openapiFields.add("decimal"); + openapiFields.add("string"); + openapiFields.add("byte"); + openapiFields.add("binary"); + openapiFields.add("date"); + openapiFields.add("dateTime"); + openapiFields.add("uuid"); + openapiFields.add("password"); + openapiFields.add("pattern_with_digits"); + openapiFields.add("pattern_with_digits_and_delimiter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("byte"); + openapiRequiredFields.add("date"); + openapiRequiredFields.add("password"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FormatTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FormatTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FormatTest is not found in the empty JSON string", FormatTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FormatTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FormatTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FormatTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FormatTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FormatTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FormatTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FormatTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FormatTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FormatTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FormatTest + * @throws IOException if the JSON string is invalid with respect to FormatTest + */ + public static FormatTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FormatTest.class); + } + + /** + * Convert an instance of FormatTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GmFruit.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GmFruit.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GrandparentAnimal.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GrandparentAnimal.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index b8194dc1df6e..ff80990e36a7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * HasOnlyReadOnly */ @@ -117,5 +136,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bar"); + openapiFields.add("foo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasOnlyReadOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HasOnlyReadOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HasOnlyReadOnly is not found in the empty JSON string", HasOnlyReadOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasOnlyReadOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasOnlyReadOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasOnlyReadOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasOnlyReadOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasOnlyReadOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasOnlyReadOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasOnlyReadOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasOnlyReadOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasOnlyReadOnly + * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly + */ + public static HasOnlyReadOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasOnlyReadOnly.class); + } + + /** + * Convert an instance of HasOnlyReadOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HealthCheckResult.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HealthCheckResult.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/InlineResponseDefault.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/InlineResponseDefault.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java index cc0b38f6c4d8..51fb198904fe 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java @@ -27,6 +27,25 @@ import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * MapTest */ @@ -265,5 +284,92 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("map_map_of_string"); + openapiFields.add("map_of_enum_string"); + openapiFields.add("direct_map"); + openapiFields.add("indirect_map"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MapTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MapTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MapTest is not found in the empty JSON string", MapTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MapTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MapTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MapTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MapTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MapTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MapTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MapTest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MapTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MapTest + * @throws IOException if the JSON string is invalid with respect to MapTest + */ + public static MapTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MapTest.class); + } + + /** + * Convert an instance of MapTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1c705d4b1ee4..3bd9f59adbb8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -30,6 +30,25 @@ import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * MixedPropertiesAndAdditionalPropertiesClass */ @@ -168,5 +187,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uuid"); + openapiFields.add("dateTime"); + openapiFields.add("map"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MixedPropertiesAndAdditionalPropertiesClass is not found in the empty JSON string", MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MixedPropertiesAndAdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MixedPropertiesAndAdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MixedPropertiesAndAdditionalPropertiesClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MixedPropertiesAndAdditionalPropertiesClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MixedPropertiesAndAdditionalPropertiesClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MixedPropertiesAndAdditionalPropertiesClass read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of MixedPropertiesAndAdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static MixedPropertiesAndAdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MixedPropertiesAndAdditionalPropertiesClass.class); + } + + /** + * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java index 46150911764a..a6f1720f9e57 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing model name starting with number */ @@ -126,5 +145,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("class"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Model200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Model200Response.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Model200Response is not found in the empty JSON string", Model200Response.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Model200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Model200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Model200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Model200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Model200Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Model200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Model200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Model200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Model200Response + * @throws IOException if the JSON string is invalid with respect to Model200Response + */ + public static Model200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Model200Response.class); + } + + /** + * Convert an instance of Model200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 93e9feb5b86b..9d4ee4fbdf4b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ModelApiResponse */ @@ -154,5 +173,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("type"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelApiResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelApiResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelApiResponse is not found in the empty JSON string", ModelApiResponse.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelApiResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelApiResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelApiResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelApiResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelApiResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelApiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelApiResponse + * @throws IOException if the JSON string is invalid with respect to ModelApiResponse + */ + public static ModelApiResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelApiResponse.class); + } + + /** + * Convert an instance of ModelApiResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java index 111a748ceff8..4b0921084274 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Must be named `File` for test. */ @@ -97,5 +116,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceURI"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelFile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelFile.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelFile is not found in the empty JSON string", ModelFile.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelFile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelFile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelFile + * @throws IOException if the JSON string is invalid with respect to ModelFile + */ + public static ModelFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelFile.class); + } + + /** + * Convert an instance of ModelFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java index 2ba46fefd4fe..cffa7fb4f941 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ModelList */ @@ -96,5 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("123-list"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelList + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelList.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelList is not found in the empty JSON string", ModelList.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelList read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelList + * @throws IOException if the JSON string is invalid with respect to ModelList + */ + public static ModelList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelList.class); + } + + /** + * Convert an instance of ModelList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java index 4c0e74f87ebc..09a6be5b714a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing reserved words */ @@ -97,5 +116,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("return"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelReturn + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelReturn.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelReturn is not found in the empty JSON string", ModelReturn.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelReturn.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelReturn` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelReturn.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelReturn' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelReturn.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelReturn value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelReturn read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelReturn given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelReturn + * @throws IOException if the JSON string is invalid with respect to ModelReturn + */ + public static ModelReturn fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelReturn.class); + } + + /** + * Convert an instance of ModelReturn to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java index a0bd099370de..a9f5ca0e1508 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Model for testing model name same as property name */ @@ -176,5 +195,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("snake_case"); + openapiFields.add("property"); + openapiFields.add("123Number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Name + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Name.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Name is not found in the empty JSON string", Name.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Name.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Name.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Name.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Name' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Name.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Name value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Name read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws IOException if the JSON string is invalid with respect to Name + */ + public static Name fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Name.class); + } + + /** + * Convert an instance of Name to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java index 46830867289a..180a6db89aac 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -25,6 +25,25 @@ import java.io.IOException; import java.math.BigDecimal; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * NumberOnly */ @@ -97,5 +116,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("JustNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NumberOnly is not found in the empty JSON string", NumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NumberOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberOnly + * @throws IOException if the JSON string is invalid with respect to NumberOnly + */ + public static NumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NumberOnly.class); + } + + /** + * Convert an instance of NumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java index 530f0eefd41a..82d8a256c0b1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java @@ -25,6 +25,25 @@ import java.io.IOException; import org.threeten.bp.OffsetDateTime; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Order */ @@ -186,7 +205,7 @@ public Order shipDate(OffsetDateTime shipDate) { * @return shipDate **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(example = "2020-02-02T20:20:20.000222Z", value = "") public OffsetDateTime getShipDate() { return shipDate; @@ -291,5 +310,94 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("petId"); + openapiFields.add("quantity"); + openapiFields.add("shipDate"); + openapiFields.add("status"); + openapiFields.add("complete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Order + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Order.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Order is not found in the empty JSON string", Order.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Order.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Order.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Order' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Order.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Order value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Order read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Order given an JSON string + * + * @param jsonString JSON string + * @return An instance of Order + * @throws IOException if the JSON string is invalid with respect to Order + */ + public static Order fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Order.class); + } + + /** + * Convert an instance of Order to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java index d8c60dcf97aa..e86d5bc5ff5e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -25,6 +25,25 @@ import java.io.IOException; import java.math.BigDecimal; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * OuterComposite */ @@ -155,5 +174,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("my_number"); + openapiFields.add("my_string"); + openapiFields.add("my_boolean"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OuterComposite + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (OuterComposite.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in OuterComposite is not found in the empty JSON string", OuterComposite.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OuterComposite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OuterComposite` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OuterComposite.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OuterComposite' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OuterComposite.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OuterComposite value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OuterComposite read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OuterComposite given an JSON string + * + * @param jsonString JSON string + * @return An instance of OuterComposite + * @throws IOException if the JSON string is invalid with respect to OuterComposite + */ + public static OuterComposite fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OuterComposite.class); + } + + /** + * Convert an instance of OuterComposite to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnum.java index bd870812102c..c4e27915c8aa 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -56,7 +56,7 @@ public static OuterEnum fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return null; } public static class Adapter extends TypeAdapter { diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnumInteger.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumInteger.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnumInteger.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ParentPet.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ParentPet.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java index 1c1c47105f9d..5d2d5688cb3c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -24,12 +24,29 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.LinkedHashSet; import java.util.List; -import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Pet */ @@ -49,7 +66,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private List photoUrls = new ArrayList(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -180,7 +197,7 @@ public void setName(String name) { } - public Pet photoUrls(Set photoUrls) { + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; @@ -198,12 +215,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Set getPhotoUrls() { + public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(Set photoUrls) { + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } @@ -309,5 +326,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("category"); + openapiFields.add("name"); + openapiFields.add("photoUrls"); + openapiFields.add("tags"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("photoUrls"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Pet.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Pet is not found in the empty JSON string", Pet.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Pet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Pet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `category` + if (jsonObj.getAsJsonObject("category") != null) { + Category.validateJsonObject(jsonObj.getAsJsonObject("category")); + } + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the optional field `tags` (array) + if (jsonArraytags != null) { + for (int i = 0; i < jsonArraytags.size(); i++) { + Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Pet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pet read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Pet given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pet + * @throws IOException if the JSON string is invalid with respect to Pet + */ + public static Pet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pet.class); + } + + /** + * Convert an instance of Pet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pineapple.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pineapple.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e452bf03a014..14b28a610665 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * ReadOnlyFirst */ @@ -124,5 +143,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bar"); + openapiFields.add("baz"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReadOnlyFirst + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ReadOnlyFirst.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadOnlyFirst is not found in the empty JSON string", ReadOnlyFirst.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReadOnlyFirst.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadOnlyFirst` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadOnlyFirst.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadOnlyFirst' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadOnlyFirst.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadOnlyFirst value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadOnlyFirst read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReadOnlyFirst given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadOnlyFirst + * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst + */ + public static ReadOnlyFirst fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadOnlyFirst.class); + } + + /** + * Convert an instance of ReadOnlyFirst to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScaleneTriangle.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScaleneTriangle.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeInterface.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeInterface.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java index 271e41f83231..9b26d894f051 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * SpecialModelName */ @@ -33,6 +52,10 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public static final String SERIALIZED_NAME_SPECIAL_MODEL_NAME = "_special_model.name_"; + @SerializedName(SERIALIZED_NAME_SPECIAL_MODEL_NAME) + private String specialModelName; + public SpecialModelName() { } @@ -59,6 +82,29 @@ public SpecialModelName() { } + public SpecialModelName specialModelName(String specialModelName) { + + this.specialModelName = specialModelName; + return this; + } + + /** + * Get specialModelName + * @return specialModelName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSpecialModelName() { + return specialModelName; + } + + + public void setSpecialModelName(String specialModelName) { + this.specialModelName = specialModelName; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -67,13 +113,14 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName) && + Objects.equals(this.specialModelName, specialModelName.specialModelName); } @Override public int hashCode() { - return Objects.hash($specialPropertyName); + return Objects.hash($specialPropertyName, specialModelName); } @Override @@ -81,6 +128,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append(" specialModelName: ").append(toIndentedString(specialModelName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -96,5 +144,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("$special[property.name]"); + openapiFields.add("_special_model.name_"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SpecialModelName + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SpecialModelName.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SpecialModelName is not found in the empty JSON string", SpecialModelName.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SpecialModelName.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SpecialModelName` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SpecialModelName.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpecialModelName' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SpecialModelName.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SpecialModelName value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SpecialModelName read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SpecialModelName given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecialModelName + * @throws IOException if the JSON string is invalid with respect to SpecialModelName + */ + public static SpecialModelName fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpecialModelName.class); + } + + /** + * Convert an instance of SpecialModelName to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java index 181b1e65048f..0aae4c29af96 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java @@ -24,6 +24,25 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + /** * Tag */ @@ -125,5 +144,90 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Tag + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Tag.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Tag.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Tag.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Tag' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Tag.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Tag value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Tag read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Tag given an JSON string + * + * @param jsonString JSON string + * @return An instance of Tag + * @throws IOException if the JSON string is invalid with respect to Tag + */ + public static Tag fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Tag.class); + } + + /** + * Convert an instance of Tag to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TriangleInterface.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TriangleInterface.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java deleted file mode 100644 index f9fdaf50fe4c..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * TypeHolderDefault - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TypeHolderDefault { - public static final String SERIALIZED_NAME_STRING_ITEM = "string_item"; - @SerializedName(SERIALIZED_NAME_STRING_ITEM) - private String stringItem = "what"; - - public static final String SERIALIZED_NAME_NUMBER_ITEM = "number_item"; - @SerializedName(SERIALIZED_NAME_NUMBER_ITEM) - private BigDecimal numberItem; - - public static final String SERIALIZED_NAME_INTEGER_ITEM = "integer_item"; - @SerializedName(SERIALIZED_NAME_INTEGER_ITEM) - private Integer integerItem; - - public static final String SERIALIZED_NAME_BOOL_ITEM = "bool_item"; - @SerializedName(SERIALIZED_NAME_BOOL_ITEM) - private Boolean boolItem = true; - - public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; - @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); - - public TypeHolderDefault() { - } - - public TypeHolderDefault stringItem(String stringItem) { - - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public String getStringItem() { - return stringItem; - } - - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public BigDecimal getNumberItem() { - return numberItem; - } - - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - - public TypeHolderDefault integerItem(Integer integerItem) { - - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public Integer getIntegerItem() { - return integerItem; - } - - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - - public TypeHolderDefault boolItem(Boolean boolItem) { - - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public Boolean getBoolItem() { - return boolItem; - } - - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - - public TypeHolderDefault arrayItem(List arrayItem) { - - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - - public List getArrayItem() { - return arrayItem; - } - - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java deleted file mode 100644 index a19d60e90227..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * TypeHolderExample - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TypeHolderExample { - public static final String SERIALIZED_NAME_STRING_ITEM = "string_item"; - @SerializedName(SERIALIZED_NAME_STRING_ITEM) - private String stringItem; - - public static final String SERIALIZED_NAME_NUMBER_ITEM = "number_item"; - @SerializedName(SERIALIZED_NAME_NUMBER_ITEM) - private BigDecimal numberItem; - - public static final String SERIALIZED_NAME_FLOAT_ITEM = "float_item"; - @SerializedName(SERIALIZED_NAME_FLOAT_ITEM) - private Float floatItem; - - public static final String SERIALIZED_NAME_INTEGER_ITEM = "integer_item"; - @SerializedName(SERIALIZED_NAME_INTEGER_ITEM) - private Integer integerItem; - - public static final String SERIALIZED_NAME_BOOL_ITEM = "bool_item"; - @SerializedName(SERIALIZED_NAME_BOOL_ITEM) - private Boolean boolItem; - - public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; - @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); - - public TypeHolderExample() { - } - - public TypeHolderExample stringItem(String stringItem) { - - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(example = "what", required = true, value = "") - - public String getStringItem() { - return stringItem; - } - - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - - public TypeHolderExample numberItem(BigDecimal numberItem) { - - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(example = "1.234", required = true, value = "") - - public BigDecimal getNumberItem() { - return numberItem; - } - - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - - public TypeHolderExample floatItem(Float floatItem) { - - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(example = "1.234", required = true, value = "") - - public Float getFloatItem() { - return floatItem; - } - - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - - public TypeHolderExample integerItem(Integer integerItem) { - - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(example = "-2", required = true, value = "") - - public Integer getIntegerItem() { - return integerItem; - } - - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - - public TypeHolderExample boolItem(Boolean boolItem) { - - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(example = "true", required = true, value = "") - - public Boolean getBoolItem() { - return boolItem; - } - - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - - public TypeHolderExample arrayItem(List arrayItem) { - - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - **/ - @javax.annotation.Nonnull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - - public List getArrayItem() { - return arrayItem; - } - - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java index 166fea9628ca..d1b54e47fe4e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java @@ -23,6 +23,26 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; /** * User @@ -61,6 +81,22 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public static final String SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; + @SerializedName(SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS) + private Object objectWithNoDeclaredProps; + + public static final String SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; + @SerializedName(SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) + private Object objectWithNoDeclaredPropsNullable; + + public static final String SERIALIZED_NAME_ANY_TYPE_PROP = "anyTypeProp"; + @SerializedName(SERIALIZED_NAME_ANY_TYPE_PROP) + private Object anyTypeProp = null; + + public static final String SERIALIZED_NAME_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; + @SerializedName(SERIALIZED_NAME_ANY_TYPE_PROP_NULLABLE) + private Object anyTypePropNullable = null; + public User() { } @@ -248,6 +284,98 @@ public void setUserStatus(Integer userStatus) { } + public User objectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { + + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + return this; + } + + /** + * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + * @return objectWithNoDeclaredProps + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.") + + public Object getObjectWithNoDeclaredProps() { + return objectWithNoDeclaredProps; + } + + + public void setObjectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + } + + + public User objectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { + + this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + return this; + } + + /** + * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + * @return objectWithNoDeclaredPropsNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.") + + public Object getObjectWithNoDeclaredPropsNullable() { + return objectWithNoDeclaredPropsNullable; + } + + + public void setObjectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + } + + + public User anyTypeProp(Object anyTypeProp) { + + this.anyTypeProp = anyTypeProp; + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + * @return anyTypeProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389") + + public Object getAnyTypeProp() { + return anyTypeProp; + } + + + public void setAnyTypeProp(Object anyTypeProp) { + this.anyTypeProp = anyTypeProp; + } + + + public User anyTypePropNullable(Object anyTypePropNullable) { + + this.anyTypePropNullable = anyTypePropNullable; + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + * @return anyTypePropNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.") + + public Object getAnyTypePropNullable() { + return anyTypePropNullable; + } + + + public void setAnyTypePropNullable(Object anyTypePropNullable) { + this.anyTypePropNullable = anyTypePropNullable; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -264,12 +392,27 @@ public boolean equals(Object o) { Objects.equals(this.email, user.email) && Objects.equals(this.password, user.password) && Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); + Objects.equals(this.userStatus, user.userStatus) && + Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && + Objects.equals(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && + Objects.equals(this.anyTypeProp, user.anyTypeProp) && + Objects.equals(this.anyTypePropNullable, user.anyTypePropNullable); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, anyTypeProp, anyTypePropNullable); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override @@ -284,6 +427,10 @@ public String toString() { sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append(" objectWithNoDeclaredProps: ").append(toIndentedString(objectWithNoDeclaredProps)).append("\n"); + sb.append(" objectWithNoDeclaredPropsNullable: ").append(toIndentedString(objectWithNoDeclaredPropsNullable)).append("\n"); + sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n"); + sb.append(" anyTypePropNullable: ").append(toIndentedString(anyTypePropNullable)).append("\n"); sb.append("}"); return sb.toString(); } @@ -299,5 +446,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("username"); + openapiFields.add("firstName"); + openapiFields.add("lastName"); + openapiFields.add("email"); + openapiFields.add("password"); + openapiFields.add("phone"); + openapiFields.add("userStatus"); + openapiFields.add("objectWithNoDeclaredProps"); + openapiFields.add("objectWithNoDeclaredPropsNullable"); + openapiFields.add("anyTypeProp"); + openapiFields.add("anyTypePropNullable"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to User + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (User.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Whale.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Whale.java diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java deleted file mode 100644 index 197aac987bc6..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java +++ /dev/null @@ -1,987 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * XmlItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class XmlItem { - public static final String SERIALIZED_NAME_ATTRIBUTE_STRING = "attribute_string"; - @SerializedName(SERIALIZED_NAME_ATTRIBUTE_STRING) - private String attributeString; - - public static final String SERIALIZED_NAME_ATTRIBUTE_NUMBER = "attribute_number"; - @SerializedName(SERIALIZED_NAME_ATTRIBUTE_NUMBER) - private BigDecimal attributeNumber; - - public static final String SERIALIZED_NAME_ATTRIBUTE_INTEGER = "attribute_integer"; - @SerializedName(SERIALIZED_NAME_ATTRIBUTE_INTEGER) - private Integer attributeInteger; - - public static final String SERIALIZED_NAME_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @SerializedName(SERIALIZED_NAME_ATTRIBUTE_BOOLEAN) - private Boolean attributeBoolean; - - public static final String SERIALIZED_NAME_WRAPPED_ARRAY = "wrapped_array"; - @SerializedName(SERIALIZED_NAME_WRAPPED_ARRAY) - private List wrappedArray = null; - - public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; - @SerializedName(SERIALIZED_NAME_NAME_STRING) - private String nameString; - - public static final String SERIALIZED_NAME_NAME_NUMBER = "name_number"; - @SerializedName(SERIALIZED_NAME_NAME_NUMBER) - private BigDecimal nameNumber; - - public static final String SERIALIZED_NAME_NAME_INTEGER = "name_integer"; - @SerializedName(SERIALIZED_NAME_NAME_INTEGER) - private Integer nameInteger; - - public static final String SERIALIZED_NAME_NAME_BOOLEAN = "name_boolean"; - @SerializedName(SERIALIZED_NAME_NAME_BOOLEAN) - private Boolean nameBoolean; - - public static final String SERIALIZED_NAME_NAME_ARRAY = "name_array"; - @SerializedName(SERIALIZED_NAME_NAME_ARRAY) - private List nameArray = null; - - public static final String SERIALIZED_NAME_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @SerializedName(SERIALIZED_NAME_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = null; - - public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; - @SerializedName(SERIALIZED_NAME_PREFIX_STRING) - private String prefixString; - - public static final String SERIALIZED_NAME_PREFIX_NUMBER = "prefix_number"; - @SerializedName(SERIALIZED_NAME_PREFIX_NUMBER) - private BigDecimal prefixNumber; - - public static final String SERIALIZED_NAME_PREFIX_INTEGER = "prefix_integer"; - @SerializedName(SERIALIZED_NAME_PREFIX_INTEGER) - private Integer prefixInteger; - - public static final String SERIALIZED_NAME_PREFIX_BOOLEAN = "prefix_boolean"; - @SerializedName(SERIALIZED_NAME_PREFIX_BOOLEAN) - private Boolean prefixBoolean; - - public static final String SERIALIZED_NAME_PREFIX_ARRAY = "prefix_array"; - @SerializedName(SERIALIZED_NAME_PREFIX_ARRAY) - private List prefixArray = null; - - public static final String SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @SerializedName(SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = null; - - public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; - @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) - private String namespaceString; - - public static final String SERIALIZED_NAME_NAMESPACE_NUMBER = "namespace_number"; - @SerializedName(SERIALIZED_NAME_NAMESPACE_NUMBER) - private BigDecimal namespaceNumber; - - public static final String SERIALIZED_NAME_NAMESPACE_INTEGER = "namespace_integer"; - @SerializedName(SERIALIZED_NAME_NAMESPACE_INTEGER) - private Integer namespaceInteger; - - public static final String SERIALIZED_NAME_NAMESPACE_BOOLEAN = "namespace_boolean"; - @SerializedName(SERIALIZED_NAME_NAMESPACE_BOOLEAN) - private Boolean namespaceBoolean; - - public static final String SERIALIZED_NAME_NAMESPACE_ARRAY = "namespace_array"; - @SerializedName(SERIALIZED_NAME_NAMESPACE_ARRAY) - private List namespaceArray = null; - - public static final String SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @SerializedName(SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = null; - - public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; - @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) - private String prefixNsString; - - public static final String SERIALIZED_NAME_PREFIX_NS_NUMBER = "prefix_ns_number"; - @SerializedName(SERIALIZED_NAME_PREFIX_NS_NUMBER) - private BigDecimal prefixNsNumber; - - public static final String SERIALIZED_NAME_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @SerializedName(SERIALIZED_NAME_PREFIX_NS_INTEGER) - private Integer prefixNsInteger; - - public static final String SERIALIZED_NAME_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @SerializedName(SERIALIZED_NAME_PREFIX_NS_BOOLEAN) - private Boolean prefixNsBoolean; - - public static final String SERIALIZED_NAME_PREFIX_NS_ARRAY = "prefix_ns_array"; - @SerializedName(SERIALIZED_NAME_PREFIX_NS_ARRAY) - private List prefixNsArray = null; - - public static final String SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = null; - - public XmlItem() { - } - - public XmlItem attributeString(String attributeString) { - - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { - return attributeString; - } - - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - - public XmlItem attributeInteger(Integer attributeInteger) { - - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { - return attributeInteger; - } - - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - - public XmlItem wrappedArray(List wrappedArray) { - - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getWrappedArray() { - return wrappedArray; - } - - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - - public XmlItem nameString(String nameString) { - - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - - public String getNameString() { - return nameString; - } - - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - - public XmlItem nameNumber(BigDecimal nameNumber) { - - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - - public BigDecimal getNameNumber() { - return nameNumber; - } - - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - - public XmlItem nameInteger(Integer nameInteger) { - - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { - return nameInteger; - } - - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - - public XmlItem nameBoolean(Boolean nameBoolean) { - - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { - return nameBoolean; - } - - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - - public XmlItem nameArray(List nameArray) { - - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getNameArray() { - return nameArray; - } - - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - - public XmlItem nameWrappedArray(List nameWrappedArray) { - - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getNameWrappedArray() { - return nameWrappedArray; - } - - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - - public XmlItem prefixString(String prefixString) { - - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { - return prefixString; - } - - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - - public XmlItem prefixInteger(Integer prefixInteger) { - - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { - return prefixInteger; - } - - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - - public XmlItem prefixArray(List prefixArray) { - - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getPrefixArray() { - return prefixArray; - } - - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - - public XmlItem namespaceString(String namespaceString) { - - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { - return namespaceString; - } - - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - - public XmlItem namespaceInteger(Integer namespaceInteger) { - - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - - public XmlItem namespaceArray(List namespaceArray) { - - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getNamespaceArray() { - return namespaceArray; - } - - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - - public XmlItem prefixNsString(String prefixNsString) { - - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { - return prefixNsString; - } - - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - - public XmlItem prefixNsArray(List prefixNsArray) { - - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getPrefixNsArray() { - return prefixNsArray; - } - - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Zebra.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java rename to samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Zebra.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java index 9daf2dcf886c..9edd0ae7bedc 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java @@ -342,22 +342,4 @@ public void testNewHttpClient() { public void testNullHttpClient() { apiClient.setHttpClient(null); } - - /** - * Tests the ApiClient serialize methods - */ - @Test - public void testSerializeRequest() throws ApiException { - assertNotNull(apiClient.serialize("test", "text/plain")); - assertNotNull(apiClient.serialize("{}", "application/json")); - } - - /** - * Tests the ApiClient serialize methods with unsupported content-type - * should raise ApiException - */ - @Test(expected = ApiException.class) - public void testUnsupportedSerializeRequest() throws ApiException { - apiClient.serialize("test", "unsupported/type"); - } } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java index 9e6dad1a1908..9d56087899b3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java @@ -2,7 +2,10 @@ import static org.junit.Assert.*; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import java.io.IOException; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; import java.text.DateFormat; @@ -21,6 +24,8 @@ import org.threeten.bp.ZoneOffset; import org.threeten.bp.format.DateTimeFormatter; +import org.openapitools.client.model.*; + public class JSONTest { private ApiClient apiClient = null; private JSON json = null; @@ -196,6 +201,107 @@ public void testByteArrayTypeAdapterDeserialization() { expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8)); } + @Test(expected = IllegalArgumentException.class) + public void testRequiredFieldException() { + // test json string missing required field(s) to ensure exception is thrown + Gson gson = json.getGson(); + //Gson gson = new GsonBuilder() + // .registerTypeAdapter(Pet.class, new Pet.CustomDeserializer()) + // .create(); + String json = "{\"id\": 5847, \"name\":\"tag test 1\"}"; // missing photoUrls (required field) + //String json = "{\"id2\": 5847, \"name\":\"tag test 1\"}"; + //String json = "{\"id\": 5847}"; + Pet p = gson.fromJson(json, Pet.class); + } + + @Test(expected = IllegalArgumentException.class) + public void testAdditionalFieldException() { + // test json string with additional field(s) to ensure exception is thrown + Gson gson = json.getGson(); + //Gson gson = new GsonBuilder() + // .registerTypeAdapter(Tag.class, new Tag.CustomDeserializer()) + // .create(); + String json = "{\"id\": 5847, \"name\":\"tag test 1\", \"new-field\": true}"; + Tag t = gson.fromJson(json, Tag.class); + } + + @Test + public void testCustomDeserializer() { + // test the custom deserializer to ensure it can deserialize json payload into objects + Gson gson = json.getGson(); + //Gson gson = new GsonBuilder() + // .registerTypeAdapter(Tag.class, new Tag.CustomDeserializer()) + // .create(); + // id and name + String json = "{\"id\": 5847, \"name\":\"tag test 1\"}"; + Tag t = gson.fromJson(json, Tag.class); + assertEquals(t.getName(), "tag test 1"); + assertEquals(t.getId(), Long.valueOf(5847L)); + + // name only + String json2 = "{\"name\":\"tag test 1\"}"; + Tag t2 = gson.fromJson(json2, Tag.class); + assertEquals(t2.getName(), "tag test 1"); + assertEquals(t2.getId(), null); + + // with all required fields + String json3 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; + Pet t3 = gson.fromJson(json3, Pet.class); + assertEquals(t3.getName(), "pet test 1"); + assertEquals(t3.getId(), Long.valueOf(5847)); + + // with all required fields and tags (optional) + String json4 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"id\":\"tag 123\"}]}"; + Pet t4 = gson.fromJson(json3, Pet.class); + assertEquals(t4.getName(), "pet test 1"); + assertEquals(t4.getId(), Long.valueOf(5847)); + + // test Tag + String json5 = "{\"unknown_field\": 543, \"id\":\"tag 123\"}"; + Exception exception5 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Tag t5 = gson.fromJson(json5, Tag.class); + }); + assertTrue(exception5.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); + + // test Pet with invalid tags + String json6 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"unknown_field\": 543, \"id\":\"tag 123\"}]}"; + Exception exception6 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Pet t6 = gson.fromJson(json6, Pet.class); + }); + assertTrue(exception6.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); + + // test Pet with invalid tags (required) + String json7 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"unknown_field\": 543, \"id\":\"tag 123\"}]}"; + Exception exception7 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + PetWithRequiredTags t7 = gson.fromJson(json7, PetWithRequiredTags.class); + }); + assertTrue(exception7.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); + + // test Pet with invalid tags (missing reqired) + String json8 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; + Exception exception8 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + PetWithRequiredTags t8 = gson.fromJson(json8, PetWithRequiredTags.class); + }); + assertTrue(exception8.getMessage().contains("The required field `tags` is not found in the JSON string: {\"id\":5847,\"name\":\"pet test 1\",\"photoUrls\":[\"https://a.com\",\"https://b.com\"]}")); + + + } + + /** Model tests for Pet */ + @Test + public void testPet() { + // test Pet + Pet model = new Pet(); + model.setId(1029L); + model.setName("Dog"); + + Pet model2 = new Pet(); + model2.setId(1029L); + model2.setName("Dog"); + + Assert.assertTrue(model.equals(model2)); + } + // Obtained 22JAN2018 from stackoverflow answer by PuguaSoft // https://stackoverflow.com/questions/11399491/java-timezone-offset // Direct link https://stackoverflow.com/a/16680815/3166133 @@ -215,4 +321,130 @@ public static String getCurrentTimezoneOffset() { return offset; } + + /** + * Validate an anyOf schema can be deserialized into the expected class. + * The anyOf schema does not have a discriminator. + */ + @Test + public void testAnyOfSchemaWithoutDiscriminator() throws Exception { + { + String str = "{ \"cultivar\": \"golden delicious\", \"origin\": \"japan\" }"; + + // make sure deserialization works for pojo object + Apple a = json.getGson().fromJson(str, Apple.class); + assertEquals(a.getCultivar(), "golden delicious"); + assertEquals(a.getOrigin(), "japan"); + + GmFruit o = json.getGson().fromJson(str, GmFruit.class); + assertTrue(o.getActualInstance() instanceof Apple); + Apple inst = (Apple) o.getActualInstance(); + assertEquals(inst.getCultivar(), "golden delicious"); + assertEquals(inst.getOrigin(), "japan"); + assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + assertEquals(inst.toJson(), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + assertEquals(o.toJson(), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + + String str2 = "{ \"origin_typo\": \"japan\" }"; + // no match + Exception exception = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Apple o3 = json.getGson().fromJson(str2, Apple.class); + }); + + // no match + Exception exception3 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Banana o2 = json.getGson().fromJson(str2, Banana.class); + }); + + // no match + Exception exception4 = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { + GmFruit o2 = json.getGson().fromJson(str2, GmFruit.class); + }); + } + } + + /** + * Validate a oneOf schema can be deserialized into the expected class. + * The oneOf schema does not have a discriminator. + */ + @Test + public void testOneOfSchemaWithoutDiscriminator() throws Exception { + // BananaReq and AppleReq have explicitly defined properties that are different by name. + // There is no discriminator property. + { + String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false }"; + + // make sure deserialization works for pojo object + AppleReq a = json.getGson().fromJson(str, AppleReq.class); + assertEquals(a.getCultivar(), "golden delicious"); + assertEquals(a.getMealy(), false); + + FruitReq o = json.getGson().fromJson(str, FruitReq.class); + assertTrue(o.getActualInstance() instanceof AppleReq); + AppleReq inst = (AppleReq) o.getActualInstance(); + assertEquals(inst.getCultivar(), "golden delicious"); + assertEquals(inst.getMealy(), false); + assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(inst.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(o.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + + AppleReq inst2 = o.getAppleReq(); + assertEquals(inst2.getCultivar(), "golden delicious"); + assertEquals(inst2.getMealy(), false); + assertEquals(json.getGson().toJson(inst2), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(inst2.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + + // test fromJson + FruitReq o3 = FruitReq.fromJson(str); + assertTrue(o3.getActualInstance() instanceof AppleReq); + AppleReq inst3 = (AppleReq) o3.getActualInstance(); + assertEquals(inst3.getCultivar(), "golden delicious"); + assertEquals(inst3.getMealy(), false); + assertEquals(json.getGson().toJson(inst3), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(inst3.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(o3.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + } + { + // test to ensure the oneOf object can be serialized to "null" correctly + FruitReq o = new FruitReq(); + assertEquals(o.getActualInstance(), null); + assertEquals(json.getGson().toJson(o), "null"); + assertEquals(o.toJson(), "null"); + assertEquals(json.getGson().toJson(null), "null"); + } + { + // Same test, but this time with additional (undeclared) properties. + // Since FruitReq has additionalProperties: false, deserialization should fail. + String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false, \"garbage_prop\": \"abc\" }"; + Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { + FruitReq o = json.getGson().fromJson(str, FruitReq.class); + }); + assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result, expected 1. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}")); + } + { + String str = "{ \"lengthCm\": 17 }"; + + // make sure deserialization works for pojo object + BananaReq b = json.getGson().fromJson(str, BananaReq.class); + assertEquals(b.getLengthCm(), new java.math.BigDecimal(17)); + + FruitReq o = json.getGson().fromJson(str, FruitReq.class); + assertTrue(o.getActualInstance() instanceof BananaReq); + BananaReq inst = (BananaReq) o.getActualInstance(); + assertEquals(inst.getLengthCm(), new java.math.BigDecimal(17)); + assertEquals(json.getGson().toJson(o), "{\"lengthCm\":17}"); + assertEquals(json.getGson().toJson(inst), "{\"lengthCm\":17}"); + } + { + // Try to deserialize empty object. This should fail 'oneOf' because none will match + // AppleReq or BananaReq. + String str = "{ }"; + Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { + json.getGson().fromJson(str, FruitReq.class); + }); + assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result, expected 1")); + } + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/DefaultApiTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/DefaultApiTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/DefaultApiTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java index e27079ca0c60..471887d2611e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -2,149 +2,170 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.api; +package org.openapitools.client.api; -import java.io.File; -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; -import org.junit.Ignore; -import org.junit.Test; import org.openapitools.client.ApiException; +import java.math.BigDecimal; import org.openapitools.client.model.Client; -import org.openapitools.client.model.FileSchemaTestClass; -import org.openapitools.client.model.OuterComposite; -import org.openapitools.client.model.User; -import org.openapitools.client.model.XmlItem; +import java.io.File; +import org.openapitools.client.model.HealthCheckResult; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; -/** API tests for FakeApi */ +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FakeApi + */ @Ignore public class FakeApiTest { private final FakeApi api = new FakeApi(); + /** - * creates an XmlItem + * Health check endpoint * - *

    this route creates an XmlItem + * * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test - public void createXmlItemTest() throws ApiException { - XmlItem xmlItem = null; - api.createXmlItem(xmlItem); - + public void fakeHealthGetTest() throws ApiException { + HealthCheckResult response = api.fakeHealthGet(); // TODO: test validations } - + /** + * + * * Test serialization of outer boolean types * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); - + Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations } - + /** + * + * * Test serialization of object with outer number type * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test public void fakeOuterCompositeSerializeTest() throws ApiException { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); - + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); // TODO: test validations } - + /** + * + * * Test serialization of outer number types * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test public void fakeOuterNumberSerializeTest() throws ApiException { BigDecimal body = null; - BigDecimal response = api.fakeOuterNumberSerialize(body); - + BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations } - + /** + * + * * Test serialization of outer string types * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test public void fakeOuterStringSerializeTest() throws ApiException { String body = null; - String response = api.fakeOuterStringSerialize(body); - + String response = api.fakeOuterStringSerialize(body); // TODO: test validations } - + /** - * For this test, the body for this request much reference a schema named `File`. + * Array of Enums + * + * * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test - public void testBodyWithFileSchemaTest() throws ApiException { - FileSchemaTestClass body = null; - api.testBodyWithFileSchema(body); - + public void getArrayOfEnumsTest() throws ApiException { + List response = api.getArrayOfEnums(); // TODO: test validations } - - /** @throws ApiException if the Api call fails */ + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test public void testBodyWithQueryParamsTest() throws ApiException { String query = null; - User body = null; - api.testBodyWithQueryParams(query, body); - + User user = null; + api.testBodyWithQueryParams(query, user); // TODO: test validations } - + /** * To test \"client\" model * - *

    To test \"client\" model + * To test \"client\" model * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test public void testClientModelTest() throws ApiException { - Client body = null; - Client response = api.testClientModel(body); - + Client client = null; + Client response = api.testClientModel(client); // TODO: test validations } - + /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - *

    Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test public void testEndpointParametersTest() throws ApiException { @@ -162,31 +183,17 @@ public void testEndpointParametersTest() throws ApiException { OffsetDateTime dateTime = null; String password = null; String paramCallback = null; - api.testEndpointParameters( - number, - _double, - patternWithoutDelimiter, - _byte, - integer, - int32, - int64, - _float, - string, - binary, - date, - dateTime, - password, - paramCallback); - + api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); // TODO: test validations } - + /** * To test enum parameters * - *

    To test enum parameters + * To test enum parameters * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test public void testEnumParametersTest() throws ApiException { @@ -198,25 +205,17 @@ public void testEnumParametersTest() throws ApiException { Double enumQueryDouble = null; List enumFormStringArray = null; String enumFormString = null; - api.testEnumParameters( - enumHeaderStringArray, - enumHeaderString, - enumQueryStringArray, - enumQueryString, - enumQueryInteger, - enumQueryDouble, - enumFormStringArray, - enumFormString); - + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); // TODO: test validations } - + /** * Fake endpoint to test group parameters (optional) * - *

    Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) * - * @throws ApiException if the Api call fails + * @throws ApiException + * if the Api call fails */ @Test public void testGroupParametersTest() throws ApiException { @@ -226,39 +225,62 @@ public void testGroupParametersTest() throws ApiException { Integer stringGroup = null; Boolean booleanGroup = null; Long int64Group = null; - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) .stringGroup(stringGroup) .booleanGroup(booleanGroup) .int64Group(int64Group) .execute(); - // TODO: test validations } - + /** * test inline additionalProperties * - * @throws ApiException if the Api call fails + * + * + * @throws ApiException + * if the Api call fails */ @Test public void testInlineAdditionalPropertiesTest() throws ApiException { - Map param = null; - api.testInlineAdditionalProperties(param); - + Map requestBody = null; + api.testInlineAdditionalProperties(requestBody); // TODO: test validations } - + /** * test json serialization of form data * - * @throws ApiException if the Api call fails + * + * + * @throws ApiException + * if the Api call fails */ @Test public void testJsonFormDataTest() throws ApiException { String param = null; String param2 = null; - api.testJsonFormData(param, param2); - + api.testJsonFormData(param, param2); + // TODO: test validations + } + + /** + * + * + * To test the collection format in query parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() throws ApiException { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); // TODO: test validations } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java index 47f8fed5c86c..a4e3dcec14c2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -337,7 +337,7 @@ public void testFindPetsByTags() throws Exception { api.updatePet(pet); - Set pets = api.findPetsByTags(new HashSet<>(Arrays.asList("friendly"))); + List pets = api.findPetsByTags((Arrays.asList("friendly"))); assertNotNull(pets); boolean found = false; @@ -368,6 +368,7 @@ public void testUpdatePetWithForm() throws Exception { } @Test + @Ignore public void testDeletePet() throws Exception { Pet pet = createPet(); api.addPet(pet); @@ -410,7 +411,7 @@ public void testEqualsAndHashCode() { pet2.setName("really-happy"); pet2.setPhotoUrls( - new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); + (Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); assertFalse(pet1.equals(pet2)); assertFalse(pet2.equals(pet1)); assertFalse(pet1.hashCode() == (pet2.hashCode())); @@ -419,7 +420,7 @@ public void testEqualsAndHashCode() { pet1.setName("really-happy"); pet1.setPhotoUrls( - new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); + (Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); assertTrue(pet1.equals(pet2)); assertTrue(pet2.equals(pet1)); assertTrue(pet1.hashCode() == pet2.hashCode()); @@ -437,8 +438,8 @@ private Pet createPet() { pet.setCategory(category); pet.setStatus(Pet.StatusEnum.AVAILABLE); - Set photos = - new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); + List photos = + (Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); pet.setPhotoUrls(photos); return pet; diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java deleted file mode 100644 index 430462cf43b6..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { - private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); - - /** Model tests for AdditionalPropertiesAnyType */ - @Test - public void testAdditionalPropertiesAnyType() { - // TODO: test AdditionalPropertiesAnyType - } - - /** Test the property 'name' */ - @Test - public void nameTest() { - // TODO: test name - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java deleted file mode 100644 index b9d65fe3eea7..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { - private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); - - /** Model tests for AdditionalPropertiesArray */ - @Test - public void testAdditionalPropertiesArray() { - // TODO: test AdditionalPropertiesArray - } - - /** Test the property 'name' */ - @Test - public void nameTest() { - // TODO: test name - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java deleted file mode 100644 index b06e5479b6be..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { - private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); - - /** Model tests for AdditionalPropertiesBoolean */ - @Test - public void testAdditionalPropertiesBoolean() { - // TODO: test AdditionalPropertiesBoolean - } - - /** Test the property 'name' */ - @Test - public void nameTest() { - // TODO: test name - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 88d7524b60e7..ba387a41bf5d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -2,38 +2,110 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for AdditionalPropertiesClass */ + +/** + * Model tests for AdditionalPropertiesClass + */ public class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); - /** Model tests for AdditionalPropertiesClass */ + /** + * Model tests for AdditionalPropertiesClass + */ @Test public void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } - /** Test the property 'mapProperty' */ + /** + * Test the property 'mapProperty' + */ @Test public void mapPropertyTest() { // TODO: test mapProperty } - /** Test the property 'mapOfMapProperty' */ + /** + * Test the property 'mapOfMapProperty' + */ @Test public void mapOfMapPropertyTest() { // TODO: test mapOfMapProperty } + + /** + * Test the property 'anytype1' + */ + @Test + public void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype1' + */ + @Test + public void mapWithUndeclaredPropertiesAnytype1Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype1 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype2' + */ + @Test + public void mapWithUndeclaredPropertiesAnytype2Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype2 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype3' + */ + @Test + public void mapWithUndeclaredPropertiesAnytype3Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype3 + } + + /** + * Test the property 'emptyMap' + */ + @Test + public void emptyMapTest() { + // TODO: test emptyMap + } + + /** + * Test the property 'mapWithUndeclaredPropertiesString' + */ + @Test + public void mapWithUndeclaredPropertiesStringTest() { + // TODO: test mapWithUndeclaredPropertiesString + } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java deleted file mode 100644 index 32c1059ad2a0..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { - private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); - - /** Model tests for AdditionalPropertiesInteger */ - @Test - public void testAdditionalPropertiesInteger() { - // TODO: test AdditionalPropertiesInteger - } - - /** Test the property 'name' */ - @Test - public void nameTest() { - // TODO: test name - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java deleted file mode 100644 index e6a7397cd47b..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { - private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); - - /** Model tests for AdditionalPropertiesNumber */ - @Test - public void testAdditionalPropertiesNumber() { - // TODO: test AdditionalPropertiesNumber - } - - /** Test the property 'name' */ - @Test - public void nameTest() { - // TODO: test name - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java deleted file mode 100644 index d4a8e5ccbd5d..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { - private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); - - /** Model tests for AdditionalPropertiesObject */ - @Test - public void testAdditionalPropertiesObject() { - // TODO: test AdditionalPropertiesObject - } - - /** Test the property 'name' */ - @Test - public void nameTest() { - // TODO: test name - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java deleted file mode 100644 index 7fbf7373e79b..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { - private final AdditionalPropertiesString model = new AdditionalPropertiesString(); - - /** Model tests for AdditionalPropertiesString */ - @Test - public void testAdditionalPropertiesString() { - // TODO: test AdditionalPropertiesString - } - - /** Test the property 'name' */ - @Test - public void nameTest() { - // TODO: test name - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AnimalTest.java index 3fc1aa69d6db..b11ec766286b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -2,38 +2,60 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Animal */ + +/** + * Model tests for Animal + */ public class AnimalTest { private final Animal model = new Animal(); - /** Model tests for Animal */ + /** + * Model tests for Animal + */ @Test public void testAnimal() { // TODO: test Animal } - /** Test the property 'className' */ + /** + * Test the property 'className' + */ @Test public void classNameTest() { // TODO: test className } - /** Test the property 'color' */ + /** + * Test the property 'color' + */ @Test public void colorTest() { // TODO: test color } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleReqTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AppleReqTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleReqTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AppleReqTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AppleTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/AppleTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java deleted file mode 100644 index 8760f56d594c..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Test; - -/** Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { - private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); - - /** Model tests for ArrayOfArrayOfNumberOnly */ - @Test - public void test() { - // TODO: test ArrayOfArrayOfNumberOnly - } - - /** Test the property 'arrayArrayNumber' */ - @Test - public void arrayArrayNumberTest() { - BigDecimal b1 = new BigDecimal("12.3"); - BigDecimal b2 = new BigDecimal("5.6"); - List arrayArrayNumber = new ArrayList(); - arrayArrayNumber.add(b1); - arrayArrayNumber.add(b2); - model.setArrayArrayNumber(new ArrayList>()); - model.getArrayArrayNumber().add(arrayArrayNumber); - - // create another instance for comparison - BigDecimal b3 = new BigDecimal("12.3"); - BigDecimal b4 = new BigDecimal("5.6"); - ArrayOfArrayOfNumberOnly model2 = new ArrayOfArrayOfNumberOnly(); - List arrayArrayNumber2 = new ArrayList(); - arrayArrayNumber2.add(b1); - arrayArrayNumber2.add(b2); - model2.setArrayArrayNumber(new ArrayList>()); - model2.getArrayArrayNumber().add(arrayArrayNumber2); - - Assert.assertTrue(model2.equals(model)); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 943881b40a63..9afc3397f46c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -2,32 +2,53 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for ArrayOfNumberOnly */ + +/** + * Model tests for ArrayOfNumberOnly + */ public class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); - /** Model tests for ArrayOfNumberOnly */ + /** + * Model tests for ArrayOfNumberOnly + */ @Test public void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } - /** Test the property 'arrayNumber' */ + /** + * Test the property 'arrayNumber' + */ @Test public void arrayNumberTest() { // TODO: test arrayNumber } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 8aa245e54fbb..fab9a30565f3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -2,44 +2,69 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for ArrayTest */ + +/** + * Model tests for ArrayTest + */ public class ArrayTestTest { private final ArrayTest model = new ArrayTest(); - /** Model tests for ArrayTest */ + /** + * Model tests for ArrayTest + */ @Test public void testArrayTest() { // TODO: test ArrayTest } - /** Test the property 'arrayOfString' */ + /** + * Test the property 'arrayOfString' + */ @Test public void arrayOfStringTest() { // TODO: test arrayOfString } - /** Test the property 'arrayArrayOfInteger' */ + /** + * Test the property 'arrayArrayOfInteger' + */ @Test public void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } - /** Test the property 'arrayArrayOfModel' */ + /** + * Test the property 'arrayArrayOfModel' + */ @Test public void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaReqTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BananaReqTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaReqTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BananaReqTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BananaTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BananaTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BasquePigTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BasquePigTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BasquePigTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BasquePigTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java deleted file mode 100644 index 256f7087f38c..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for BigCatAllOf */ -public class BigCatAllOfTest { - private final BigCatAllOf model = new BigCatAllOf(); - - /** Model tests for BigCatAllOf */ - @Test - public void testBigCatAllOf() { - // TODO: test BigCatAllOf - } - - /** Test the property 'kind' */ - @Test - public void kindTest() { - // TODO: test kind - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java deleted file mode 100644 index 4591ecd4d6a7..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for BigCat */ -public class BigCatTest { - private final BigCat model = new BigCat(); - - /** Model tests for BigCat */ - @Test - public void testBigCat() { - // TODO: test BigCat - } - - /** Test the property 'className' */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** Test the property 'color' */ - @Test - public void colorTest() { - // TODO: test color - } - - /** Test the property 'declawed' */ - @Test - public void declawedTest() { - // TODO: test declawed - } - - /** Test the property 'kind' */ - @Test - public void kindTest() { - // TODO: test kind - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CapitalizationTest.java index d4e6c28023c4..ced4f48eb5f9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -2,62 +2,90 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Capitalization */ + +/** + * Model tests for Capitalization + */ public class CapitalizationTest { private final Capitalization model = new Capitalization(); - /** Model tests for Capitalization */ + /** + * Model tests for Capitalization + */ @Test public void testCapitalization() { // TODO: test Capitalization } - /** Test the property 'smallCamel' */ + /** + * Test the property 'smallCamel' + */ @Test public void smallCamelTest() { // TODO: test smallCamel } - /** Test the property 'capitalCamel' */ + /** + * Test the property 'capitalCamel' + */ @Test public void capitalCamelTest() { // TODO: test capitalCamel } - /** Test the property 'smallSnake' */ + /** + * Test the property 'smallSnake' + */ @Test public void smallSnakeTest() { // TODO: test smallSnake } - /** Test the property 'capitalSnake' */ + /** + * Test the property 'capitalSnake' + */ @Test public void capitalSnakeTest() { // TODO: test capitalSnake } - /** Test the property 'scAETHFlowPoints' */ + /** + * Test the property 'scAETHFlowPoints' + */ @Test public void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } - /** Test the property 'ATT_NAME' */ + /** + * Test the property 'ATT_NAME' + */ @Test public void ATT_NAMETest() { // TODO: test ATT_NAME } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatAllOfTest.java index ce9fa9c4663c..384ab21b773b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatAllOfTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -2,32 +2,50 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for CatAllOf */ + +/** + * Model tests for CatAllOf + */ public class CatAllOfTest { private final CatAllOf model = new CatAllOf(); - /** Model tests for CatAllOf */ + /** + * Model tests for CatAllOf + */ @Test public void testCatAllOf() { // TODO: test CatAllOf } - /** Test the property 'declawed' */ + /** + * Test the property 'declawed' + */ @Test public void declawedTest() { // TODO: test declawed } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatTest.java index 41fc819a99b2..b2b3e7e048d9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CatTest.java @@ -2,44 +2,68 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.CatAllOf; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Cat */ + +/** + * Model tests for Cat + */ public class CatTest { private final Cat model = new Cat(); - /** Model tests for Cat */ + /** + * Model tests for Cat + */ @Test public void testCat() { // TODO: test Cat } - /** Test the property 'className' */ + /** + * Test the property 'className' + */ @Test public void classNameTest() { // TODO: test className } - /** Test the property 'color' */ + /** + * Test the property 'color' + */ @Test public void colorTest() { // TODO: test color } - /** Test the property 'declawed' */ + /** + * Test the property 'declawed' + */ @Test public void declawedTest() { // TODO: test declawed } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CategoryTest.java index 37048d7a8616..a6efa6e1fbc6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -2,38 +2,58 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Category */ + +/** + * Model tests for Category + */ public class CategoryTest { private final Category model = new Category(); - /** Model tests for Category */ + /** + * Model tests for Category + */ @Test public void testCategory() { // TODO: test Category } - /** Test the property 'id' */ + /** + * Test the property 'id' + */ @Test public void idTest() { // TODO: test id } - /** Test the property 'name' */ + /** + * Test the property 'name' + */ @Test public void nameTest() { // TODO: test name } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClassModelTest.java index bb4bfead7f93..1233feec65ec 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -2,32 +2,50 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for ClassModel */ + +/** + * Model tests for ClassModel + */ public class ClassModelTest { private final ClassModel model = new ClassModel(); - /** Model tests for ClassModel */ + /** + * Model tests for ClassModel + */ @Test public void testClassModel() { // TODO: test ClassModel } - /** Test the property 'propertyClass' */ + /** + * Test the property 'propertyClass' + */ @Test public void propertyClassTest() { // TODO: test propertyClass } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClientTest.java index ebc46fd2c49f..456fab74c4d7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ClientTest.java @@ -2,32 +2,50 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Client */ + +/** + * Model tests for Client + */ public class ClientTest { private final Client model = new Client(); - /** Model tests for Client */ + /** + * Model tests for Client + */ @Test public void testClient() { // TODO: test Client } - /** Test the property 'client' */ + /** + * Test the property 'client' + */ @Test public void clientTest() { // TODO: test client } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DanishPigTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DanishPigTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DanishPigTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DanishPigTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogAllOfTest.java index 5c7775454c03..0d695b15a639 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogAllOfTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -2,32 +2,50 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for DogAllOf */ + +/** + * Model tests for DogAllOf + */ public class DogAllOfTest { private final DogAllOf model = new DogAllOf(); - /** Model tests for DogAllOf */ + /** + * Model tests for DogAllOf + */ @Test public void testDogAllOf() { // TODO: test DogAllOf } - /** Test the property 'breed' */ + /** + * Test the property 'breed' + */ @Test public void breedTest() { // TODO: test breed } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogTest.java index 4c0e461bc95f..124bc99c1f12 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DogTest.java @@ -2,44 +2,68 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.DogAllOf; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Dog */ + +/** + * Model tests for Dog + */ public class DogTest { private final Dog model = new Dog(); - /** Model tests for Dog */ + /** + * Model tests for Dog + */ @Test public void testDog() { // TODO: test Dog } - /** Test the property 'className' */ + /** + * Test the property 'className' + */ @Test public void classNameTest() { // TODO: test className } - /** Test the property 'color' */ + /** + * Test the property 'color' + */ @Test public void colorTest() { // TODO: test color } - /** Test the property 'breed' */ + /** + * Test the property 'breed' + */ @Test public void breedTest() { // TODO: test breed } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DrawingTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DrawingTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DrawingTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/DrawingTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumArraysTest.java index b9201504fbed..c25b05e9f0d1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -2,38 +2,60 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for EnumArrays */ + +/** + * Model tests for EnumArrays + */ public class EnumArraysTest { private final EnumArrays model = new EnumArrays(); - /** Model tests for EnumArrays */ + /** + * Model tests for EnumArrays + */ @Test public void testEnumArrays() { // TODO: test EnumArrays } - /** Test the property 'justSymbol' */ + /** + * Test the property 'justSymbol' + */ @Test public void justSymbolTest() { // TODO: test justSymbol } - /** Test the property 'arrayEnum' */ + /** + * Test the property 'arrayEnum' + */ @Test public void arrayEnumTest() { // TODO: test arrayEnum } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumClassTest.java index e2b56f33f9f4..329454658e33 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -2,24 +2,33 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for EnumClass */ + +/** + * Model tests for EnumClass + */ public class EnumClassTest { - /** Model tests for EnumClass */ + /** + * Model tests for EnumClass + */ @Test public void testEnumClass() { // TODO: test EnumClass } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumTestTest.java index 2bced4c6fdcd..54c181bf9f3f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -2,56 +2,119 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for EnumTest */ + +/** + * Model tests for EnumTest + */ public class EnumTestTest { private final EnumTest model = new EnumTest(); - /** Model tests for EnumTest */ + /** + * Model tests for EnumTest + */ @Test public void testEnumTest() { // TODO: test EnumTest } - /** Test the property 'enumString' */ + /** + * Test the property 'enumString' + */ @Test public void enumStringTest() { // TODO: test enumString } - /** Test the property 'enumStringRequired' */ + /** + * Test the property 'enumStringRequired' + */ @Test public void enumStringRequiredTest() { // TODO: test enumStringRequired } - /** Test the property 'enumInteger' */ + /** + * Test the property 'enumInteger' + */ @Test public void enumIntegerTest() { // TODO: test enumInteger } - /** Test the property 'enumNumber' */ + /** + * Test the property 'enumIntegerOnly' + */ + @Test + public void enumIntegerOnlyTest() { + // TODO: test enumIntegerOnly + } + + /** + * Test the property 'enumNumber' + */ @Test public void enumNumberTest() { // TODO: test enumNumber } - /** Test the property 'outerEnum' */ + /** + * Test the property 'outerEnum' + */ @Test public void outerEnumTest() { // TODO: test outerEnum } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java deleted file mode 100644 index c69c54780f8c..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.openapitools.client.model; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import com.google.gson.Gson; -import org.junit.Test; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - // test serialization - Gson gson = new Gson(); - String json = gson.toJson(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1}"); - - // test deserialization - EnumTest fromString = gson.fromJson(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumString().getValue(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertTrue(fromString.getEnumInteger().getValue() == 1); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - assertTrue(fromString.getEnumNumber().getValue() == 1.1); - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 0f7eba902340..5660bd5e9016 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -2,38 +2,61 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for FileSchemaTestClass */ + +/** + * Model tests for FileSchemaTestClass + */ public class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); - /** Model tests for FileSchemaTestClass */ + /** + * Model tests for FileSchemaTestClass + */ @Test public void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } - /** Test the property 'file' */ + /** + * Test the property '_file' + */ @Test - public void fileTest() { - // TODO: test file + public void _fileTest() { + // TODO: test _file } - /** Test the property 'files' */ + /** + * Test the property 'files' + */ @Test public void filesTest() { // TODO: test files } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FooTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FooTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FooTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java index e96ca5285a32..6d3c5e1c2a82 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -2,104 +2,175 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.UUID; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for FormatTest */ + +/** + * Model tests for FormatTest + */ public class FormatTestTest { private final FormatTest model = new FormatTest(); - /** Model tests for FormatTest */ + /** + * Model tests for FormatTest + */ @Test public void testFormatTest() { // TODO: test FormatTest } - /** Test the property 'integer' */ + /** + * Test the property 'integer' + */ @Test public void integerTest() { // TODO: test integer } - /** Test the property 'int32' */ + /** + * Test the property 'int32' + */ @Test public void int32Test() { // TODO: test int32 } - /** Test the property 'int64' */ + /** + * Test the property 'int64' + */ @Test public void int64Test() { // TODO: test int64 } - /** Test the property 'number' */ + /** + * Test the property 'number' + */ @Test public void numberTest() { // TODO: test number } - /** Test the property '_float' */ + /** + * Test the property '_float' + */ @Test public void _floatTest() { // TODO: test _float } - /** Test the property '_double' */ + /** + * Test the property '_double' + */ @Test public void _doubleTest() { // TODO: test _double } - /** Test the property 'string' */ + /** + * Test the property 'decimal' + */ + @Test + public void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ @Test public void stringTest() { // TODO: test string } - /** Test the property '_byte' */ + /** + * Test the property '_byte' + */ @Test public void _byteTest() { // TODO: test _byte } - /** Test the property 'binary' */ + /** + * Test the property 'binary' + */ @Test public void binaryTest() { // TODO: test binary } - /** Test the property 'date' */ + /** + * Test the property 'date' + */ @Test public void dateTest() { // TODO: test date } - /** Test the property 'dateTime' */ + /** + * Test the property 'dateTime' + */ @Test public void dateTimeTest() { // TODO: test dateTime } - /** Test the property 'uuid' */ + /** + * Test the property 'uuid' + */ @Test public void uuidTest() { // TODO: test uuid } - /** Test the property 'password' */ + /** + * Test the property 'password' + */ @Test public void passwordTest() { // TODO: test password } + + /** + * Test the property 'patternWithDigits' + */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitReqTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FruitReqTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitReqTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FruitReqTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FruitTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FruitTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GmFruitTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/GmFruitTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GmFruitTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/GmFruitTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index 1befaa708c67..0272d7b80004 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -2,38 +2,58 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for HasOnlyReadOnly */ + +/** + * Model tests for HasOnlyReadOnly + */ public class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); - /** Model tests for HasOnlyReadOnly */ + /** + * Model tests for HasOnlyReadOnly + */ @Test public void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } - /** Test the property 'bar' */ + /** + * Test the property 'bar' + */ @Test public void barTest() { // TODO: test bar } - /** Test the property 'foo' */ + /** + * Test the property 'foo' + */ @Test public void fooTest() { // TODO: test foo } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MammalTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MammalTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MammalTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MammalTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MapTestTest.java index 9d1fc952d5fd..f86a1303fc88 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -2,50 +2,77 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for MapTest */ + +/** + * Model tests for MapTest + */ public class MapTestTest { private final MapTest model = new MapTest(); - /** Model tests for MapTest */ + /** + * Model tests for MapTest + */ @Test public void testMapTest() { // TODO: test MapTest } - /** Test the property 'mapMapOfString' */ + /** + * Test the property 'mapMapOfString' + */ @Test public void mapMapOfStringTest() { // TODO: test mapMapOfString } - /** Test the property 'mapOfEnumString' */ + /** + * Test the property 'mapOfEnumString' + */ @Test public void mapOfEnumStringTest() { // TODO: test mapOfEnumString } - /** Test the property 'directMap' */ + /** + * Test the property 'directMap' + */ @Test public void directMapTest() { // TODO: test directMap } - /** Test the property 'indirectMap' */ + /** + * Test the property 'indirectMap' + */ @Test public void indirectMapTest() { // TODO: test indirectMap } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 73646592bd59..808773a5d852 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -2,45 +2,72 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for MixedPropertiesAndAdditionalPropertiesClass */ + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ public class MixedPropertiesAndAdditionalPropertiesClassTest { - private final MixedPropertiesAndAdditionalPropertiesClass model = - new MixedPropertiesAndAdditionalPropertiesClass(); + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); - /** Model tests for MixedPropertiesAndAdditionalPropertiesClass */ + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ @Test public void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } - /** Test the property 'uuid' */ + /** + * Test the property 'uuid' + */ @Test public void uuidTest() { // TODO: test uuid } - /** Test the property 'dateTime' */ + /** + * Test the property 'dateTime' + */ @Test public void dateTimeTest() { // TODO: test dateTime } - /** Test the property 'map' */ + /** + * Test the property 'map' + */ @Test public void mapTest() { // TODO: test map } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index bea71b18c635..d81fa5a0f669 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -2,38 +2,58 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Model200Response */ + +/** + * Model tests for Model200Response + */ public class Model200ResponseTest { private final Model200Response model = new Model200Response(); - /** Model tests for Model200Response */ + /** + * Model tests for Model200Response + */ @Test public void testModel200Response() { // TODO: test Model200Response } - /** Test the property 'name' */ + /** + * Test the property 'name' + */ @Test public void nameTest() { // TODO: test name } - /** Test the property 'propertyClass' */ + /** + * Test the property 'propertyClass' + */ @Test public void propertyClassTest() { // TODO: test propertyClass } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index e3b5dd76854f..91bd8fada260 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -2,44 +2,66 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for ModelApiResponse */ + +/** + * Model tests for ModelApiResponse + */ public class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); - /** Model tests for ModelApiResponse */ + /** + * Model tests for ModelApiResponse + */ @Test public void testModelApiResponse() { // TODO: test ModelApiResponse } - /** Test the property 'code' */ + /** + * Test the property 'code' + */ @Test public void codeTest() { // TODO: test code } - /** Test the property 'type' */ + /** + * Test the property 'type' + */ @Test public void typeTest() { // TODO: test type } - /** Test the property 'message' */ + /** + * Test the property 'message' + */ @Test public void messageTest() { // TODO: test message } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelReturnTest.java index fac09a012c13..f317fef485ea 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -2,32 +2,50 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for ModelReturn */ + +/** + * Model tests for ModelReturn + */ public class ModelReturnTest { private final ModelReturn model = new ModelReturn(); - /** Model tests for ModelReturn */ + /** + * Model tests for ModelReturn + */ @Test public void testModelReturn() { // TODO: test ModelReturn } - /** Test the property '_return' */ + /** + * Test the property '_return' + */ @Test public void _returnTest() { // TODO: test _return } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NameTest.java index ad86a79a140f..1ed41a0f80c7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NameTest.java @@ -2,50 +2,74 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Name */ + +/** + * Model tests for Name + */ public class NameTest { private final Name model = new Name(); - /** Model tests for Name */ + /** + * Model tests for Name + */ @Test public void testName() { // TODO: test Name } - /** Test the property 'name' */ + /** + * Test the property 'name' + */ @Test public void nameTest() { // TODO: test name } - /** Test the property 'snakeCase' */ + /** + * Test the property 'snakeCase' + */ @Test public void snakeCaseTest() { // TODO: test snakeCase } - /** Test the property 'property' */ + /** + * Test the property 'property' + */ @Test public void propertyTest() { // TODO: test property } - /** Test the property '_123number' */ + /** + * Test the property '_123number' + */ @Test public void _123numberTest() { // TODO: test _123number } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NullableClassTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableClassTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NullableClassTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableShapeTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NullableShapeTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableShapeTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NullableShapeTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index c321b5be9632..15b74f7ef8bf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -2,32 +2,51 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for NumberOnly */ + +/** + * Model tests for NumberOnly + */ public class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); - /** Model tests for NumberOnly */ + /** + * Model tests for NumberOnly + */ @Test public void testNumberOnly() { // TODO: test NumberOnly } - /** Test the property 'justNumber' */ + /** + * Test the property 'justNumber' + */ @Test public void justNumberTest() { // TODO: test justNumber } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java index d5a62b678577..b5cc55e4f581 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java @@ -2,62 +2,91 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Order */ + +/** + * Model tests for Order + */ public class OrderTest { private final Order model = new Order(); - /** Model tests for Order */ + /** + * Model tests for Order + */ @Test public void testOrder() { // TODO: test Order } - /** Test the property 'id' */ + /** + * Test the property 'id' + */ @Test public void idTest() { // TODO: test id } - /** Test the property 'petId' */ + /** + * Test the property 'petId' + */ @Test public void petIdTest() { // TODO: test petId } - /** Test the property 'quantity' */ + /** + * Test the property 'quantity' + */ @Test public void quantityTest() { // TODO: test quantity } - /** Test the property 'shipDate' */ + /** + * Test the property 'shipDate' + */ @Test public void shipDateTest() { // TODO: test shipDate } - /** Test the property 'status' */ + /** + * Test the property 'status' + */ @Test public void statusTest() { // TODO: test status } - /** Test the property 'complete' */ + /** + * Test the property 'complete' + */ @Test public void completeTest() { // TODO: test complete } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 553377982312..67ee59963636 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -2,44 +2,67 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for OuterComposite */ + +/** + * Model tests for OuterComposite + */ public class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); - /** Model tests for OuterComposite */ + /** + * Model tests for OuterComposite + */ @Test public void testOuterComposite() { // TODO: test OuterComposite } - /** Test the property 'myNumber' */ + /** + * Test the property 'myNumber' + */ @Test public void myNumberTest() { // TODO: test myNumber } - /** Test the property 'myString' */ + /** + * Test the property 'myString' + */ @Test public void myStringTest() { // TODO: test myString } - /** Test the property 'myBoolean' */ + /** + * Test the property 'myBoolean' + */ @Test public void myBooleanTest() { // TODO: test myBoolean } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumTest.java index ff2a09c9cf57..220d40e83cbb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -2,24 +2,33 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for OuterEnum */ + +/** + * Model tests for OuterEnum + */ public class OuterEnumTest { - /** Model tests for OuterEnum */ + /** + * Model tests for OuterEnum + */ @Test public void testOuterEnum() { // TODO: test OuterEnum } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ParentPetTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ParentPetTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ParentPetTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ParentPetTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java deleted file mode 100644 index 1d56dee54d63..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Assert; -import org.junit.Test; - -/** Model tests for Pet */ -public class PetTest { - private final Pet model = new Pet(); - - /** Model tests for Pet */ - @Test - public void testPet() { - // test Pet - model.setId(1029L); - model.setName("Dog"); - - Pet model2 = new Pet(); - model2.setId(1029L); - model2.setName("Dog"); - - Assert.assertTrue(model.equals(model2)); - } - - /** Test the property 'id' */ - @Test - public void idTest() { - // TODO: test id - } - - /** Test the property 'category' */ - @Test - public void categoryTest() { - // TODO: test category - } - - /** Test the property 'name' */ - @Test - public void nameTest() { - // TODO: test name - } - - /** Test the property 'photoUrls' */ - @Test - public void photoUrlsTest() { - // TODO: test photoUrls - } - - /** Test the property 'tags' */ - @Test - public void tagsTest() { - // TODO: test tags - } - - /** Test the property 'status' */ - @Test - public void statusTest() { - // TODO: test status - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PigTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PigTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PigTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PigTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PineappleTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PineappleTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/QuadrilateralTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/QuadrilateralTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 06598cf3c011..2dc9cb2ae2cd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -2,38 +2,58 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for ReadOnlyFirst */ + +/** + * Model tests for ReadOnlyFirst + */ public class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); - /** Model tests for ReadOnlyFirst */ + /** + * Model tests for ReadOnlyFirst + */ @Test public void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } - /** Test the property 'bar' */ + /** + * Test the property 'bar' + */ @Test public void barTest() { // TODO: test bar } - /** Test the property 'baz' */ + /** + * Test the property 'baz' + */ @Test public void bazTest() { // TODO: test baz } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ShapeTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ShapeTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index cf92b840b643..0c723c8cd0cc 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -2,32 +2,58 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for SpecialModelName */ + +/** + * Model tests for SpecialModelName + */ public class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); - /** Model tests for SpecialModelName */ + /** + * Model tests for SpecialModelName + */ @Test public void testSpecialModelName() { // TODO: test SpecialModelName } - /** Test the property '$specialPropertyName' */ + /** + * Test the property '$specialPropertyName' + */ @Test public void $specialPropertyNameTest() { // TODO: test $specialPropertyName } + + /** + * Test the property 'specialModelName' + */ + @Test + public void specialModelNameTest() { + // TODO: test specialModelName + } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TagTest.java index 09ab515d40fb..83f536d2fa39 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TagTest.java @@ -2,38 +2,58 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for Tag */ + +/** + * Model tests for Tag + */ public class TagTest { private final Tag model = new Tag(); - /** Model tests for Tag */ + /** + * Model tests for Tag + */ @Test public void testTag() { // TODO: test Tag } - /** Test the property 'id' */ + /** + * Test the property 'id' + */ @Test public void idTest() { // TODO: test id } - /** Test the property 'name' */ + /** + * Test the property 'name' + */ @Test public void nameTest() { // TODO: test name } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TriangleTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TriangleTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java deleted file mode 100644 index 499a89a047f1..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { - private final TypeHolderDefault model = new TypeHolderDefault(); - - /** Model tests for TypeHolderDefault */ - @Test - public void testTypeHolderDefault() { - // TODO: test TypeHolderDefault - } - - /** Test the property 'stringItem' */ - @Test - public void stringItemTest() { - // TODO: test stringItem - } - - /** Test the property 'numberItem' */ - @Test - public void numberItemTest() { - // TODO: test numberItem - } - - /** Test the property 'integerItem' */ - @Test - public void integerItemTest() { - // TODO: test integerItem - } - - /** Test the property 'boolItem' */ - @Test - public void boolItemTest() { - // TODO: test boolItem - } - - /** Test the property 'arrayItem' */ - @Test - public void arrayItemTest() { - // TODO: test arrayItem - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java deleted file mode 100644 index cc6e01888bf1..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { - private final TypeHolderExample model = new TypeHolderExample(); - - /** Model tests for TypeHolderExample */ - @Test - public void testTypeHolderExample() { - // TODO: test TypeHolderExample - } - - /** Test the property 'stringItem' */ - @Test - public void stringItemTest() { - // TODO: test stringItem - } - - /** Test the property 'numberItem' */ - @Test - public void numberItemTest() { - // TODO: test numberItem - } - - /** Test the property 'integerItem' */ - @Test - public void integerItemTest() { - // TODO: test integerItem - } - - /** Test the property 'boolItem' */ - @Test - public void boolItemTest() { - // TODO: test boolItem - } - - /** Test the property 'arrayItem' */ - @Test - public void arrayItemTest() { - // TODO: test arrayItem - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/UserTest.java index b388f3e0a937..3b673daf5442 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/UserTest.java @@ -2,74 +2,139 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 - * + * The version of the OpenAPI document: 1.0.0 + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -package org.openapitools.client.model; +package org.openapitools.client.model; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -/** Model tests for User */ + +/** + * Model tests for User + */ public class UserTest { private final User model = new User(); - /** Model tests for User */ + /** + * Model tests for User + */ @Test public void testUser() { // TODO: test User } - /** Test the property 'id' */ + /** + * Test the property 'id' + */ @Test public void idTest() { // TODO: test id } - /** Test the property 'username' */ + /** + * Test the property 'username' + */ @Test public void usernameTest() { // TODO: test username } - /** Test the property 'firstName' */ + /** + * Test the property 'firstName' + */ @Test public void firstNameTest() { // TODO: test firstName } - /** Test the property 'lastName' */ + /** + * Test the property 'lastName' + */ @Test public void lastNameTest() { // TODO: test lastName } - /** Test the property 'email' */ + /** + * Test the property 'email' + */ @Test public void emailTest() { // TODO: test email } - /** Test the property 'password' */ + /** + * Test the property 'password' + */ @Test public void passwordTest() { // TODO: test password } - /** Test the property 'phone' */ + /** + * Test the property 'phone' + */ @Test public void phoneTest() { // TODO: test phone } - /** Test the property 'userStatus' */ + /** + * Test the property 'userStatus' + */ @Test public void userStatusTest() { // TODO: test userStatus } + + /** + * Test the property 'objectWithNoDeclaredProps' + */ + @Test + public void objectWithNoDeclaredPropsTest() { + // TODO: test objectWithNoDeclaredProps + } + + /** + * Test the property 'objectWithNoDeclaredPropsNullable' + */ + @Test + public void objectWithNoDeclaredPropsNullableTest() { + // TODO: test objectWithNoDeclaredPropsNullable + } + + /** + * Test the property 'anyTypeProp' + */ + @Test + public void anyTypePropTest() { + // TODO: test anyTypeProp + } + + /** + * Test the property 'anyTypePropNullable' + */ + @Test + public void anyTypePropNullableTest() { + // TODO: test anyTypePropNullable + } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/WhaleTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/WhaleTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/WhaleTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/WhaleTest.java diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/XmlItemTest.java deleted file mode 100644 index e8ab601c0666..000000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - - -import org.junit.Test; - -/** Model tests for XmlItem */ -public class XmlItemTest { - private final XmlItem model = new XmlItem(); - - /** Model tests for XmlItem */ - @Test - public void testXmlItem() { - // TODO: test XmlItem - } - - /** Test the property 'attributeString' */ - @Test - public void attributeStringTest() { - // TODO: test attributeString - } - - /** Test the property 'attributeNumber' */ - @Test - public void attributeNumberTest() { - // TODO: test attributeNumber - } - - /** Test the property 'attributeInteger' */ - @Test - public void attributeIntegerTest() { - // TODO: test attributeInteger - } - - /** Test the property 'attributeBoolean' */ - @Test - public void attributeBooleanTest() { - // TODO: test attributeBoolean - } - - /** Test the property 'wrappedArray' */ - @Test - public void wrappedArrayTest() { - // TODO: test wrappedArray - } - - /** Test the property 'nameString' */ - @Test - public void nameStringTest() { - // TODO: test nameString - } - - /** Test the property 'nameNumber' */ - @Test - public void nameNumberTest() { - // TODO: test nameNumber - } - - /** Test the property 'nameInteger' */ - @Test - public void nameIntegerTest() { - // TODO: test nameInteger - } - - /** Test the property 'nameBoolean' */ - @Test - public void nameBooleanTest() { - // TODO: test nameBoolean - } - - /** Test the property 'nameArray' */ - @Test - public void nameArrayTest() { - // TODO: test nameArray - } - - /** Test the property 'nameWrappedArray' */ - @Test - public void nameWrappedArrayTest() { - // TODO: test nameWrappedArray - } - - /** Test the property 'prefixString' */ - @Test - public void prefixStringTest() { - // TODO: test prefixString - } - - /** Test the property 'prefixNumber' */ - @Test - public void prefixNumberTest() { - // TODO: test prefixNumber - } - - /** Test the property 'prefixInteger' */ - @Test - public void prefixIntegerTest() { - // TODO: test prefixInteger - } - - /** Test the property 'prefixBoolean' */ - @Test - public void prefixBooleanTest() { - // TODO: test prefixBoolean - } - - /** Test the property 'prefixArray' */ - @Test - public void prefixArrayTest() { - // TODO: test prefixArray - } - - /** Test the property 'prefixWrappedArray' */ - @Test - public void prefixWrappedArrayTest() { - // TODO: test prefixWrappedArray - } - - /** Test the property 'namespaceString' */ - @Test - public void namespaceStringTest() { - // TODO: test namespaceString - } - - /** Test the property 'namespaceNumber' */ - @Test - public void namespaceNumberTest() { - // TODO: test namespaceNumber - } - - /** Test the property 'namespaceInteger' */ - @Test - public void namespaceIntegerTest() { - // TODO: test namespaceInteger - } - - /** Test the property 'namespaceBoolean' */ - @Test - public void namespaceBooleanTest() { - // TODO: test namespaceBoolean - } - - /** Test the property 'namespaceArray' */ - @Test - public void namespaceArrayTest() { - // TODO: test namespaceArray - } - - /** Test the property 'namespaceWrappedArray' */ - @Test - public void namespaceWrappedArrayTest() { - // TODO: test namespaceWrappedArray - } - - /** Test the property 'prefixNsString' */ - @Test - public void prefixNsStringTest() { - // TODO: test prefixNsString - } - - /** Test the property 'prefixNsNumber' */ - @Test - public void prefixNsNumberTest() { - // TODO: test prefixNsNumber - } - - /** Test the property 'prefixNsInteger' */ - @Test - public void prefixNsIntegerTest() { - // TODO: test prefixNsInteger - } - - /** Test the property 'prefixNsBoolean' */ - @Test - public void prefixNsBooleanTest() { - // TODO: test prefixNsBoolean - } - - /** Test the property 'prefixNsArray' */ - @Test - public void prefixNsArrayTest() { - // TODO: test prefixNsArray - } - - /** Test the property 'prefixNsWrappedArray' */ - @Test - public void prefixNsWrappedArrayTest() { - // TODO: test prefixNsWrappedArray - } -} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ZebraTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ZebraTest.java similarity index 100% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ZebraTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ZebraTest.java From 7c1f6c5d6a5f94aafcb68dd51ec34c56f97a853f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 8 Feb 2022 10:57:58 +0800 Subject: [PATCH 021/111] update build.gradle, build.sbt in java okhttp-gson client (#11543) --- .../resources/Java/libraries/okhttp-gson/build.gradle.mustache | 2 ++ .../resources/Java/libraries/okhttp-gson/build.sbt.mustache | 2 ++ samples/client/others/java/okhttp-gson-streaming/build.gradle | 2 ++ samples/client/others/java/okhttp-gson-streaming/build.sbt | 2 ++ .../petstore/java/okhttp-gson-dynamicOperations/build.gradle | 2 ++ .../petstore/java/okhttp-gson-dynamicOperations/build.sbt | 2 ++ .../petstore/java/okhttp-gson-parcelableModel/build.gradle | 2 ++ .../client/petstore/java/okhttp-gson-parcelableModel/build.sbt | 2 ++ samples/client/petstore/java/okhttp-gson/build.gradle | 2 ++ samples/client/petstore/java/okhttp-gson/build.sbt | 2 ++ 10 files changed, 20 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index c97cb873e97b..2da65987703e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -116,6 +116,8 @@ dependencies { implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' implementation 'com.google.code.gson:gson:2.8.6' implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.0' {{#openApiNullable}} implementation 'org.openapitools:jackson-databind-nullable:0.2.1' {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index 5e0c74c55c05..00dfb34384f1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -14,6 +14,8 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.0", {{#openApiNullable}} "org.openapitools" % "jackson-databind-nullable" % "0.2.2", {{/openApiNullable}} diff --git a/samples/client/others/java/okhttp-gson-streaming/build.gradle b/samples/client/others/java/okhttp-gson-streaming/build.gradle index fe39242f70c2..e379bd4c65dc 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.gradle +++ b/samples/client/others/java/okhttp-gson-streaming/build.gradle @@ -112,6 +112,8 @@ dependencies { implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' implementation 'com.google.code.gson:gson:2.8.6' implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.0' implementation 'org.openapitools:jackson-databind-nullable:0.2.1' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' implementation 'org.threeten:threetenbp:1.4.3' diff --git a/samples/client/others/java/okhttp-gson-streaming/build.sbt b/samples/client/others/java/okhttp-gson-streaming/build.sbt index f37a72fb4b80..bedd1f8bd629 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.sbt +++ b/samples/client/others/java/okhttp-gson-streaming/build.sbt @@ -14,6 +14,8 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.0", "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle index 3344fafe8de8..485b0ace31c3 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle @@ -112,6 +112,8 @@ dependencies { implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' implementation 'com.google.code.gson:gson:2.8.6' implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.0' implementation 'org.openapitools:jackson-databind-nullable:0.2.1' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt index 7de5adcd583f..18c2fc66cfd9 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt @@ -14,6 +14,8 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.0", "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index 2f3893812421..dff8053e1cc0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -112,6 +112,8 @@ dependencies { implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' implementation 'com.google.code.gson:gson:2.8.6' implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.0' implementation 'org.openapitools:jackson-databind-nullable:0.2.1' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index a90f98e2152b..4a60fdd08d35 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -14,6 +14,8 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.0", "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index c88a30679cf9..2c1a962ea632 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -112,6 +112,8 @@ dependencies { implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' implementation 'com.google.code.gson:gson:2.8.6' implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.0' implementation 'org.openapitools:jackson-databind-nullable:0.2.1' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index 95fad49a3303..3c38b6153588 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -14,6 +14,8 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.0", "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", From c9118d6982961e2c4160facddf3f2bd0fe1fd380 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 8 Feb 2022 11:14:11 +0800 Subject: [PATCH 022/111] [C#] test .net6 projects in Github actions (#11544) * test .net 6 in github workflow * trigger workflow * fix run * fix test * trigger build * update samples --- .github/workflows/samples-dotnet.yaml | 31 +++++++++++++++++++++++++++ appveyor.yml | 8 ------- 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/samples-dotnet.yaml diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml new file mode 100644 index 000000000000..f6545044a0bb --- /dev/null +++ b/.github/workflows/samples-dotnet.yaml @@ -0,0 +1,31 @@ +name: Samples C# .Net 6 + +on: + push: + paths: + - 'samples/client/petstore/csharp-netcore/**net6.0**/' + pull_request: + paths: + - 'samples/client/petstore/csharp-netcore/**net6.0**/' +jobs: + build: + name: Build .Net projects + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0 + - samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.x' + - name: Build + working-directory: ${{ matrix.sample }} + run: dotnet build Org.OpenAPITools.sln + - name: Test + working-directory: ${{ matrix.sample }} + run: dotnet test Org.OpenAPITools.sln diff --git a/appveyor.yml b/appveyor.yml index 6d5579f0b45e..85b45d481329 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -50,10 +50,6 @@ build_script: - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-httpclient\Org.OpenAPITools.sln # build C# API client (generichost) - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-netstandard2.0\Org.OpenAPITools.sln - # build C# API client (generichost) - - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0\Org.OpenAPITools.sln - # build C# API client (generichost) - - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0-nrt\Org.OpenAPITools.sln # build C# API client (netcore) - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient\Org.OpenAPITools.sln - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClientCore\Org.OpenAPITools.sln @@ -83,10 +79,6 @@ test_script: - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-httpclient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj # test c# API client (generichost) - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-netstandard2.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - # test c# API client (generichost) - - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - # test c# API client (generichost) - - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0-nrt\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj # test c# API client (netcore) - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj From b6c445cdc35f04306a7c028ba1bf9dab56230737 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 8 Feb 2022 13:31:20 +0800 Subject: [PATCH 023/111] update swagger core, jackson to newer version (#11545) --- pom.xml | 4 +- .../petstore/go/go-petstore/api/openapi.yaml | 32 +++++----- .../petstore/haskell-http-client/openapi.yaml | 32 +++++----- .../java/apache-httpclient/api/openapi.yaml | 32 +++++----- .../java/feign-no-nullable/api/openapi.yaml | 32 +++++----- .../petstore/java/feign/api/openapi.yaml | 36 +++++------ .../java/google-api-client/api/openapi.yaml | 32 +++++----- .../petstore/java/jersey1/api/openapi.yaml | 32 +++++----- .../api/openapi.yaml | 32 +++++----- .../java/jersey2-java8/api/openapi.yaml | 32 +++++----- .../java/native-async/api/openapi.yaml | 32 +++++----- .../petstore/java/native/api/openapi.yaml | 32 +++++----- .../src/main/resources/openapi/openapi.yaml | 32 +++++----- .../api/openapi.yaml | 32 +++++----- .../java/okhttp-gson/api/openapi.yaml | 60 +++++++++---------- .../rest-assured-jackson/api/openapi.yaml | 32 +++++----- .../java/rest-assured/api/openapi.yaml | 32 +++++----- .../petstore/java/resteasy/api/openapi.yaml | 32 +++++----- .../resttemplate-withXml/api/openapi.yaml | 32 +++++----- .../java/resttemplate/api/openapi.yaml | 32 +++++----- .../java/retrofit2-play26/api/openapi.yaml | 32 +++++----- .../petstore/java/retrofit2/api/openapi.yaml | 32 +++++----- .../java/retrofit2rx2/api/openapi.yaml | 32 +++++----- .../java/retrofit2rx3/api/openapi.yaml | 32 +++++----- .../java/vertx-no-nullable/api/openapi.yaml | 32 +++++----- .../petstore/java/vertx/api/openapi.yaml | 32 +++++----- .../petstore/java/webclient/api/openapi.yaml | 36 +++++------ .../go-experimental/api/openapi.yaml | 4 +- .../java/jersey2-java8/api/openapi.yaml | 4 +- .../petstore/go/go-petstore/api/openapi.yaml | 46 +++++++------- .../api/openapi.yaml | 7 ++- .../java/jersey2-java8/api/openapi.yaml | 60 +++++++++---------- .../src/main/resources/openapi.yaml | 12 ++-- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 12 ++-- .../petstore/go-api-server/api/openapi.yaml | 12 ++-- .../petstore/go-chi-server/api/openapi.yaml | 12 ++-- .../go-echo-server/.docs/api/openapi.yaml | 12 ++-- .../go-gin-api-server/api/openapi.yaml | 12 ++-- .../go-server-required/api/openapi.yaml | 20 +++---- .../public/openapi.json | 8 +-- .../src/main/resources/openapi.yaml | 12 ++-- .../src/main/openapi/openapi.yaml | 32 +++++----- .../jaxrs-spec/src/main/openapi/openapi.yaml | 32 +++++----- .../src/openapi_server/openapi/openapi.yaml | 8 +-- .../openapi_server/openapi/openapi.yaml | 8 +-- .../petstore/python-fastapi/openapi.yaml | 12 ++-- .../openapi_server/openapi/openapi.yaml | 8 +-- .../api/openapi.yaml | 28 ++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- .../src/main/resources/openapi.yaml | 32 +++++----- 71 files changed, 985 insertions(+), 984 deletions(-) diff --git a/pom.xml b/pom.xml index 358690a1210b..835258f49124 100644 --- a/pom.xml +++ b/pom.xml @@ -1599,7 +1599,7 @@ 30.1.1-jre 4.2.1 2.10.0 - 2.10.2 + 2.12.1 0.8.7 1.14 4.13.2 @@ -1618,7 +1618,7 @@ 1.7.32 3.1.12.2 3.0.0-M5 - 2.1.2 + 2.1.12 io.swagger.parser.v3 2.0.26 7.3.0 diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 969da54c6c84..3d2b8a39e045 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -126,8 +126,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -826,11 +826,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1088,8 +1088,8 @@ paths: x-codegen-request-body-name: body /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1371,7 +1371,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1449,13 +1449,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1475,11 +1475,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 969da54c6c84..3d2b8a39e045 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -126,8 +126,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -826,11 +826,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1088,8 +1088,8 @@ paths: x-codegen-request-body-name: body /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1371,7 +1371,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1449,13 +1449,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1475,11 +1475,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml b/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml +++ b/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index 69355993fb18..68e67d34c777 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1,8 +1,8 @@ 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -10,7 +10,7 @@ info: version: 1.0.0 servers: - description: petstore server - url: http://{server}.swagger.io:{port}/v2 + url: "http://{server}.swagger.io:{port}/v2" variables: server: default: petstore @@ -24,7 +24,7 @@ servers: - "80" - "8080" - description: The local server - url: https://localhost:8080/{version} + url: "https://localhost:8080/{version}" variables: version: default: v2 @@ -143,8 +143,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -886,11 +886,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1136,8 +1136,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request must reference a schema - named `File`. + description: "For this test, the body for this request must reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1154,7 +1154,7 @@ paths: x-accepts: application/json /fake/body-with-binary: put: - description: For this test, the body has to be a binary file. + description: "For this test, the body has to be a binary file." operationId: testBodyWithBinary requestBody: content: @@ -1669,7 +1669,7 @@ components: format: number type: string string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte @@ -1694,12 +1694,12 @@ components: type: string pattern_with_digits: description: A string that is a 10 digit number. Can have leading zeros. - pattern: ^\d{10}$ + pattern: "^\\d{10}$" type: string pattern_with_digits_and_delimiter: description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - pattern: /^image_\d{1,3}$/i + pattern: "/^image_\\d{1,3}$/i" type: string required: - byte @@ -1988,7 +1988,7 @@ components: format: int64 type: integer xml: - name: $special[model.name] + name: "$special[model.name]" HealthCheckResult: description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. @@ -2169,11 +2169,11 @@ components: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None diff --git a/samples/client/petstore/java/google-api-client/api/openapi.yaml b/samples/client/petstore/java/google-api-client/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/google-api-client/api/openapi.yaml +++ b/samples/client/petstore/java/google-api-client/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/jersey1/api/openapi.yaml b/samples/client/petstore/java/jersey1/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/jersey1/api/openapi.yaml +++ b/samples/client/petstore/java/jersey1/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml b/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/native-async/api/openapi.yaml b/samples/client/petstore/java/native-async/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/native-async/api/openapi.yaml +++ b/samples/client/petstore/java/native-async/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/native/api/openapi.yaml b/samples/client/petstore/java/native/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/native/api/openapi.yaml +++ b/samples/client/petstore/java/native/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index db801488ccb6..eec4c835d323 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -1,8 +1,8 @@ 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -10,7 +10,7 @@ info: version: 1.0.0 servers: - description: petstore server - url: http://{server}.swagger.io:{port}/v2 + url: "http://{server}.swagger.io:{port}/v2" variables: server: default: petstore @@ -24,7 +24,7 @@ servers: - "80" - "8080" - description: The local server - url: https://localhost:8080/{version} + url: "https://localhost:8080/{version}" variables: version: default: v2 @@ -142,8 +142,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -879,11 +879,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1109,8 +1109,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1387,9 +1387,9 @@ components: lastName: lastName password: password userStatus: 6 - objectWithNoDeclaredPropsNullable: '{}' + objectWithNoDeclaredPropsNullable: "{}" phone: phone - objectWithNoDeclaredProps: '{}' + objectWithNoDeclaredProps: "{}" id: 0 anyTypePropNullable: "" email: email @@ -1426,14 +1426,14 @@ components: nullable: true type: object anyTypeProp: - description: test code generation for any type Here the 'type' attribute - is not specified, which means the value can be anything, including the - null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" anyTypePropNullable: - description: test code generation for any type Here the 'type' attribute - is not specified, which means the value can be anything, including the - null value, string, number, boolean, array or object. The 'nullable' attribute - does not change the allowed values. + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." nullable: true type: object xml: @@ -1623,7 +1623,7 @@ components: format: number type: string string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte @@ -1650,12 +1650,12 @@ components: type: string pattern_with_digits: description: A string that is a 10 digit number. Can have leading zeros. - pattern: ^\d{10}$ + pattern: "^\\d{10}$" type: string pattern_with_digits_and_delimiter: description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - pattern: /^image_\d{1,3}$/i + pattern: "/^image_\\d{1,3}$/i" type: string required: - byte @@ -1735,8 +1735,8 @@ components: type: object empty_map: additionalProperties: false - description: an object with no declared properties and no undeclared properties, - hence it's an empty map. + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." type: object map_with_undeclared_properties_string: additionalProperties: @@ -1966,7 +1966,7 @@ components: _special_model.name_: type: string xml: - name: $special[model.name] + name: "$special[model.name]" HealthCheckResult: description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. @@ -2047,10 +2047,10 @@ components: nullable: true properties: cultivar: - pattern: ^[a-zA-Z\s]*$ + pattern: "^[a-zA-Z\\s]*$" type: string origin: - pattern: /^[A-Z\s]*$/i + pattern: "/^[A-Z\\s]*$/i" type: string type: object banana: @@ -2400,11 +2400,11 @@ components: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None diff --git a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/rest-assured/api/openapi.yaml b/samples/client/petstore/java/rest-assured/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/rest-assured/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/resteasy/api/openapi.yaml b/samples/client/petstore/java/resteasy/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/resteasy/api/openapi.yaml +++ b/samples/client/petstore/java/resteasy/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/resttemplate/api/openapi.yaml b/samples/client/petstore/java/resttemplate/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/resttemplate/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/retrofit2/api/openapi.yaml b/samples/client/petstore/java/retrofit2/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/retrofit2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml b/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml +++ b/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/vertx/api/openapi.yaml b/samples/client/petstore/java/vertx/api/openapi.yaml index 1f1a369ece5f..9489c24fc63c 100644 --- a/samples/client/petstore/java/vertx/api/openapi.yaml +++ b/samples/client/petstore/java/vertx/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index 69355993fb18..68e67d34c777 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1,8 +1,8 @@ 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -10,7 +10,7 @@ info: version: 1.0.0 servers: - description: petstore server - url: http://{server}.swagger.io:{port}/v2 + url: "http://{server}.swagger.io:{port}/v2" variables: server: default: petstore @@ -24,7 +24,7 @@ servers: - "80" - "8080" - description: The local server - url: https://localhost:8080/{version} + url: "https://localhost:8080/{version}" variables: version: default: v2 @@ -143,8 +143,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -886,11 +886,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1136,8 +1136,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request must reference a schema - named `File`. + description: "For this test, the body for this request must reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1154,7 +1154,7 @@ paths: x-accepts: application/json /fake/body-with-binary: put: - description: For this test, the body has to be a binary file. + description: "For this test, the body has to be a binary file." operationId: testBodyWithBinary requestBody: content: @@ -1669,7 +1669,7 @@ components: format: number type: string string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte @@ -1694,12 +1694,12 @@ components: type: string pattern_with_digits: description: A string that is a 10 digit number. Can have leading zeros. - pattern: ^\d{10}$ + pattern: "^\\d{10}$" type: string pattern_with_digits_and_delimiter: description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - pattern: /^image_\d{1,3}$/i + pattern: "/^image_\\d{1,3}$/i" type: string required: - byte @@ -1988,7 +1988,7 @@ components: format: int64 type: integer xml: - name: $special[model.name] + name: "$special[model.name]" HealthCheckResult: description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. @@ -2169,11 +2169,11 @@ components: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api/openapi.yaml b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api/openapi.yaml index a23135ce523d..e5fe1db46c7f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api/openapi.yaml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api/openapi.yaml @@ -9,7 +9,7 @@ info: version: 1.0.0 servers: - description: petstore server - url: http://{server}.swagger.io:{port}/v2 + url: "http://{server}.swagger.io:{port}/v2" variables: server: default: petstore @@ -23,7 +23,7 @@ servers: - "80" - "8080" - description: The local server - url: https://localhost:8080/{version} + url: "https://localhost:8080/{version}" variables: version: default: v2 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/api/openapi.yaml index 1ea9d4a67836..9f0481faefde 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/api/openapi.yaml @@ -9,7 +9,7 @@ info: version: 1.0.0 servers: - description: petstore server - url: http://{server}.swagger.io:{port}/v2 + url: "http://{server}.swagger.io:{port}/v2" variables: server: default: petstore @@ -23,7 +23,7 @@ servers: - "80" - "8080" - description: The local server - url: https://localhost:8080/{version} + url: "https://localhost:8080/{version}" variables: version: default: v2 diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index bdf23ed1981f..c9e81a15800f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -1,8 +1,8 @@ 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -10,7 +10,7 @@ info: version: 1.0.0 servers: - description: petstore server - url: http://{server}.swagger.io:{port}/v2 + url: "http://{server}.swagger.io:{port}/v2" variables: server: default: petstore @@ -24,7 +24,7 @@ servers: - "80" - "8080" - description: The local server - url: https://localhost:8080/{version} + url: "https://localhost:8080/{version}" variables: version: default: v2 @@ -148,8 +148,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -854,11 +854,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1064,8 +1064,8 @@ paths: - $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1355,9 +1355,9 @@ components: arbitraryNullableTypeValue: "" phone: phone id: 0 - arbitraryObject: '{}' + arbitraryObject: "{}" email: email - arbitraryNullableObject: '{}' + arbitraryNullableObject: "{}" username: username properties: id: @@ -1390,11 +1390,11 @@ components: nullable: true type: object arbitraryTypeValue: - description: test code generation for any type Value can be any type - string, - number, boolean, array or object. + description: "test code generation for any type Value can be any type -\ + \ string, number, boolean, array or object." arbitraryNullableTypeValue: - description: test code generation for any type Value can be any type - string, - number, boolean, array, object or the 'null' value. + description: "test code generation for any type Value can be any type -\ + \ string, number, boolean, array, object or the 'null' value." nullable: true type: object xml: @@ -1580,7 +1580,7 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte @@ -1605,12 +1605,12 @@ components: type: string pattern_with_digits: description: A string that is a 10 digit number. Can have leading zeros. - pattern: ^\d{10}$ + pattern: "^\\d{10}$" type: string pattern_with_digits_and_delimiter: description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - pattern: /^image_\d{1,3}$/i + pattern: "/^image_\\d{1,3}$/i" type: string required: - byte @@ -1896,7 +1896,7 @@ components: format: int64 type: integer xml: - name: $special[model.name] + name: "$special[model.name]" HealthCheckResult: description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. @@ -2155,11 +2155,11 @@ components: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml index 748bc1b78edf..babf79856dec 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml @@ -39,9 +39,10 @@ components: allOf: - $ref: '#/components/schemas/Parent' - $ref: '#/components/schemas/MySchemaName___Characters_allOf' - description: A schema name that has letters, numbers, punctuation and non-ASCII - characters. The sanitization rules should make it possible to generate a language-specific - classname with allowed characters in that programming language. + description: "A schema name that has letters, numbers, punctuation and non-ASCII\ + \ characters. The sanitization rules should make it possible to generate a\ + \ language-specific classname with allowed characters in that programming\ + \ language." ChildSchema_allOf: properties: prop1: diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml index 46bb08569409..873b76e7c3a9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -1,8 +1,8 @@ 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -10,7 +10,7 @@ info: version: 1.0.0 servers: - description: petstore server - url: http://{server}.swagger.io:{port}/v2 + url: "http://{server}.swagger.io:{port}/v2" variables: server: default: petstore @@ -24,7 +24,7 @@ servers: - "80" - "8080" - description: The local server - url: https://localhost:8080/{version} + url: "https://localhost:8080/{version}" variables: version: default: v2 @@ -142,8 +142,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -879,11 +879,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1109,8 +1109,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1387,9 +1387,9 @@ components: lastName: lastName password: password userStatus: 6 - objectWithNoDeclaredPropsNullable: '{}' + objectWithNoDeclaredPropsNullable: "{}" phone: phone - objectWithNoDeclaredProps: '{}' + objectWithNoDeclaredProps: "{}" id: 0 anyTypePropNullable: "" email: email @@ -1426,14 +1426,14 @@ components: nullable: true type: object anyTypeProp: - description: test code generation for any type Here the 'type' attribute - is not specified, which means the value can be anything, including the - null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" anyTypePropNullable: - description: test code generation for any type Here the 'type' attribute - is not specified, which means the value can be anything, including the - null value, string, number, boolean, array or object. The 'nullable' attribute - does not change the allowed values. + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." nullable: true type: object xml: @@ -1623,7 +1623,7 @@ components: format: number type: string string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte @@ -1650,12 +1650,12 @@ components: type: string pattern_with_digits: description: A string that is a 10 digit number. Can have leading zeros. - pattern: ^\d{10}$ + pattern: "^\\d{10}$" type: string pattern_with_digits_and_delimiter: description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - pattern: /^image_\d{1,3}$/i + pattern: "/^image_\\d{1,3}$/i" type: string required: - byte @@ -1735,8 +1735,8 @@ components: type: object empty_map: additionalProperties: false - description: an object with no declared properties and no undeclared properties, - hence it's an empty map. + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." type: object map_with_undeclared_properties_string: additionalProperties: @@ -1966,7 +1966,7 @@ components: _special_model.name_: type: string xml: - name: $special[model.name] + name: "$special[model.name]" HealthCheckResult: description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. @@ -2047,10 +2047,10 @@ components: nullable: true properties: cultivar: - pattern: ^[a-zA-Z\s]*$ + pattern: "^[a-zA-Z\\s]*$" type: string origin: - pattern: /^[A-Z\s]*$/i + pattern: "/^[A-Z\\s]*$/i" type: string type: object banana: @@ -2365,11 +2365,11 @@ components: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml index 56703dfefb56..5fc39a2ce2a4 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -128,8 +128,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -498,7 +498,7 @@ paths: name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -732,7 +732,7 @@ components: format: int64 type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string title: Pet category type: object diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml index 56703dfefb56..5fc39a2ce2a4 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -128,8 +128,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -498,7 +498,7 @@ paths: name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -732,7 +732,7 @@ components: format: int64 type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string title: Pet category type: object diff --git a/samples/server/petstore/go-api-server/api/openapi.yaml b/samples/server/petstore/go-api-server/api/openapi.yaml index bb1c5be5b94a..a5d58611b42b 100644 --- a/samples/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-api-server/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -117,8 +117,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -445,7 +445,7 @@ paths: name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -663,7 +663,7 @@ components: format: int64 type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string title: Pet category type: object diff --git a/samples/server/petstore/go-chi-server/api/openapi.yaml b/samples/server/petstore/go-chi-server/api/openapi.yaml index bb1c5be5b94a..a5d58611b42b 100644 --- a/samples/server/petstore/go-chi-server/api/openapi.yaml +++ b/samples/server/petstore/go-chi-server/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -117,8 +117,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -445,7 +445,7 @@ paths: name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -663,7 +663,7 @@ components: format: int64 type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string title: Pet category type: object diff --git a/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml b/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml index bb1c5be5b94a..a5d58611b42b 100644 --- a/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml +++ b/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -117,8 +117,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -445,7 +445,7 @@ paths: name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -663,7 +663,7 @@ components: format: int64 type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string title: Pet category type: object diff --git a/samples/server/petstore/go-gin-api-server/api/openapi.yaml b/samples/server/petstore/go-gin-api-server/api/openapi.yaml index bb1c5be5b94a..a5d58611b42b 100644 --- a/samples/server/petstore/go-gin-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-gin-api-server/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -117,8 +117,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -445,7 +445,7 @@ paths: name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -663,7 +663,7 @@ components: format: int64 type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string title: Pet category type: object diff --git a/samples/server/petstore/go-server-required/api/openapi.yaml b/samples/server/petstore/go-server-required/api/openapi.yaml index 632abb4be4b9..c53982d7f05e 100644 --- a/samples/server/petstore/go-server-required/api/openapi.yaml +++ b/samples/server/petstore/go-server-required/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -116,8 +116,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -444,7 +444,7 @@ paths: name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -689,7 +689,7 @@ components: format: int64 type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string title: Pet category type: object @@ -722,10 +722,10 @@ components: id: 1 id: 0 deepSliceMap: - - - '{}' - - '{}' - - - '{}' - - '{}' + - - "{}" + - "{}" + - - "{}" + - "{}" email: email username: username properties: diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index 37e47ba24e10..c419a58de0d0 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -1970,14 +1970,14 @@ "format_test" : { "properties" : { "integer" : { - "maximum" : 1E+2, - "minimum" : 1E+1, + "maximum" : 100, + "minimum" : 10, "type" : "integer" }, "int32" : { "format" : "int32", - "maximum" : 2E+2, - "minimum" : 2E+1, + "maximum" : 200, + "minimum" : 20, "type" : "integer" }, "int64" : { diff --git a/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml b/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml index d4624beff588..e8a30a332bce 100644 --- a/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml +++ b/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -122,8 +122,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -468,7 +468,7 @@ paths: name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -692,7 +692,7 @@ components: format: int64 type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string title: Pet category type: object diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml index 416d4ab0b6d6..c8de6c51df21 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.1 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -124,8 +124,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: find_pets_by_tags parameters: - description: Tags to filter by diff --git a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml index 416d4ab0b6d6..c8de6c51df21 100644 --- a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.1 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -124,8 +124,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: find_pets_by_tags parameters: - description: Tags to filter by diff --git a/samples/server/petstore/python-fastapi/openapi.yaml b/samples/server/petstore/python-fastapi/openapi.yaml index 94256ed0a0f2..398cbffcb643 100644 --- a/samples/server/petstore/python-fastapi/openapi.yaml +++ b/samples/server/petstore/python-fastapi/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -117,8 +117,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -445,7 +445,7 @@ paths: name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -670,7 +670,7 @@ components: title: id type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" title: name type: string title: Pet category diff --git a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml index f94133dcf463..4c6a1f228c01 100644 --- a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.1 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -122,8 +122,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: find_pets_by_tags parameters: - description: Tags to filter by diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml index 0885080f5fdc..8fd01614a253 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -120,8 +120,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -758,11 +758,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1189,7 +1189,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1263,13 +1263,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1289,11 +1289,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml index 1cd65b8e95d4..cdceff13c4d8 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html @@ -138,8 +138,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -909,11 +909,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1211,8 +1211,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1504,7 +1504,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1578,13 +1578,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1604,11 +1604,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml +++ b/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml index 1cd65b8e95d4..cdceff13c4d8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html @@ -138,8 +138,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -909,11 +909,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1211,8 +1211,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1504,7 +1504,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1578,13 +1578,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1604,11 +1604,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml index 1cd65b8e95d4..cdceff13c4d8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html @@ -138,8 +138,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -909,11 +909,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1211,8 +1211,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1504,7 +1504,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1578,13 +1578,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1604,11 +1604,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml index 1cd65b8e95d4..cdceff13c4d8 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html @@ -138,8 +138,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -909,11 +909,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1211,8 +1211,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1504,7 +1504,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1578,13 +1578,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1604,11 +1604,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml index 1cd65b8e95d4..cdceff13c4d8 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html @@ -138,8 +138,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -909,11 +909,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1211,8 +1211,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1504,7 +1504,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1578,13 +1578,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1604,11 +1604,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary From ff30df92f856f631c760c0bf9b4c22978c70f6f5 Mon Sep 17 00:00:00 2001 From: Boris Smidt Date: Tue, 8 Feb 2022 06:46:42 +0100 Subject: [PATCH 024/111] Upgrade sttp generator to sttp3 (#11260) Remove CIRCE_VERSION from generator because it is taken in as a transitive dependency of ` "com.softwaremill.sttp.client3" %% "json4s" % "3.3.18"` Co-authored-by: boris --- .../languages/ScalaSttpClientCodegen.java | 9 ++++----- .../src/main/resources/scala-sttp/api.mustache | 4 ++-- .../resources/scala-sttp/build.sbt.mustache | 9 +++------ .../resources/scala-sttp/jsonSupport.mustache | 4 ++-- .../project/build.properties.mustache | 2 +- samples/client/petstore/scala-sttp/build.sbt | 4 ++-- .../scala-sttp/project/build.properties | 2 +- .../org/openapitools/client/api/PetApi.scala | 18 +++++++++--------- .../org/openapitools/client/api/StoreApi.scala | 10 +++++----- .../org/openapitools/client/api/UserApi.scala | 18 +++++++++--------- .../openapitools/client/core/JsonSupport.scala | 2 +- 11 files changed, 39 insertions(+), 43 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java index 2a359cb0e69b..a31d41ff4a8c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java @@ -44,17 +44,16 @@ public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements CodegenConfig { private static final StringProperty STTP_CLIENT_VERSION = new StringProperty("sttpClientVersion", "The version of " + - "sttp client", "2.2.9"); + "sttp client", "3.3.18"); private static final BooleanProperty USE_SEPARATE_ERROR_CHANNEL = new BooleanProperty("separateErrorChannel", "Whether to return response as " + "F[Either[ResponseError[ErrorType], ReturnType]]] or to flatten " + "response's error raising them through enclosing monad (F[ReturnType]).", true); private static final StringProperty JODA_TIME_VERSION = new StringProperty("jodaTimeVersion", "The version of " + - "joda-time library", "2.10.10"); + "joda-time library", "2.10.13"); private static final StringProperty JSON4S_VERSION = new StringProperty("json4sVersion", "The version of json4s " + "library", "3.6.11"); - private static final StringProperty CIRCE_VERSION = new StringProperty("circeVersion", "The version of circe " + - "library", "0.13.0"); + private static final JsonLibraryProperty JSON_LIBRARY_PROPERTY = new JsonLibraryProperty(); public static final String DEFAULT_PACKAGE_NAME = "org.openapitools.client"; @@ -62,7 +61,7 @@ public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements Code private static final List> properties = Arrays.asList( STTP_CLIENT_VERSION, USE_SEPARATE_ERROR_CHANNEL, JODA_TIME_VERSION, - JSON4S_VERSION, CIRCE_VERSION, JSON_LIBRARY_PROPERTY, PACKAGE_PROPERTY); + JSON4S_VERSION, JSON_LIBRARY_PROPERTY, PACKAGE_PROPERTY); private final Logger LOGGER = LoggerFactory.getLogger(ScalaSttpClientCodegen.class); diff --git a/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache b/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache index 28cf170922d3..f7d5ba6f8257 100644 --- a/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache @@ -5,7 +5,7 @@ package {{package}} import {{import}} {{/imports}} import {{invokerPackage}}.JsonSupport._ -import sttp.client._ +import sttp.client3._ import sttp.model.Method {{#operations}} @@ -20,7 +20,7 @@ class {{classname}}(baseUrl: String) { {{#javadocRenderer}} {{>javadoc}} {{/javadocRenderer}} - def {{operationId}}({{>methodParameters}}): Request[{{#separateErrorChannel}}Either[ResponseError[Exception], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}, Nothing] = + def {{operationId}}({{>methodParameters}}): Request[{{#separateErrorChannel}}Either[ResponseException[String, Exception], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}, Nothing] = basicRequest .method(Method.{{httpMethod.toUpperCase}}, uri"$baseUrl{{{path}}}{{#queryParams.0}}?{{#queryParams}}{{baseName}}=${ {{{paramName}}} }{{^-last}}&{{/-last}}{{/queryParams}}{{/queryParams.0}}{{#isApiKey}}{{#isKeyInQuery}}{{^queryParams.0}}?{{/queryParams.0}}{{#queryParams.0}}&{{/queryParams.0}}{{keyParamName}}=${apiKey.value}&{{/isKeyInQuery}}{{/isApiKey}}") .contentType({{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}){{#headerParams}} diff --git a/modules/openapi-generator/src/main/resources/scala-sttp/build.sbt.mustache b/modules/openapi-generator/src/main/resources/scala-sttp/build.sbt.mustache index 3072a54368c3..06f8a7845db2 100644 --- a/modules/openapi-generator/src/main/resources/scala-sttp/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/scala-sttp/build.sbt.mustache @@ -6,19 +6,16 @@ scalaVersion := "2.13.5" crossScalaVersions := Seq(scalaVersion.value, "2.12.13") libraryDependencies ++= Seq( - "com.softwaremill.sttp.client" %% "core" % "{{sttpClientVersion}}", + "com.softwaremill.sttp.client3" %% "core" % "{{sttpClientVersion}}", {{#joda}} "joda-time" % "joda-time" % "{{jodaTimeVersion}}", {{/joda}} {{#json4s}} - "com.softwaremill.sttp.client" %% "json4s" % "{{sttpClientVersion}}", + "com.softwaremill.sttp.client3" %% "json4s" % "{{sttpClientVersion}}", "org.json4s" %% "json4s-jackson" % "{{json4sVersion}}" {{/json4s}} {{#circe}} - "com.softwaremill.sttp.client" %% "circe" % "{{sttpClientVersion}}", - "io.circe" %% "circe-core" % "{{circeVersion}}", - "io.circe" %% "circe-generic" % "{{circeVersion}}", - "io.circe" %% "circe-parser" % "{{circeVersion}}" + "com.softwaremill.sttp.client3" %% "circe" % "{{sttpClientVersion}}" {{/circe}} ) diff --git a/modules/openapi-generator/src/main/resources/scala-sttp/jsonSupport.mustache b/modules/openapi-generator/src/main/resources/scala-sttp/jsonSupport.mustache index 57c3ab4204cb..cfa33bd834a3 100644 --- a/modules/openapi-generator/src/main/resources/scala-sttp/jsonSupport.mustache +++ b/modules/openapi-generator/src/main/resources/scala-sttp/jsonSupport.mustache @@ -6,7 +6,7 @@ import {{modelPackage}}._ {{/models.0}} {{#json4s}} import org.json4s._ -import sttp.client.json4s.SttpJson4sApi +import sttp.client3.json4s.SttpJson4sApi import scala.reflect.ClassTag object JsonSupport extends SttpJson4sApi { @@ -42,7 +42,7 @@ object JsonSupport extends SttpJson4sApi { {{#circe}} import io.circe.{Decoder, Encoder} import io.circe.generic.AutoDerivation -import sttp.client.circe.SttpCirceApi +import sttp.client3.circe.SttpCirceApi object JsonSupport extends SttpCirceApi with AutoDerivation with DateSerializers { {{#models}}{{#model}}{{#hasEnums}}{{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/scala-sttp/project/build.properties.mustache b/modules/openapi-generator/src/main/resources/scala-sttp/project/build.properties.mustache index e67343ae796c..3161d2146c63 100644 --- a/modules/openapi-generator/src/main/resources/scala-sttp/project/build.properties.mustache +++ b/modules/openapi-generator/src/main/resources/scala-sttp/project/build.properties.mustache @@ -1 +1 @@ -sbt.version=1.5.0 +sbt.version=1.6.1 diff --git a/samples/client/petstore/scala-sttp/build.sbt b/samples/client/petstore/scala-sttp/build.sbt index 1b13385dba10..e50f4ab48796 100644 --- a/samples/client/petstore/scala-sttp/build.sbt +++ b/samples/client/petstore/scala-sttp/build.sbt @@ -6,8 +6,8 @@ scalaVersion := "2.13.5" crossScalaVersions := Seq(scalaVersion.value, "2.12.13") libraryDependencies ++= Seq( - "com.softwaremill.sttp.client" %% "core" % "2.2.9", - "com.softwaremill.sttp.client" %% "json4s" % "2.2.9", + "com.softwaremill.sttp.client3" %% "core" % "3.3.18", + "com.softwaremill.sttp.client3" %% "json4s" % "3.3.18", "org.json4s" %% "json4s-jackson" % "3.6.11" ) diff --git a/samples/client/petstore/scala-sttp/project/build.properties b/samples/client/petstore/scala-sttp/project/build.properties index e67343ae796c..3161d2146c63 100644 --- a/samples/client/petstore/scala-sttp/project/build.properties +++ b/samples/client/petstore/scala-sttp/project/build.properties @@ -1 +1 @@ -sbt.version=1.5.0 +sbt.version=1.6.1 diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala index 7bed7d54f339..94ea794967cd 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -15,7 +15,7 @@ import org.openapitools.client.model.ApiResponse import java.io.File import org.openapitools.client.model.Pet import org.openapitools.client.core.JsonSupport._ -import sttp.client._ +import sttp.client3._ import sttp.model.Method object PetApi { @@ -33,7 +33,7 @@ class PetApi(baseUrl: String) { * @param pet Pet object that needs to be added to the store */ def addPet(pet: Pet -): Request[Either[ResponseError[Exception], Pet], Nothing] = +): Request[Either[ResponseException[String, Exception], Pet], Nothing] = basicRequest .method(Method.POST, uri"$baseUrl/pet") .contentType("application/json") @@ -48,7 +48,7 @@ class PetApi(baseUrl: String) { * @param apiKey */ def deletePet(petId: Long, apiKey: Option[String] = None -): Request[Either[ResponseError[Exception], Unit], Nothing] = +): Request[Either[ResponseException[String, Exception], Unit], Nothing] = basicRequest .method(Method.DELETE, uri"$baseUrl/pet/${petId}") .contentType("application/json") @@ -65,7 +65,7 @@ class PetApi(baseUrl: String) { * @param status Status values that need to be considered for filter */ def findPetsByStatus(status: Seq[String] -): Request[Either[ResponseError[Exception], Seq[Pet]], Nothing] = +): Request[Either[ResponseException[String, Exception], Seq[Pet]], Nothing] = basicRequest .method(Method.GET, uri"$baseUrl/pet/findByStatus?status=${ status }") .contentType("application/json") @@ -81,7 +81,7 @@ class PetApi(baseUrl: String) { * @param tags Tags to filter by */ def findPetsByTags(tags: Seq[String] -): Request[Either[ResponseError[Exception], Seq[Pet]], Nothing] = +): Request[Either[ResponseException[String, Exception], Seq[Pet]], Nothing] = basicRequest .method(Method.GET, uri"$baseUrl/pet/findByTags?tags=${ tags }") .contentType("application/json") @@ -101,7 +101,7 @@ class PetApi(baseUrl: String) { * @param petId ID of pet to return */ def getPetById(apiKey: String)(petId: Long -): Request[Either[ResponseError[Exception], Pet], Nothing] = +): Request[Either[ResponseException[String, Exception], Pet], Nothing] = basicRequest .method(Method.GET, uri"$baseUrl/pet/${petId}") .contentType("application/json") @@ -118,7 +118,7 @@ class PetApi(baseUrl: String) { * @param pet Pet object that needs to be added to the store */ def updatePet(pet: Pet -): Request[Either[ResponseError[Exception], Pet], Nothing] = +): Request[Either[ResponseException[String, Exception], Pet], Nothing] = basicRequest .method(Method.PUT, uri"$baseUrl/pet") .contentType("application/json") @@ -134,7 +134,7 @@ class PetApi(baseUrl: String) { * @param status Updated status of the pet */ def updatePetWithForm(petId: Long, name: Option[String] = None, status: Option[String] = None -): Request[Either[ResponseError[Exception], Unit], Nothing] = +): Request[Either[ResponseException[String, Exception], Unit], Nothing] = basicRequest .method(Method.POST, uri"$baseUrl/pet/${petId}") .contentType("application/x-www-form-urlencoded") @@ -153,7 +153,7 @@ class PetApi(baseUrl: String) { * @param file file to upload */ def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None -): Request[Either[ResponseError[Exception], ApiResponse], Nothing] = +): Request[Either[ResponseException[String, Exception], ApiResponse], Nothing] = basicRequest .method(Method.POST, uri"$baseUrl/pet/${petId}/uploadImage") .contentType("multipart/form-data") diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala index e6ffcaae6297..b961955e884a 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -13,7 +13,7 @@ package org.openapitools.client.api import org.openapitools.client.model.Order import org.openapitools.client.core.JsonSupport._ -import sttp.client._ +import sttp.client3._ import sttp.model.Method object StoreApi { @@ -33,7 +33,7 @@ class StoreApi(baseUrl: String) { * @param orderId ID of the order that needs to be deleted */ def deleteOrder(orderId: String -): Request[Either[ResponseError[Exception], Unit], Nothing] = +): Request[Either[ResponseException[String, Exception], Unit], Nothing] = basicRequest .method(Method.DELETE, uri"$baseUrl/store/order/${orderId}") .contentType("application/json") @@ -49,7 +49,7 @@ class StoreApi(baseUrl: String) { * api_key (apiKey) */ def getInventory(apiKey: String)( -): Request[Either[ResponseError[Exception], Map[String, Int]], Nothing] = +): Request[Either[ResponseException[String, Exception], Map[String, Int]], Nothing] = basicRequest .method(Method.GET, uri"$baseUrl/store/inventory") .contentType("application/json") @@ -67,7 +67,7 @@ class StoreApi(baseUrl: String) { * @param orderId ID of pet that needs to be fetched */ def getOrderById(orderId: Long -): Request[Either[ResponseError[Exception], Order], Nothing] = +): Request[Either[ResponseException[String, Exception], Order], Nothing] = basicRequest .method(Method.GET, uri"$baseUrl/store/order/${orderId}") .contentType("application/json") @@ -81,7 +81,7 @@ class StoreApi(baseUrl: String) { * @param order order placed for purchasing the pet */ def placeOrder(order: Order -): Request[Either[ResponseError[Exception], Order], Nothing] = +): Request[Either[ResponseException[String, Exception], Order], Nothing] = basicRequest .method(Method.POST, uri"$baseUrl/store/order") .contentType("application/json") diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala index 5cc17ea09c19..0b7b0812e92a 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -14,7 +14,7 @@ package org.openapitools.client.api import java.time.OffsetDateTime import org.openapitools.client.model.User import org.openapitools.client.core.JsonSupport._ -import sttp.client._ +import sttp.client3._ import sttp.model.Method object UserApi { @@ -36,7 +36,7 @@ class UserApi(baseUrl: String) { * @param user Created user object */ def createUser(apiKey: String)(user: User -): Request[Either[ResponseError[Exception], Unit], Nothing] = +): Request[Either[ResponseException[String, Exception], Unit], Nothing] = basicRequest .method(Method.POST, uri"$baseUrl/user") .contentType("application/json") @@ -54,7 +54,7 @@ class UserApi(baseUrl: String) { * @param user List of user object */ def createUsersWithArrayInput(apiKey: String)(user: Seq[User] -): Request[Either[ResponseError[Exception], Unit], Nothing] = +): Request[Either[ResponseException[String, Exception], Unit], Nothing] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithArray") .contentType("application/json") @@ -72,7 +72,7 @@ class UserApi(baseUrl: String) { * @param user List of user object */ def createUsersWithListInput(apiKey: String)(user: Seq[User] -): Request[Either[ResponseError[Exception], Unit], Nothing] = +): Request[Either[ResponseException[String, Exception], Unit], Nothing] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithList") .contentType("application/json") @@ -93,7 +93,7 @@ class UserApi(baseUrl: String) { * @param username The name that needs to be deleted */ def deleteUser(apiKey: String)(username: String -): Request[Either[ResponseError[Exception], Unit], Nothing] = +): Request[Either[ResponseException[String, Exception], Unit], Nothing] = basicRequest .method(Method.DELETE, uri"$baseUrl/user/${username}") .contentType("application/json") @@ -109,7 +109,7 @@ class UserApi(baseUrl: String) { * @param username The name that needs to be fetched. Use user1 for testing. */ def getUserByName(username: String -): Request[Either[ResponseError[Exception], User], Nothing] = +): Request[Either[ResponseException[String, Exception], User], Nothing] = basicRequest .method(Method.GET, uri"$baseUrl/user/${username}") .contentType("application/json") @@ -128,7 +128,7 @@ class UserApi(baseUrl: String) { * @param password The password for login in clear text */ def loginUser(username: String, password: String -): Request[Either[ResponseError[Exception], String], Nothing] = +): Request[Either[ResponseException[String, Exception], String], Nothing] = basicRequest .method(Method.GET, uri"$baseUrl/user/login?username=${ username }&password=${ password }") .contentType("application/json") @@ -142,7 +142,7 @@ class UserApi(baseUrl: String) { * api_key (apiKey) */ def logoutUser(apiKey: String)( -): Request[Either[ResponseError[Exception], Unit], Nothing] = +): Request[Either[ResponseException[String, Exception], Unit], Nothing] = basicRequest .method(Method.GET, uri"$baseUrl/user/logout") .contentType("application/json") @@ -163,7 +163,7 @@ class UserApi(baseUrl: String) { * @param user Updated user object */ def updateUser(apiKey: String)(username: String, user: User -): Request[Either[ResponseError[Exception], Unit], Nothing] = +): Request[Either[ResponseException[String, Exception], Unit], Nothing] = basicRequest .method(Method.PUT, uri"$baseUrl/user/${username}") .contentType("application/json") diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/core/JsonSupport.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/core/JsonSupport.scala index 51896325c2ab..69c83df3f425 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/core/JsonSupport.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/core/JsonSupport.scala @@ -13,7 +13,7 @@ package org.openapitools.client.core import org.openapitools.client.model._ import org.json4s._ -import sttp.client.json4s.SttpJson4sApi +import sttp.client3.json4s.SttpJson4sApi import scala.reflect.ClassTag object JsonSupport extends SttpJson4sApi { From c06d00fe87ea9ec8960fc47621d81a098ce4319d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 8 Feb 2022 13:53:42 +0800 Subject: [PATCH 025/111] update doc --- docs/generators/scala-sttp.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index ad67f76194db..377862d9ca7a 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -20,12 +20,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |null| -|circeVersion|The version of circe library| |0.13.0| |dateLibrary|Option. Date library to use|

    **joda**
    Joda (for legacy app)
    **java8**
    Java 8 native JSR310 (preferred for JDK 1.8+)
    |java8| |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| -|jodaTimeVersion|The version of joda-time library| |2.10.10| +|jodaTimeVersion|The version of joda-time library| |2.10.13| |json4sVersion|The version of json4s library| |3.6.11| |jsonLibrary|Json library to use. Possible values are: json4s and circe.| |json4s| |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| @@ -37,7 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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| |null| -|sttpClientVersion|The version of sttp client| |2.2.9| +|sttpClientVersion|The version of sttp client| |3.3.18| ## IMPORT MAPPING From bf5e701c3d6b23abf1d965cdb419b13c49002b60 Mon Sep 17 00:00:00 2001 From: sullis Date: Tue, 8 Feb 2022 22:27:29 -0800 Subject: [PATCH 026/111] mockito 4.3.1 (#11549) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 835258f49124..1e131706b47a 100644 --- a/pom.xml +++ b/pom.xml @@ -1610,7 +1610,7 @@ 3.0.0 2.5.3 3.7.1 - 4.2.0 + 4.3.1 3.12.0 0.10 1.3 From 441c069177759870b9a8dda78498b136def8a8c9 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Wed, 9 Feb 2022 08:50:16 +0000 Subject: [PATCH 027/111] [Swift5][client] try to fix JsonEncondable (#11541) --- .../main/resources/swift5/Extensions.mustache | 47 ++++++++++++++----- .../src/main/resources/swift5/Models.mustache | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- .../Sources/PetstoreClient/Extensions.swift | 47 ++++++++++++++----- .../Sources/PetstoreClient/Models.swift | 4 -- .../Classes/OpenAPIs/Extensions.swift | 47 ++++++++++++++----- .../Classes/OpenAPIs/Models.swift | 4 -- 32 files changed, 576 insertions(+), 240 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache index 9411b9f94831..b18821ae14b1 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache @@ -11,15 +11,41 @@ import AnyCodable import PromiseKit{{/usePromiseKit}}{{#useVapor}} import Vapor{{/useVapor}}{{^useVapor}} -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -69,8 +95,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/modules/openapi-generator/src/main/resources/swift5/Models.mustache b/modules/openapi-generator/src/main/resources/swift5/Models.mustache index e0cbb9087a31..7890f0113397 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Models.mustache @@ -11,10 +11,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index cace428fb5dd..f950dbd27f6c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -11,10 +11,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift index c2bbbb3af6b7..c7e2df56bc9d 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift index b91c1d232787..171ced2359bf 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 152de64ee6eb..af90bc2ac5dc 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,41 @@ import AnyCodable #endif import PromiseKit -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -68,8 +94,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 0b074d6d0708..f7d0efdcb74e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8a06e2524e51..0b17438a7c87 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,15 +9,41 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable {} -extension Float: JSONEncodable {} -extension Int: JSONEncodable {} -extension Int32: JSONEncodable {} -extension Int64: JSONEncodable {} -extension Double: JSONEncodable {} -extension String: JSONEncodable {} -extension URL: JSONEncodable {} -extension UUID: JSONEncodable {} +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -67,8 +93,7 @@ extension Date: JSONEncodable { extension JSONEncodable where Self: Encodable { func encodeToJSON() -> Any { - let encoder = CodableHelper.jsonEncoder - guard let data = try? encoder.encode(self) else { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { fatalError("Could not encode to json: \(self)") } return data.encodeToJSON() diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift index 0079b465ca7d..21aad0cf649e 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,10 +10,6 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -extension JSONEncodable { - func encodeToJSON() -> Any { self } -} - /// An enum where the last case value can be used as a default catch-all. protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection {} From 8455c1cd23b980eb2449905ef7d2283119e44ff2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 10 Feb 2022 10:35:29 +0800 Subject: [PATCH 028/111] Remove the option to support JDK7 from Java generator and templates (#11547) * remove java8 from java client generator and templates * update tests * remove threetenbp * update spring templates to remove java8 * remove java8 from jaxrs template * fix jaxrs spec * fix feign * remove CustomInstantDeserializer.java * fix jersey1 * fix undertow * various update * fix jaxrs jersey1 * fix java inflector * fix jaxrs cxf * add new files * update doc --- docs/generators/groovy.md | 3 +- docs/generators/java-camel.md | 3 +- docs/generators/java-inflector.md | 3 +- docs/generators/java-micronaut-client.md | 1 - docs/generators/java-micronaut-server.md | 1 - docs/generators/java-msf4j.md | 3 +- docs/generators/java-pkmst.md | 3 +- docs/generators/java-play-framework.md | 3 +- docs/generators/java-undertow-server.md | 3 +- docs/generators/java-vertx-web.md | 3 +- docs/generators/java-vertx.md | 3 +- docs/generators/java.md | 3 +- docs/generators/jaxrs-cxf-cdi.md | 3 +- docs/generators/jaxrs-cxf-client.md | 3 +- docs/generators/jaxrs-cxf-extended.md | 3 +- docs/generators/jaxrs-cxf.md | 3 +- docs/generators/jaxrs-jersey.md | 3 +- docs/generators/jaxrs-resteasy-eap.md | 3 +- docs/generators/jaxrs-resteasy.md | 3 +- docs/generators/jaxrs-spec.md | 3 +- docs/generators/spring.md | 3 +- .../examples/multi-module/java-client/pom.xml | 5 + .../languages/AbstractJavaCodegen.java | 64 +--- .../codegen/languages/JavaClientCodegen.java | 15 +- .../languages/JavaJAXRSSpecServerCodegen.java | 3 +- .../codegen/languages/SpringCodegen.java | 9 - .../main/resources/Java/ApiClient.mustache | 20 -- .../src/main/resources/Java/JSON.mustache | 7 - .../resources/Java/JavaTimeFormatter.mustache | 7 - .../src/main/resources/Java/README.mustache | 2 +- .../src/main/resources/Java/api_test.mustache | 2 + .../Java/auth/HttpBasicAuth.mustache | 18 -- .../main/resources/Java/build.gradle.mustache | 23 -- .../apache-httpclient/ApiClient.mustache | 20 -- .../apache-httpclient/README.mustache | 2 +- .../apache-httpclient/api_test.mustache | 2 + .../apache-httpclient/build.gradle.mustache | 23 -- .../libraries/apache-httpclient/pom.mustache | 37 +-- .../Java/libraries/feign/ApiClient.mustache | 17 -- .../Java/libraries/feign/api_test.mustache | 2 + .../libraries/feign/build.gradle.mustache | 8 - .../Java/libraries/feign/build.sbt.mustache | 2 +- .../Java/libraries/feign/pom.mustache | 12 - .../google-api-client/ApiClient.mustache | 17 -- .../google-api-client/api_test.mustache | 2 + .../google-api-client/build.gradle.mustache | 20 -- .../google-api-client/build.sbt.mustache | 5 - .../libraries/google-api-client/pom.mustache | 29 +- .../Java/libraries/jersey2/ApiClient.mustache | 5 - .../Java/libraries/jersey2/JSON.mustache | 17 -- .../jersey2/auth/HttpBasicAuth.mustache | 18 -- .../libraries/jersey2/build.gradle.mustache | 23 -- .../Java/libraries/jersey2/build.sbt.mustache | 8 - .../Java/libraries/jersey2/pom.mustache | 10 - .../Java/libraries/microprofile/pom.mustache | 10 - .../Java/libraries/native/ApiClient.mustache | 4 - .../Java/libraries/native/JSON.mustache | 17 -- .../libraries/native/build.gradle.mustache | 6 - .../Java/libraries/native/pom.mustache | 10 - .../libraries/okhttp-gson/ApiClient.mustache | 7 - .../Java/libraries/okhttp-gson/JSON.mustache | 7 - .../libraries/okhttp-gson/README.mustache | 2 +- .../okhttp-gson/build.gradle.mustache | 3 - .../libraries/okhttp-gson/build.sbt.mustache | 3 - .../Java/libraries/okhttp-gson/pom.mustache | 10 - .../rest-assured/JacksonObjectMapper.mustache | 19 +- .../libraries/rest-assured/api_test.mustache | 4 +- .../rest-assured/build.gradle.mustache | 14 - .../libraries/rest-assured/build.sbt.mustache | 8 - .../Java/libraries/rest-assured/pom.mustache | 22 -- .../libraries/resteasy/ApiClient.mustache | 5 - .../libraries/resttemplate/ApiClient.mustache | 34 +-- .../libraries/resttemplate/api_test.mustache | 2 + .../resttemplate/build.gradle.mustache | 20 -- .../Java/libraries/resttemplate/pom.mustache | 22 +- .../libraries/retrofit/build.gradle.mustache | 12 - .../libraries/retrofit/build.sbt.mustache | 3 - .../Java/libraries/retrofit/pom.mustache | 23 +- .../libraries/retrofit2/ApiClient.mustache | 5 - .../Java/libraries/retrofit2/JSON.mustache | 7 - .../libraries/retrofit2/api_test.mustache | 2 + .../libraries/retrofit2/build.gradle.mustache | 20 +- .../libraries/retrofit2/build.sbt.mustache | 3 - .../Java/libraries/retrofit2/pom.mustache | 27 +- .../Java/libraries/vertx/ApiClient.mustache | 5 - .../Java/libraries/vertx/api_test.mustache | 2 + .../libraries/vertx/build.gradle.mustache | 8 - .../Java/libraries/vertx/pom.mustache | 16 +- .../libraries/webclient/ApiClient.mustache | 5 - .../libraries/webclient/build.gradle.mustache | 17 -- .../Java/libraries/webclient/pom.mustache | 2 - .../src/main/resources/Java/pom.mustache | 37 +-- .../main/resources/JavaInflector/pom.mustache | 15 + .../resources/JavaJaxRS/cxf-cdi/pom.mustache | 21 +- .../resources/JavaJaxRS/cxf-ext/pom.mustache | 16 +- .../JavaJaxRS/cxf-ext/server/pom.mustache | 13 +- .../main/resources/JavaJaxRS/cxf/pom.mustache | 16 +- .../JavaJaxRS/cxf/server/pom.mustache | 16 +- .../JavaJaxRS/jacksonJsonProvider.mustache | 12 +- .../JavaJaxRS/libraries/jersey1/pom.mustache | 14 +- .../src/main/resources/JavaJaxRS/pom.mustache | 22 +- .../JavaJaxRS/resteasy/JacksonConfig.mustache | 33 --- .../resteasy/eap/JacksonConfig.mustache | 12 +- .../JavaJaxRS/resteasy/eap/gradle.mustache | 6 - .../JavaJaxRS/resteasy/eap/pom.mustache | 24 +- .../resources/JavaJaxRS/resteasy/pom.mustache | 41 +-- .../resources/JavaJaxRS/spec/pom.mustache | 47 +-- .../JavaSpring/beanValidationCore.mustache | 6 +- .../spring-boot/openapi2SpringBoot.mustache | 5 +- .../libraries/spring-boot/pom.mustache | 4 +- .../libraries/spring-cloud/pom.mustache | 4 +- .../libraries/spring-mvc/pom.mustache | 11 +- .../openapiDocumentationConfig.mustache | 2 - .../java-undertow-server/pom.mustache | 21 ++ .../codegen/java/AbstractJavaCodegenTest.java | 12 +- .../codegen/java/JavaClientCodegenTest.java | 12 - .../codegen/java/JavaModelEnumTest.java | 4 +- .../codegen/java/JavaModelTest.java | 19 +- .../JavaJAXRSCXFExtServerCodegenTest.java | 8 - .../jaxrs/JavaJAXRSSpecServerCodegenTest.java | 8 - .../java/spring/SpringCodegenTest.java | 3 +- .../java/okhttp-gson-streaming/README.md | 2 +- .../java/okhttp-gson-streaming/build.gradle | 1 - .../java/okhttp-gson-streaming/build.sbt | 1 - .../others/java/okhttp-gson-streaming/pom.xml | 6 - .../org/openapitools/client/ApiClient.java | 6 +- .../java/org/openapitools/client/JSON.java | 6 +- .../groovy/org/openapitools/model/Pet.groovy | 4 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../main/java/org/openapitools/model/Pet.java | 4 +- .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../java/org/openapitools/model/XmlItem.java | 18 +- .../.openapi-generator/FILES | 1 - .../java/apache-httpclient/build.gradle | 2 - .../petstore/java/apache-httpclient/pom.xml | 12 +- .../org/openapitools/client/ApiClient.java | 9 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../client/JavaTimeFormatter.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../client/auth/HttpBasicAuth.java | 1 - .../openapitools/client/model/FormatTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../.openapi-generator/FILES | 1 - .../java/feign-no-nullable/build.gradle | 3 +- .../petstore/java/feign-no-nullable/build.sbt | 2 +- .../petstore/java/feign-no-nullable/pom.xml | 7 +- .../org/openapitools/client/ApiClient.java | 9 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/TypeHolderDefault.java | 2 +- .../client/model/TypeHolderExample.java | 2 +- .../openapitools/client/model/XmlItem.java | 18 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 2 - ...rtiesAndAdditionalPropertiesClassTest.java | 1 - .../openapitools/client/model/OrderTest.java | 1 - .../java/feign/.openapi-generator/FILES | 1 - .../client/petstore/java/feign/build.gradle | 3 +- samples/client/petstore/java/feign/build.sbt | 2 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../org/openapitools/client/api/FakeApi.java | 4 +- .../openapitools/client/model/FormatTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- samples/client/petstore/java/feign/pom.xml | 7 +- .../org/openapitools/client/ApiClient.java | 9 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../client/model/NullableClass.java | 16 +- .../model/ObjectWithDeprecatedFields.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../openapitools/client/api/FakeApiTest.java | 12 +- .../openapitools/client/api/StoreApiTest.java | 4 +- .../client/model/FormatTestTest.java | 2 - ...rtiesAndAdditionalPropertiesClassTest.java | 1 - .../client/model/NullableClassTest.java | 2 - .../openapitools/client/model/OrderTest.java | 1 - .../.openapi-generator/FILES | 1 - .../petstore/java/google-api-client/README.md | 2 +- .../java/google-api-client/build.gradle | 11 +- .../petstore/java/google-api-client/build.sbt | 2 +- .../petstore/java/google-api-client/pom.xml | 13 +- .../org/openapitools/client/ApiClient.java | 9 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/TypeHolderDefault.java | 2 +- .../client/model/TypeHolderExample.java | 2 +- .../openapitools/client/model/XmlItem.java | 18 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../java/jersey1/.openapi-generator/FILES | 1 - .../client/petstore/java/jersey1/README.md | 2 +- .../client/petstore/java/jersey1/build.gradle | 12 +- samples/client/petstore/java/jersey1/pom.xml | 19 +- .../org/openapitools/client/ApiClient.java | 11 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../client/JavaTimeFormatter.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../client/auth/HttpBasicAuth.java | 11 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/TypeHolderDefault.java | 2 +- .../client/model/TypeHolderExample.java | 2 +- .../openapitools/client/model/XmlItem.java | 18 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 2 - ...rtiesAndAdditionalPropertiesClassTest.java | 1 - .../openapitools/client/model/OrderTest.java | 1 - .../client/auth/HttpBasicAuth.java | 1 - .../client/auth/HttpBasicAuth.java | 1 - .../java/microprofile-rest-client/pom.xml | 3 +- .../org/openapitools/client/model/Pet.java | 2 +- .../okhttp-gson-dynamicOperations/README.md | 2 +- .../build.gradle | 1 - .../okhttp-gson-dynamicOperations/build.sbt | 1 - .../okhttp-gson-dynamicOperations/pom.xml | 6 - .../org/openapitools/client/ApiClient.java | 6 +- .../java/org/openapitools/client/JSON.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/TypeHolderDefault.java | 2 +- .../client/model/TypeHolderExample.java | 2 +- .../openapitools/client/model/XmlItem.java | 18 +- .../org/openapitools/client/JSONTest.java | 4 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../okhttp-gson-parcelableModel/README.md | 2 +- .../okhttp-gson-parcelableModel/build.gradle | 1 - .../okhttp-gson-parcelableModel/build.sbt | 1 - .../java/okhttp-gson-parcelableModel/pom.xml | 6 - .../org/openapitools/client/ApiClient.java | 6 +- .../java/org/openapitools/client/JSON.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/TypeHolderDefault.java | 2 +- .../client/model/TypeHolderExample.java | 2 +- .../openapitools/client/model/XmlItem.java | 18 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../petstore/java/okhttp-gson/README.md | 2 +- .../petstore/java/okhttp-gson/build.gradle | 1 - .../petstore/java/okhttp-gson/build.sbt | 1 - .../client/petstore/java/okhttp-gson/pom.xml | 6 - .../org/openapitools/client/ApiClient.java | 6 +- .../java/org/openapitools/client/JSON.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 8 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/Drawing.java | 2 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../client/model/NullableClass.java | 16 +- .../model/ObjectWithDeprecatedFields.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/PetWithRequiredTags.java | 4 +- .../org/openapitools/client/JSONTest.java | 14 +- .../openapitools/client/api/FakeApiTest.java | 20 +- .../client/model/FormatTestTest.java | 2 - ...rtiesAndAdditionalPropertiesClassTest.java | 1 - .../client/model/NullableClassTest.java | 2 - .../openapitools/client/model/OrderTest.java | 1 - .../client/JacksonObjectMapper.java | 2 +- .../petstore/java/rest-assured/build.gradle | 2 - .../petstore/java/rest-assured/build.sbt | 1 - .../client/petstore/java/rest-assured/pom.xml | 6 - .../java/org/openapitools/client/JSON.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/TypeHolderDefault.java | 2 +- .../client/model/TypeHolderExample.java | 2 +- .../openapitools/client/model/XmlItem.java | 18 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../java/resteasy/.openapi-generator/FILES | 1 - .../org/openapitools/client/ApiClient.java | 2 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../client/JavaTimeFormatter.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../client/auth/HttpBasicAuth.java | 1 - .../openapitools/client/model/FormatTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../.openapi-generator/FILES | 1 - .../java/resttemplate-withXml/build.gradle | 2 - .../java/resttemplate-withXml/pom.xml | 10 +- .../org/openapitools/client/ApiClient.java | 24 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../client/JavaTimeFormatter.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../resttemplate/.openapi-generator/FILES | 1 - .../petstore/java/resttemplate/build.gradle | 2 - .../client/petstore/java/resttemplate/pom.xml | 10 +- .../org/openapitools/client/ApiClient.java | 24 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../client/JavaTimeFormatter.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../java/retrofit2-play26/build.gradle | 2 - .../petstore/java/retrofit2-play26/build.sbt | 1 - .../petstore/java/retrofit2-play26/pom.xml | 8 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../petstore/java/retrofit2/build.gradle | 10 +- .../client/petstore/java/retrofit2/build.sbt | 1 - .../client/petstore/java/retrofit2/pom.xml | 14 +- .../org/openapitools/client/ApiClient.java | 2 +- .../java/org/openapitools/client/JSON.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/TypeHolderDefault.java | 2 +- .../client/model/TypeHolderExample.java | 2 +- .../openapitools/client/model/XmlItem.java | 18 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 2 - ...rtiesAndAdditionalPropertiesClassTest.java | 1 - .../openapitools/client/model/OrderTest.java | 1 - .../client/petstore/java/retrofit2rx/pom.xml | 280 ------------------ .../petstore/java/retrofit2rx2/build.gradle | 10 +- .../petstore/java/retrofit2rx2/build.sbt | 1 - .../client/petstore/java/retrofit2rx2/pom.xml | 14 +- .../org/openapitools/client/ApiClient.java | 2 +- .../java/org/openapitools/client/JSON.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/TypeHolderDefault.java | 2 +- .../client/model/TypeHolderExample.java | 2 +- .../openapitools/client/model/XmlItem.java | 18 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../petstore/java/retrofit2rx3/build.gradle | 10 +- .../petstore/java/retrofit2rx3/build.sbt | 1 - .../client/petstore/java/retrofit2rx3/pom.xml | 14 +- .../org/openapitools/client/ApiClient.java | 2 +- .../java/org/openapitools/client/JSON.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../openapitools/client/model/ArrayTest.java | 6 +- .../openapitools/client/model/EnumArrays.java | 2 +- .../client/model/FileSchemaTestClass.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- .../openapitools/client/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 4 +- .../client/model/TypeHolderDefault.java | 2 +- .../client/model/TypeHolderExample.java | 2 +- .../openapitools/client/model/XmlItem.java | 18 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- .../.openapi-generator/FILES | 1 - .../java/vertx-no-nullable/build.gradle | 2 - .../petstore/java/vertx-no-nullable/pom.xml | 7 +- .../org/openapitools/client/ApiClient.java | 2 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../client/JavaTimeFormatter.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../openapitools/client/api/FakeApiImpl.java | 4 +- .../org/openapitools/client/api/UserApi.java | 2 +- .../openapitools/client/api/UserApiImpl.java | 2 +- .../client/api/rxjava/FakeApi.java | 4 +- .../client/api/rxjava/UserApi.java | 2 +- .../openapitools/client/model/FormatTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../openapitools/client/api/FakeApiTest.java | 4 +- .../client/model/FormatTestTest.java | 4 +- ...rtiesAndAdditionalPropertiesClassTest.java | 2 +- .../openapitools/client/model/OrderTest.java | 2 +- samples/client/petstore/java/vertx/pom.xml | 2 +- .../jersey2-java8/.openapi-generator/FILES | 1 - .../java/jersey2-java8/README.md | 2 +- .../java/jersey2-java8/build.gradle | 12 +- .../java/jersey2-java8/build.sbt | 3 +- .../java/jersey2-java8/pom.xml | 6 - .../org/openapitools/client/ApiClient.java | 2 +- .../client/CustomInstantDeserializer.java | 232 --------------- .../java/org/openapitools/client/JSON.java | 9 +- .../client/JavaTimeFormatter.java | 6 +- .../client/auth/HttpBasicAuth.java | 11 +- .../client/auth/HttpBasicAuth.java | 1 - .../client/auth/HttpBasicAuth.java | 1 - .../.openapi-generator/FILES | 2 - .../pom.xml | 7 +- .../org/openapitools/OpenAPI2SpringBoot.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 4 +- .../openapitools/api/FakeApiController.java | 4 +- .../java/org/openapitools/api/UserApi.java | 2 +- .../openapitools/api/UserApiController.java | 2 +- .../CustomInstantDeserializer.java | 232 --------------- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../org/openapitools/model/FormatTest.java | 4 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../java/org/openapitools/model/Order.java | 2 +- .../main/java/org/openapitools/model/Pet.java | 6 +- .../openapitools/model/TypeHolderDefault.java | 4 +- .../openapitools/model/TypeHolderExample.java | 4 +- .../java/org/openapitools/model/XmlItem.java | 18 +- .../org/openapitools/OpenAPI2SpringBoot.java | 3 +- .../main/java/org/openapitools/model/Pet.java | 4 +- .../java-inflector/.openapi-generator/FILES | 2 + .../java-inflector/.openapi-generator/VERSION | 2 +- .../server/petstore/java-inflector/README.md | 1 - .../petstore/java-inflector/inflector.yaml | 2 + .../server/petstore/java-inflector/pom.xml | 17 +- .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../model/FileSchemaTestClass.java | 29 +- .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 79 +++++ .../org/openapitools/model/ModelList.java | 75 +++++ .../org/openapitools/model/ModelReturn.java | 1 + .../gen/java/org/openapitools/model/Pet.java | 4 +- .../openapitools/model/SpecialModelName.java | 1 + .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../controllers/AnotherFakeController.java | 3 +- .../FakeClassnameTestController.java | 3 +- .../controllers/FakeController.java | 3 +- .../controllers/PetController.java | 3 +- .../controllers/StoreController.java | 3 +- .../controllers/UserController.java | 4 +- .../src/main/openapi/openapi.yaml | 36 ++- .../main/java/org/openapitools/model/Pet.java | 4 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../java/org/openapitools/model/XmlItem.java | 18 +- .../java-undertow/dependency-reduced-pom.xml | 51 ++-- samples/server/petstore/java-undertow/pom.xml | 21 ++ .../main/java/org/openapitools/model/Pet.java | 4 +- .../jaxrs-cxf-annotated-base-path/pom.xml | 9 +- .../gen/java/org/openapitools/model/Pet.java | 2 +- .../jaxrs-cxf-cdi-default-value/pom.xml | 21 +- samples/server/petstore/jaxrs-cxf-cdi/pom.xml | 21 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../petstore/jaxrs-cxf-non-spring-app/pom.xml | 9 +- .../gen/java/org/openapitools/model/Pet.java | 2 +- samples/server/petstore/jaxrs-cxf/pom.xml | 9 +- .../gen/java/org/openapitools/model/Pet.java | 2 +- .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../server/petstore/jaxrs-datelib-j8/pom.xml | 11 + .../openapitools/api/JacksonJsonProvider.java | 2 +- samples/server/petstore/jaxrs-jersey/pom.xml | 15 +- .../openapitools/api/JacksonJsonProvider.java | 6 +- .../model/AdditionalPropertiesClass.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../org/openapitools/model/NullableClass.java | 12 +- .../model/ObjectWithDeprecatedFields.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../jaxrs-resteasy/default-value/pom.xml | 34 +-- .../org/openapitools/api/JacksonConfig.java | 27 +- .../petstore/jaxrs-resteasy/default/pom.xml | 34 +-- .../org/openapitools/api/JacksonConfig.java | 27 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../petstore/jaxrs-resteasy/eap-java8/pom.xml | 8 +- .../org/openapitools/api/JacksonConfig.java | 2 +- .../jaxrs-resteasy/eap-joda/build.gradle | 3 +- .../petstore/jaxrs-resteasy/eap-joda/pom.xml | 19 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../org/openapitools/api/JacksonConfig.java | 6 +- .../petstore/jaxrs-resteasy/eap/build.gradle | 3 +- .../petstore/jaxrs-resteasy/eap/pom.xml | 19 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../org/openapitools/api/JacksonConfig.java | 6 +- .../petstore/jaxrs-resteasy/java8/pom.xml | 23 +- .../petstore/jaxrs-resteasy/joda/pom.xml | 34 +-- .../org/openapitools/api/JacksonConfig.java | 27 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../.openapi-generator/VERSION | 2 +- .../jaxrs-spec-interface-response/pom.xml | 23 +- .../model/AdditionalPropertiesClass.java | 144 ++++++++- .../model/ArrayOfArrayOfNumberOnly.java | 18 +- .../openapitools/model/ArrayOfNumberOnly.java | 18 +- .../org/openapitools/model/ArrayTest.java | 54 +++- .../org/openapitools/model/BigCatAllOf.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../org/openapitools/model/EnumArrays.java | 18 +- .../java/org/openapitools/model/EnumTest.java | 1 + .../model/FileSchemaTestClass.java | 18 +- .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../java/org/openapitools/model/MapTest.java | 72 ++++- ...ropertiesAndAdditionalPropertiesClass.java | 18 +- .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelFile.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../gen/java/org/openapitools/model/Pet.java | 36 ++- .../openapitools/model/SpecialModelName.java | 1 + .../openapitools/model/TypeHolderDefault.java | 18 +- .../openapitools/model/TypeHolderExample.java | 18 +- .../java/org/openapitools/model/XmlItem.java | 162 +++++++++- .../src/main/openapi/openapi.yaml | 32 +- .../petstore/jaxrs-spec-interface/pom.xml | 23 +- .../model/AdditionalPropertiesClass.java | 32 +- .../model/ArrayOfArrayOfNumberOnly.java | 4 +- .../openapitools/model/ArrayOfNumberOnly.java | 4 +- .../org/openapitools/model/ArrayTest.java | 12 +- .../org/openapitools/model/EnumArrays.java | 4 +- .../model/FileSchemaTestClass.java | 4 +- .../java/org/openapitools/model/MapTest.java | 16 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../gen/java/org/openapitools/model/Pet.java | 8 +- .../openapitools/model/TypeHolderDefault.java | 4 +- .../openapitools/model/TypeHolderExample.java | 4 +- .../java/org/openapitools/model/XmlItem.java | 36 +-- samples/server/petstore/jaxrs-spec/pom.xml | 23 +- .../model/AdditionalPropertiesClass.java | 32 +- .../model/ArrayOfArrayOfNumberOnly.java | 4 +- .../openapitools/model/ArrayOfNumberOnly.java | 4 +- .../org/openapitools/model/ArrayTest.java | 12 +- .../org/openapitools/model/EnumArrays.java | 4 +- .../model/FileSchemaTestClass.java | 4 +- .../java/org/openapitools/model/MapTest.java | 16 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../gen/java/org/openapitools/model/Pet.java | 8 +- .../openapitools/model/TypeHolderDefault.java | 4 +- .../openapitools/model/TypeHolderExample.java | 4 +- .../java/org/openapitools/model/XmlItem.java | 36 +-- .../petstore/jaxrs/jersey1-useTags/pom.xml | 14 +- .../openapitools/api/JacksonJsonProvider.java | 6 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../java/org/openapitools/model/XmlItem.java | 18 +- samples/server/petstore/jaxrs/jersey1/pom.xml | 14 +- .../openapitools/api/JacksonJsonProvider.java | 6 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../java/org/openapitools/model/XmlItem.java | 18 +- .../petstore/jaxrs/jersey2-useTags/pom.xml | 15 +- .../openapitools/api/JacksonJsonProvider.java | 6 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../java/org/openapitools/model/XmlItem.java | 18 +- samples/server/petstore/jaxrs/jersey2/pom.xml | 15 +- .../openapitools/api/JacksonJsonProvider.java | 6 +- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 4 +- .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../java/org/openapitools/model/XmlItem.java | 18 +- .../petstore/spring-mvc-j8-async/pom.xml | 7 +- .../spring-mvc-j8-localdatetime/pom.xml | 7 +- .../petstore/spring-mvc-no-nullable/pom.xml | 7 +- .../spring-mvc-spring-pageable/pom.xml | 7 +- samples/server/petstore/spring-mvc/pom.xml | 7 +- .../.openapi-generator/FILES | 2 - .../pom.xml | 7 +- .../org/openapitools/OpenAPI2SpringBoot.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 4 +- .../openapitools/api/FakeApiController.java | 4 +- .../java/org/openapitools/api/UserApi.java | 2 +- .../openapitools/api/UserApiController.java | 2 +- .../CustomInstantDeserializer.java | 232 --------------- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../org/openapitools/model/FormatTest.java | 4 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../java/org/openapitools/model/Order.java | 2 +- .../main/java/org/openapitools/model/Pet.java | 6 +- .../openapitools/model/TypeHolderDefault.java | 4 +- .../openapitools/model/TypeHolderExample.java | 4 +- .../java/org/openapitools/model/XmlItem.java | 18 +- .../.openapi-generator/FILES | 2 - .../pom.xml | 7 +- .../org/openapitools/OpenAPI2SpringBoot.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 4 +- .../openapitools/api/FakeApiController.java | 4 +- .../org/openapitools/api/FakeApiDelegate.java | 4 +- .../java/org/openapitools/api/UserApi.java | 2 +- .../openapitools/api/UserApiController.java | 2 +- .../org/openapitools/api/UserApiDelegate.java | 2 +- .../CustomInstantDeserializer.java | 232 --------------- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../org/openapitools/model/FormatTest.java | 4 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../java/org/openapitools/model/Order.java | 2 +- .../main/java/org/openapitools/model/Pet.java | 4 +- .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../java/org/openapitools/model/XmlItem.java | 18 +- .../.openapi-generator/FILES | 2 - .../pom.xml | 7 +- .../org/openapitools/OpenAPI2SpringBoot.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 4 +- .../openapitools/api/FakeApiController.java | 4 +- .../java/org/openapitools/api/UserApi.java | 2 +- .../openapitools/api/UserApiController.java | 2 +- .../CustomInstantDeserializer.java | 232 --------------- .../model/AdditionalPropertiesClass.java | 16 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../org/openapitools/model/FormatTest.java | 4 +- .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../java/org/openapitools/model/Order.java | 2 +- .../main/java/org/openapitools/model/Pet.java | 4 +- .../openapitools/model/TypeHolderDefault.java | 2 +- .../openapitools/model/TypeHolderExample.java | 2 +- .../java/org/openapitools/model/XmlItem.java | 18 +- 843 files changed, 2788 insertions(+), 6832 deletions(-) delete mode 100644 samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/client/petstore/java/retrofit2rx/pom.xml delete mode 100644 samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/CustomInstantDeserializer.java delete mode 100644 samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelFile.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelList.java delete mode 100644 samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java delete mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java delete mode 100644 samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 4c2b6f644d53..36dc7ffbd0b0 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -26,7 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -41,7 +41,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index c38499430200..9813b1b4dd08 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -40,7 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |camelUseDefaulValidationtErrorProcessor|generate default validation error processor| |true| |camelValidationErrorProcessor|validation error processor bean name| |validationErrorProcessor| |configPackage|configuration package for generated code| |org.openapitools.configuration| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |threetenbp| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |java8| |delegatePattern|Whether to generate the server files using the delegate pattern| |false| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| @@ -60,7 +60,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used. IMPORTANT: This option has been deprecated as Java 8 is the default.
    **false**
    Various third party libraries as needed
    |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|library template (sub-template)|
    **spring-boot**
    Spring-boot Server application using the SpringFox integration.
    **spring-mvc**
    Spring-MVC Server application using the SpringFox integration.
    **spring-cloud**
    Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
    |spring-boot| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index e924a759037f..688726472414 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -43,7 +43,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.controllers| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 0de7278de019..4673d0ece18f 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -44,7 +44,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index 93b25d43d68b..de82e7dd3cc3 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -45,7 +45,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 79aa36220fd0..99b40dd1fecb 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -44,7 +44,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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|library template (sub-template)|
    **jersey1**
    Jersey core 1.x
    **jersey2**
    Jersey core 2.x
    |jersey2| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index f6b391ea4315..3696276e582d 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -29,7 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |basePackage|base package for java source code| |null| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |threetenbp| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -45,7 +45,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |com.prokarma.pkmst.controller| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 002dc7eae11f..a422fe172288 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -31,7 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |booleanGetterPrefix|Set booleanGetterPrefix| |get| |configPackage|configuration package for generated code| |org.openapitools.configuration| |controllerOnly|Whether to generate only API interface stubs without the server files.| |false| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |threetenbp| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -47,7 +47,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 6aa1f1fe2a1d..faed7e30e21b 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -43,7 +43,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.handler| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 4089bedda4aa..41353d46c66a 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |java8| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -43,7 +43,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.vertxweb.server| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 27ba174790d6..095100d66ea7 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |java8| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -43,7 +43,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java.md b/docs/generators/java.md index 811277beed73..8e4aabdef1f3 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -31,7 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |booleanGetterPrefix|Set booleanGetterPrefix| |get| |caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false| |configKey|Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.| |null| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |threetenbp| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -49,7 +49,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.client| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 1.x. JSON processing: JSON-B
    **apache-httpclient**
    HTTP client: Apache httpclient 4.x
    |okhttp-gson| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 9ac40926c75f..7f3d9c0b3633 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -47,7 +47,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implFolder|folder for generated implementation code| |src/main/java| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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|library template (sub-template)|
    **<default>**
    JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
    **quarkus**
    Server using Quarkus
    **thorntail**
    Server using Thorntail
    **openliberty**
    Server using Open Liberty
    **helidon**
    Server using Helidon
    **kumuluzee**
    Server using KumuluzEE
    |<default>| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index cd9d4fee230c..287517ca3e44 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -43,7 +43,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 7518926c80c8..021ae03417d9 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -29,7 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -50,7 +50,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index ca2506a6033c..31a69554770b 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -29,7 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -49,7 +49,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 390aeca70a01..31d340f076c8 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -44,7 +44,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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|library template (sub-template)|
    **jersey1**
    Jersey core 1.x
    **jersey2**
    Jersey core 2.x
    |jersey2| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 9a63b82d1ce5..698ffd9b4096 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -45,7 +45,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index fea68a9800ce..13852ca4caf2 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -45,7 +45,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 61aa2962a0c7..f89dfc45c8c4 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |legacy| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| @@ -47,7 +47,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implFolder|folder for generated implementation code| |src/main/java| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |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|library template (sub-template)|
    **<default>**
    JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
    **quarkus**
    Server using Quarkus
    **thorntail**
    Server using Thorntail
    **openliberty**
    Server using Open Liberty
    **helidon**
    Server using Helidon
    **kumuluzee**
    Server using KumuluzEE
    |<default>| |licenseName|The name of the license| |Unlicense| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 849bd84b8f1f..8f244c07e9c1 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -33,7 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| |configPackage|configuration package for generated code| |org.openapitools.configuration| -|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date (if you really have a good reason not to use threetenbp
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
    **threetenbp**
    Backport of JSR310 (preferred for jdk < 1.8)
    |threetenbp| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |java8| |delegatePattern|Whether to generate the server files using the delegate pattern| |false| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| @@ -53,7 +53,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used. IMPORTANT: This option has been deprecated as Java 8 is the default.
    **false**
    Various third party libraries as needed
    |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|library template (sub-template)|
    **spring-boot**
    Spring-boot Server application using the SpringFox integration.
    **spring-mvc**
    Spring-MVC Server application using the SpringFox integration.
    **spring-cloud**
    Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
    |spring-boot| |licenseName|The name of the license| |Unlicense| diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index c39e34343256..359a00d35b5e 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -134,6 +134,11 @@ jackson-jaxrs-json-provider ${jackson-version} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + org.openapitools jackson-databind-nullable diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index ed493454fd34..ef6292a3924a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -58,7 +58,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String FULL_JAVA_UTIL = "fullJavaUtil"; public static final String DEFAULT_LIBRARY = ""; public static final String DATE_LIBRARY = "dateLibrary"; - public static final String JAVA8_MODE = "java8"; public static final String SUPPORT_ASYNC = "supportAsync"; public static final String WITH_XML = "withXml"; public static final String SUPPORT_JAVA6 = "supportJava6"; @@ -74,9 +73,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi"; - protected String dateLibrary = "threetenbp"; + protected String dateLibrary = "java8"; protected boolean supportAsync = false; - protected boolean java8Mode = true; protected boolean withXml = false; protected String invokerPackage = "org.openapitools"; protected String groupId = "org.openapitools"; @@ -235,21 +233,13 @@ public AbstractJavaCodegen() { CliOption dateLibrary = new CliOption(DATE_LIBRARY, "Option. Date library to use").defaultValue(this.getDateLibrary()); Map dateOptions = new HashMap<>(); - dateOptions.put("java8", "Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets \"" + JAVA8_MODE + "\" to true"); - dateOptions.put("threetenbp", "Backport of JSR310 (preferred for jdk < 1.8)"); + dateOptions.put("java8", "Java 8 native JSR310 (preferred for jdk 1.8+)"); dateOptions.put("java8-localdatetime", "Java 8 using LocalDateTime (for legacy app only)"); dateOptions.put("joda", "Joda (for legacy app only)"); - dateOptions.put("legacy", "Legacy java.util.Date (if you really have a good reason not to use threetenbp"); + dateOptions.put("legacy", "Legacy java.util.Date"); dateLibrary.setEnum(dateOptions); cliOptions.add(dateLibrary); - CliOption java8Mode = CliOption.newBoolean(JAVA8_MODE, "Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped", this.java8Mode); - Map java8ModeOptions = new HashMap<>(); - java8ModeOptions.put("true", "Use Java 8 classes such as Base64"); - java8ModeOptions.put("false", "Various third party libraries as needed"); - java8Mode.setEnum(java8ModeOptions); - cliOptions.add(java8Mode); - cliOptions.add(CliOption.newBoolean(DISABLE_HTML_ESCAPING, "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)", disableHtmlEscaping)); cliOptions.add(CliOption.newString(BOOLEAN_GETTER_PREFIX, "Set booleanGetterPrefix").defaultValue(this.getBooleanGetterPrefix())); cliOptions.add(CliOption.newBoolean(IGNORE_ANYOF_IN_ENUM, "Ignore anyOf keyword in enum", ignoreAnyOfInEnum)); @@ -600,10 +590,6 @@ public void processOpts() { // used later in recursive import in postProcessingModels importMapping.put("com.fasterxml.jackson.annotation.JsonProperty", "com.fasterxml.jackson.annotation.JsonCreator"); - if (additionalProperties.containsKey(JAVA8_MODE)) { - setJava8ModeAndAdditionalProperties(Boolean.parseBoolean(additionalProperties.get(JAVA8_MODE).toString())); - } - if (additionalProperties.containsKey(SUPPORT_ASYNC)) { setSupportAsync(Boolean.parseBoolean(additionalProperties.get(SUPPORT_ASYNC).toString())); if (supportAsync) { @@ -615,14 +601,7 @@ public void processOpts() { setDateLibrary(additionalProperties.get("dateLibrary").toString()); } - if ("threetenbp".equals(dateLibrary)) { - additionalProperties.put("threetenbp", "true"); - additionalProperties.put("jsr310", "true"); - typeMapping.put("date", "LocalDate"); - typeMapping.put("DateTime", "OffsetDateTime"); - importMapping.put("LocalDate", "org.threeten.bp.LocalDate"); - importMapping.put("OffsetDateTime", "org.threeten.bp.OffsetDateTime"); - } else if ("joda".equals(dateLibrary)) { + if ("joda".equals(dateLibrary)) { additionalProperties.put("joda", "true"); typeMapping.put("date", "LocalDate"); typeMapping.put("DateTime", "DateTime"); @@ -907,14 +886,9 @@ public String toDefaultValue(Schema schema) { Schema items = getSchemaItems((ArraySchema) schema); - String typeDeclaration = getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, items)); - Object java8obj = additionalProperties.get("java8"); - if (java8obj != null) { - Boolean java8 = Boolean.valueOf(java8obj.toString()); - if (java8 != null && java8) { - typeDeclaration = ""; - } - } + // comment out below for JDK7 + //String typeDeclaration = getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, items)); + String typeDeclaration = ""; return String.format(Locale.ROOT, pattern, typeDeclaration); } else if (ModelUtils.isMapSchema(schema) && !(schema instanceof ComposedSchema)) { @@ -933,14 +907,9 @@ public String toDefaultValue(Schema schema) { return null; } - String typeDeclaration = String.format(Locale.ROOT, "String, %s", getTypeDeclaration(getAdditionalProperties(schema))); - Object java8obj = additionalProperties.get("java8"); - if (java8obj != null) { - Boolean java8 = Boolean.valueOf(java8obj.toString()); - if (java8 != null && java8) { - typeDeclaration = ""; - } - } + // comment out below for JDK7 + //String typeDeclaration = String.format(Locale.ROOT, "String, %s", getTypeDeclaration(getAdditionalProperties(schema))); + String typeDeclaration = ""; return String.format(Locale.ROOT, pattern, typeDeclaration); } else if (ModelUtils.isIntegerSchema(schema)) { @@ -1785,19 +1754,6 @@ public void setDateLibrary(String library) { this.dateLibrary = library; } - public void setJava8Mode(boolean enabled) { - this.java8Mode = enabled; - } - - public void setJava8ModeAndAdditionalProperties(boolean enabled) { - this.java8Mode = enabled; - if (this.java8Mode) { - this.additionalProperties.put("java8", true); - } else { - this.additionalProperties.put("java8", false); - } - } - public void setSupportAsync(boolean enabled) { this.supportAsync = enabled; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index b090cbd62253..b0251259d7f2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -222,9 +222,9 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera @Override public void processOpts() { - if ((WEBCLIENT.equals(getLibrary()) && "threetenbp".equals(dateLibrary)) || NATIVE.equals(getLibrary())) { + if (WEBCLIENT.equals(getLibrary()) || NATIVE.equals(getLibrary())) { dateLibrary = "java8"; - } else if (MICROPROFILE.equals(getLibrary()) && "threetenbp".equals(dateLibrary)) { + } else if (MICROPROFILE.equals(getLibrary())) { dateLibrary = "legacy"; } super.processOpts(); @@ -460,13 +460,11 @@ public void processOpts() { supportsAdditionalPropertiesWithComposedSchema = true; } else if (NATIVE.equals(getLibrary())) { - setJava8ModeAndAdditionalProperties(true); supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java")); supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", modelsFolder, "AbstractOpenApiSchema.java")); forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (RESTEASY.equals(getLibrary())) { - setJava8ModeAndAdditionalProperties(true); supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (JERSEY1.equals(getLibrary())) { @@ -475,12 +473,10 @@ public void processOpts() { forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java")); } else if (WEBCLIENT.equals(getLibrary())) { - setJava8ModeAndAdditionalProperties(true); forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (VERTX.equals(getLibrary())) { typeMapping.put("file", "AsyncFile"); importMapping.put("AsyncFile", "io.vertx.core.file.AsyncFile"); - setJava8ModeAndAdditionalProperties(true); forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); apiTemplateFiles.put("apiImpl.mustache", "Impl.java"); apiTemplateFiles.put("rxApiImpl.mustache", ".java"); @@ -518,7 +514,6 @@ public void processOpts() { supportingFiles.add(new SupportingFile("kumuluzee.beans.xml.mustache", "src/main/resources/META-INF", "beans.xml")); } } else if (APACHE.equals(getLibrary())) { - setJava8ModeAndAdditionalProperties(true); forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else { LOGGER.error("Unknown library option (-l/--library): {}", getLibrary()); @@ -541,7 +536,6 @@ public void processOpts() { supportingFiles.add(new SupportingFile("play26/Play26CallFactory.mustache", invokerFolder, "Play26CallFactory.java")); supportingFiles.add(new SupportingFile("play26/Play26CallAdapterFactory.mustache", invokerFolder, "Play26CallAdapterFactory.java")); - setJava8ModeAndAdditionalProperties(true); supportingFiles.add(new SupportingFile("play-common/auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java")); supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java")); @@ -560,11 +554,6 @@ public void processOpts() { additionalProperties.remove(SERIALIZATION_LIBRARY_GSON); additionalProperties.remove(SERIALIZATION_LIBRARY_JSONB); supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", invokerFolder, "RFC3339DateFormat.java")); - if (!NATIVE.equals(getLibrary())) { - if ("threetenbp".equals(dateLibrary) && !usePlayWS) { - supportingFiles.add(new SupportingFile("CustomInstantDeserializer.mustache", invokerFolder, "CustomInstantDeserializer.java")); - } - } break; case SERIALIZATION_LIBRARY_GSON: additionalProperties.put(SERIALIZATION_LIBRARY_GSON, "true"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java index 23c82cc2edd6..71c1e8becdb8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java @@ -127,7 +127,8 @@ public void processOpts() { if (!supportAsync) { additionalProperties.remove(SUPPORT_ASYNC); } else { - setJava8ModeAndAdditionalProperties(true); + // java8 tag has been deprecated + //setJava8ModeAndAdditionalProperties(true); } } if (QUARKUS_LIBRARY.equals(library) || THORNTAIL_LIBRARY.equals(library) || HELIDON_LIBRARY.equals(library) || OPEN_LIBERTY_LIBRARY.equals(library) || KUMULUZEE_LIBRARY.equals(library)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 412e6c9bbbfe..5cf1b2b6dcf7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -167,7 +167,6 @@ public SpringCodegen() { "Whether to generate the server files using the delegate pattern", delegatePattern)); cliOptions.add(CliOption.newBoolean(SINGLE_CONTENT_TYPES, "Whether to select only one produces/consumes content-type by operation.", singleContentTypes)); - updateJava8CliOptions(); cliOptions.add(CliOption.newBoolean(SKIP_DEFAULT_INTERFACE, "Whether to generate default implementations for java8 interfaces", skipDefaultInterface)); cliOptions.add(CliOption.newBoolean(ASYNC, "use async Callable controllers", async)); @@ -213,14 +212,6 @@ public SpringCodegen() { } - private void updateJava8CliOptions() { - final CliOption option = cliOptions.stream().filter(o -> JAVA_8.equals(o.getOpt())).findFirst() - .orElseThrow(() -> new RuntimeException("Missing java8 option")); - final Map java8ModeOptions = option.getEnum(); - java8ModeOptions.put("true", - "Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used. IMPORTANT: This option has been deprecated as Java 8 is the default."); - } - @Override public CodegenType getTag() { return CodegenType.SERVER; diff --git a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache index 5191e6214f3d..b2972a98009a 100644 --- a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache @@ -1,24 +1,13 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; - -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.sun.jersey.api.client.Client; @@ -125,16 +114,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); diff --git a/modules/openapi-generator/src/main/resources/Java/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/JSON.mustache index 00c553067c3e..1d0a8138787b 100644 --- a/modules/openapi-generator/src/main/resources/Java/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; @@ -36,11 +31,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/modules/openapi-generator/src/main/resources/Java/JavaTimeFormatter.mustache b/modules/openapi-generator/src/main/resources/Java/JavaTimeFormatter.mustache index 07d0eb6ce729..f3fb34e559cc 100644 --- a/modules/openapi-generator/src/main/resources/Java/JavaTimeFormatter.mustache +++ b/modules/openapi-generator/src/main/resources/Java/JavaTimeFormatter.mustache @@ -1,16 +1,9 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{^threetenbp}} import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; -{{/threetenbp}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; -{{/threetenbp}} /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/modules/openapi-generator/src/main/resources/Java/README.mustache b/modules/openapi-generator/src/main/resources/Java/README.mustache index f360a2ac20d7..c08caee14c30 100644 --- a/modules/openapi-generator/src/main/resources/Java/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/README.mustache @@ -20,7 +20,7 @@ Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +1. Java 1.8+ {{#jersey2}} 2. Maven (3.8.3+)/Gradle (7.2+) {{/jersey2}} diff --git a/modules/openapi-generator/src/main/resources/Java/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/api_test.mustache index b3a544d4c658..b9573eb260e8 100644 --- a/modules/openapi-generator/src/main/resources/Java/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/api_test.mustache @@ -9,6 +9,8 @@ import org.junit.Test; import org.junit.Ignore; import org.junit.Assert; +import java.time.LocalDate; +import java.time.OffsetDateTime; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/auth/HttpBasicAuth.mustache index 4d362cbaf54a..b5c72de6e7e9 100644 --- a/modules/openapi-generator/src/main/resources/Java/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/auth/HttpBasicAuth.mustache @@ -4,21 +4,12 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; -{{^java8}} -import com.migcomponents.migbase64.Base64; -{{/java8}} -{{#java8}} import java.util.Base64; import java.nio.charset.StandardCharsets; -{{/java8}} import java.util.Map; import java.util.List; -{{^java8}} -import java.io.UnsupportedEncodingException; -{{/java8}} - {{>generatedAnnotation}} public class HttpBasicAuth implements Authentication { private String username; @@ -46,15 +37,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); -{{^java8}} - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } -{{/java8}} -{{#java8}} headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); -{{/java8}} } } diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index d9718c1e5f85..07ca128385a2 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -132,9 +120,6 @@ ext { jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} jersey_version = "1.19.4" jodatime_version = "2.9.9" junit_version = "4.13.1" @@ -155,15 +140,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache index 371f8ee72686..2162321690ab 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache @@ -1,24 +1,13 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; - -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; @@ -150,16 +139,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/README.mustache index 9082f626baa6..c6ae4fa23617 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/README.mustache @@ -20,7 +20,7 @@ Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +1. Java 1.8+ 2. Maven/Gradle ## Installation diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/api_test.mustache index 8071e035f5c9..ca6173a61c06 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/api_test.mustache @@ -9,6 +9,8 @@ import org.junit.Test; import org.junit.Ignore; import org.junit.Assert; +import java.time.LocalDate; +import java.time.OffsetDateTime; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache index 5ae33f37e676..c1a1ab78997c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -132,9 +120,6 @@ ext { jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} httpclient_version = "4.5.13" jodatime_version = "2.9.9" junit_version = "4.13.1" @@ -155,15 +140,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache index 89c3f5ffaf33..f407870c8e70 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache @@ -159,14 +159,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + 1.8 + 1.8 @@ -175,12 +169,7 @@ 3.1.1 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -296,28 +285,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} - {{^java8}} - - - com.brsanthu - migbase64 - 2.2 - - {{/java8}} {{#useBeanValidation}} @@ -363,9 +335,6 @@ 1.5.21 4.5.13 2.12.1 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} 1.3.5 {{#useBeanValidation}} 2.0.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index 249f4b65abaa..4efab7da26c7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -5,9 +5,6 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import feign.okhttp.OkHttpClient; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -19,12 +16,7 @@ import org.openapitools.jackson.nullable.JsonNullableModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} import feign.Feign; import feign.RequestInterceptor; @@ -159,16 +151,7 @@ public class ApiClient { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache index a7f5bb0b328a..c579a5c9db85 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache @@ -6,6 +6,8 @@ import {{invokerPackage}}.ApiClient; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeEach; +import java.time.LocalDate; +import java.time.OffsetDateTime; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index c9bf7c357c2e..9f92c5223518 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -108,9 +108,6 @@ ext { jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} feign_version = "10.11" feign_form_version = "3.8.0" junit_version = "5.7.0" @@ -134,12 +131,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} implementation "com.brsanthu:migbase64:2.2" implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache index f2912f0dfb92..47952761808b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -19,7 +19,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}" % "2.9.10" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index f57614c584a9..64582f369f0b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -291,20 +291,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} com.github.scribejava scribejava-core @@ -368,9 +359,6 @@ 0.2.2 {{/openApiNullable}} 2.10.3 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} 1.3.5 5.7.0 1.0.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache index aa91362ba135..c1b8e1fdd35b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache @@ -10,15 +10,7 @@ import org.openapitools.jackson.nullable.JsonNullableModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.google.api.client.googleapis.util.Utils; import com.google.api.client.http.AbstractHttpContent; import com.google.api.client.http.HttpRequestFactory; @@ -46,16 +38,7 @@ public class ApiClient { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache index 1dc2f174fbf2..e81a6cf29c52 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache @@ -8,6 +8,8 @@ import org.junit.Test; import org.junit.Ignore; import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index 6341f0271774..81fe649768d8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -120,9 +108,6 @@ ext { jersey_common_version = "2.25.1" jodatime_version = "2.9.9" junit_version = "4.13.1" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} } dependencies { @@ -137,16 +122,11 @@ dependencies { {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" - {{/threetenbp}} {{#withXml}} implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" {{/withXml}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache index 721b638dd9d0..d5a6e1d8159e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache @@ -21,12 +21,7 @@ lazy val root = (project in file(".")). {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", {{/joda}} - {{#java8}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - {{/threetenbp}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.1" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache index 81e0ee465214..dc03a171454b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache @@ -144,14 +144,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + 1.8 + 1.8 @@ -160,12 +154,7 @@ 3.1.1 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -271,13 +260,11 @@ ${jackson-version} {{/withXml}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype @@ -290,13 +277,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} jakarta.annotation jakarta.annotation-api @@ -325,9 +305,6 @@ {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} 1.3.5 1.0.0 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index e9190a25cca6..c0ba37300adc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -51,12 +51,7 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Date; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.net.URLEncoder; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache index 5d9692610ee0..8de585519bf3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache @@ -1,23 +1,15 @@ package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -44,19 +36,10 @@ public class JSON implements ContextResolver { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} mapper.registerModule(new JavaTimeModule()); - {{/java8}} {{#joda}} mapper.registerModule(new JodaModule()); {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpBasicAuth.mustache index 898bb97ee782..13cecfa90a73 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpBasicAuth.mustache @@ -5,22 +5,13 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; import {{invokerPackage}}.ApiException; -{{^java8}} -import com.migcomponents.migbase64.Base64; -{{/java8}} -{{#java8}} import java.util.Base64; import java.nio.charset.StandardCharsets; -{{/java8}} import java.net.URI; import java.util.Map; import java.util.List; -{{^java8}} -import java.io.UnsupportedEncodingException; -{{/java8}} - {{>generatedAnnotation}} public class HttpBasicAuth implements Authentication { private String username; @@ -48,15 +39,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); -{{^java8}} - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } -{{/java8}} -{{#java8}} headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); -{{/java8}} } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index 1dc7b62fa42a..5f8fc01732be 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -33,14 +33,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -119,9 +107,6 @@ ext { jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" - {{#threetenbp}} - threetenbp_version = "2.9.10" - {{/threetenbp}} {{#hasOAuthMethods}} scribejava_apis_version = "8.3.1" {{/hasOAuthMethods}} @@ -147,21 +132,13 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#hasOAuthMethods}} implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" {{/hasHttpSignatureMethods}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index a1375400af01..df1a939f0f2b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -22,12 +22,7 @@ lazy val root = (project in file(".")). {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.0" % "compile", {{/joda}} - {{#java8}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", - {{/threetenbp}} {{#openApiNullable}} "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", {{/openApiNullable}} @@ -37,9 +32,6 @@ lazy val root = (project in file(".")). {{#hasHttpSignatureMethods}} "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} - {{^java8}} - "com.brsanthu" % "migbase64" % "2.2", - {{/java8}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index 243be3921b01..1913a13c2f43 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -336,13 +336,6 @@ jackson-datatype-jsr310 ${jackson-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#hasHttpSignatureMethods}} org.tomitribe @@ -392,9 +385,6 @@ 2.13.0 2.13.0 0.2.2 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} 1.3.5 {{#useBeanValidation}} 2.0.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache index 3d5f941907be..fb0603c6bd00 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache @@ -138,21 +138,11 @@ jakarta.activation-api ${jakarta.activation-version} - -{{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-jaxrs-version} -{{/java8}} -{{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - -{{/java8}} {{#useBeanValidationFeature}} org.hibernate diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index 03fe2a46841d..8b5d8e75cb43 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -17,10 +17,8 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; -{{#java8}} import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Collection; import java.util.Collections; import java.util.List; @@ -61,11 +59,9 @@ public class ApiClient { if (value == null) { return ""; } - {{#java8}} if (value instanceof OffsetDateTime) { return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); } - {{/java8}} return value.toString(); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache index 961f23b48701..8cd616c15c14 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache @@ -1,22 +1,14 @@ package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -41,19 +33,10 @@ public class JSON { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} mapper.registerModule(new JavaTimeModule()); - {{/java8}} {{#joda}} mapper.registerModule(new JodaModule()); {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache index 03d303d0dfbf..c93e7f4ebdfa 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache @@ -66,9 +66,6 @@ ext { jackson_version = "2.10.4" jakarta_annotation_version = "1.3.5" junit_version = "4.13.1" - {{#threetenbp}} - threetenbp_version = "2.9.10" - {{/threetenbp}} } dependencies { @@ -80,8 +77,5 @@ dependencies { implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - {{/threetenbp}} testImplementation "junit:junit:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index c0c151cda0ec..97013bcb5e9b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -193,13 +193,6 @@ jackson-databind-nullable ${jackson-databind-nullable-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - - {{/threetenbp}} @@ -231,9 +224,6 @@ 2.10.4 0.2.2 1.3.5 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 82eef936df65..e2bbb004f93e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -23,11 +23,6 @@ import org.joda.time.DateTime; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormatter; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#hasOAuthMethods}} import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; import org.apache.oltu.oauth2.common.message.types.GrantType; @@ -52,11 +47,9 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache index 32bef199e1cb..7731f02b65de 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} import okio.ByteString; @@ -33,11 +28,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache index a1a142bd488c..b4b5d2cdda60 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache @@ -18,7 +18,7 @@ ## Requirements Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +1. Java 1.8+ 2. Maven (3.8.3+)/Gradle (7.2+) ## Installation diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index 2da65987703e..04bce4f9b353 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -128,9 +128,6 @@ dependencies { {{#joda}} implementation 'joda-time:joda-time:2.9.9' {{/joda}} - {{#threetenbp}} - implementation 'org.threeten:threetenbp:1.4.3' - {{/threetenbp}} {{#dynamicOperations}} implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' {{/dynamicOperations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index 00dfb34384f1..0714e5570ea3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -25,9 +25,6 @@ lazy val root = (project in file(".")). {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - {{/threetenbp}} {{#dynamicOperations}} "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" {{/dynamicOperations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 10dfc15ab7fe..78e16d4b0640 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -306,13 +306,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#dynamicOperations}} io.swagger.parser.v3 @@ -403,9 +396,6 @@ {{#joda}} 2.10.9 {{/joda}} - {{#threetenbp}} - 1.5.0 - {{/threetenbp}} 1.3.5 {{#performBeanValidation}} 3.0.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache index 6af705a9d9d1..8919eda30e94 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache @@ -2,23 +2,15 @@ package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} import io.restassured.internal.mapping.Jackson2Mapper; import io.restassured.path.json.mapper.factory.Jackson2ObjectMapperFactory; @@ -41,19 +33,10 @@ public class JacksonObjectMapper extends Jackson2Mapper { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} mapper.registerModule(new JavaTimeModule()); - {{/java8}} {{#joda}} mapper.registerModule(new JodaModule()); {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); @@ -65,4 +48,4 @@ public class JacksonObjectMapper extends Jackson2Mapper { public static JacksonObjectMapper jackson() { return new JacksonObjectMapper(); } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache index 74a1c9f7e8c1..af38dc83365a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache @@ -12,6 +12,8 @@ import org.junit.Before; import org.junit.Test; import org.junit.Ignore; +import java.time.LocalDate; +import java.time.OffsetDateTime; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; @@ -63,4 +65,4 @@ public class {{classname}}Test { {{/responses}} {{/operation}} {{/operations}} -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index e80ea1813d0f..4732c6eea105 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -107,9 +107,6 @@ ext { jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.10.0" - {{/threetenbp}} {{/jackson}} {{#gson}} gson_version = "2.8.6" @@ -118,9 +115,6 @@ ext { {{#joda}} jodatime_version = "2.10.5" {{/joda}} -{{#threetenbp}} - threetenbp_version = "1.4.3" -{{/threetenbp}} okio_version = "1.17.5" } @@ -142,12 +136,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} {{/jackson}} {{#gson}} implementation "io.gsonfire:gson-fire:$gson_fire_version" @@ -156,9 +145,6 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} -{{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" -{{/threetenbp}} implementation "com.squareup.okio:okio:$okio_version" {{#useBeanValidation}} implementation "jakarta.validation:jakarta.validation-api:2.0.2" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache index 6a048b92f884..96ac85cc552e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache @@ -26,12 +26,7 @@ lazy val root = (project in file(".")). {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.3", {{/joda}} - {{#java8}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.10.0", - {{/threetenbp}} {{/jackson}} {{#gson}} "com.google.code.gson" % "gson" % "2.8.6", @@ -40,9 +35,6 @@ lazy val root = (project in file(".")). {{#joda}} "joda-time" % "joda-time" % "2.10.5" % "compile", {{/joda}} -{{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", -{{/threetenbp}} "com.squareup.okio" % "okio" % "1.17.5" % "compile", {{#useBeanValidation}} "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache index c6e924ecb890..5ad6d57c29ca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -255,13 +255,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#gson}} io.gsonfire @@ -300,19 +293,10 @@ jackson-datatype-joda {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} {{/jackson}} com.squareup.okio @@ -353,15 +337,9 @@ {{#joda}} 2.10.5 {{/joda}} - {{#threetenbp}} - 1.4.3 - {{/threetenbp}} {{#jackson}} 2.10.3 0.2.2 - {{#threetenbp}} - 2.10.0 - {{/threetenbp}} {{/jackson}} 1.3.5 {{#useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index 7bdb6e8e2a66..441e5036eac7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -24,12 +24,7 @@ import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import javax.ws.rs.client.Client; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index f868eaa6dbf3..fcc5da22b218 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -35,13 +35,6 @@ import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.DefaultUriBuilderFactory; -{{#threetenbp}} -import org.threeten.bp.*; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; -import com.fasterxml.jackson.databind.ObjectMapper; -{{/threetenbp}} {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} @@ -69,9 +62,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; -{{#jsr310}}{{^threetenbp}} +{{#jsr310}} import java.time.OffsetDateTime; -{{/threetenbp}}{{/jsr310}} +{{/jsr310}} import {{invokerPackage}}.auth.Authentication; {{#hasHttpBasicMethods}} @@ -377,14 +370,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; - {{#threetenbp}} - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter) { - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - mapper.setDateFormat(dateFormat); - } - } - {{/threetenbp}} return this; } @@ -801,21 +786,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { RestTemplate restTemplate = new RestTemplate(messageConverters); {{/withXml}}{{^withXml}}RestTemplate restTemplate = new RestTemplate();{{/withXml}} - {{#threetenbp}} - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter){ - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{#openApiNullable}} - mapper.registerModule(new JsonNullableModule()); - {{/openApiNullable}} - } - } - {{/threetenbp}} // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); return restTemplate; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache index 865572ae8cc1..c4551ca7af4a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache @@ -7,6 +7,8 @@ package {{package}}; import org.junit.Test; import org.junit.Ignore; +import java.time.LocalDate; +import java.time.OffsetDateTime; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index 75b4478ea8eb..c0cffb389e4d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -119,9 +107,6 @@ ext { spring_web_version = "5.2.5.RELEASE" jodatime_version = "2.9.9" junit_version = "4.13.1" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} } dependencies { @@ -136,16 +121,11 @@ dependencies { {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" - {{/threetenbp}} {{#withXml}} implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" {{/withXml}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache index 6bd56372de2e..edb933d80ab2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache @@ -144,14 +144,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + 1.8 + 1.8 @@ -272,13 +266,11 @@ {{/withXml}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype @@ -291,13 +283,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} jakarta.annotation jakarta.annotation-api @@ -324,9 +309,6 @@ {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} 1.0.0 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache index 1266cde37cc3..a389f7adf469 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -110,9 +104,6 @@ ext { jakarta_annotation_version = "1.3.5" junit_version = "4.13.1" jodatime_version = "2.9.3" - {{#threetenbp}} - threetenbp_version = "1.4.0" - {{/threetenbp}} } dependencies { @@ -122,9 +113,6 @@ dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" implementation "joda-time:joda-time:$jodatime_version" - {{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" - {{/threetenbp}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.sbt.mustache index b279317657f7..93cfbc3143a4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.sbt.mustache @@ -14,9 +14,6 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "joda-time" % "joda-time" % "2.9.3" % "compile", - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.0" % "compile", - {{/threetenbp}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.1" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache index 1566db9a17f4..d67cdf801da6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache @@ -144,14 +144,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}} 1.8 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} @@ -160,12 +154,7 @@ 3.1.1 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -248,13 +237,6 @@ joda-time ${jodatime-version} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#parcelableModel}} @@ -284,9 +266,6 @@ 1.9.0 2.7.5 2.9.9 - {{#threetenbp}} - 1.4.0 - {{/threetenbp}} 1.0.1 1.3.5 1.0.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index 55294cc3856e..d94c3b3deeee 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -14,9 +14,6 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuil {{#joda}} import org.joda.time.format.DateTimeFormatter; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} import retrofit2.Converter; import retrofit2.Retrofit; {{#useRxJava2}} @@ -40,9 +37,7 @@ import java.io.IOException; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; -{{#java8}} import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache index 9ba7567bffea..2ff8b1cb739c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; @@ -35,11 +30,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache index 3f60dd13dfb5..8b547d9e970e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache @@ -6,6 +6,8 @@ import {{invokerPackage}}.ApiClient; import org.junit.Before; import org.junit.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index a5c716b18d6a..effc730837b1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -131,9 +119,6 @@ ext { {{#joda}} jodatime_version = "2.9.9" {{/joda}} - {{#threetenbp}} - threetenbp_version = "1.4.0" - {{/threetenbp}} json_fire_version = "1.8.0" } @@ -158,9 +143,6 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" - {{/threetenbp}} {{#usePlayWS}} implementation "com.typesafe.play:play-ahc-ws_2.12:$play_version" implementation "jakarta.validation:jakarta.validation-api:2.0.2" @@ -171,7 +153,7 @@ dependencies { {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}:$jackson_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{/usePlayWS}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index a572f4b93e22..b902557a5d2d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -35,9 +35,6 @@ lazy val root = (project in file(".")). {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.0" % "compile", - {{/threetenbp}} "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.1" % "test", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index 5c000617145f..163c246102c5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -144,14 +144,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}} 1.8 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} @@ -160,12 +154,7 @@ 3.1.1 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -266,13 +255,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#useRxJava2}} io.reactivex.rxjava2 @@ -328,7 +310,7 @@ {{/openApiNullable}} com.fasterxml.jackson.datatype - jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}} + jackson-datatype-jsr310 ${jackson-version} {{#withXml}} @@ -375,7 +357,7 @@ UTF-8 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} 1.8.3 @@ -397,9 +379,6 @@ {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 1.4.0 - {{/threetenbp}} 1.3.5 {{#useBeanValidation}} 2.0.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index b3668e995ade..68253df0bdea 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -34,12 +34,7 @@ import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.text.DateFormat; import java.util.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache index 5eb2ec7276a6..f4fee565f4fa 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache @@ -21,6 +21,8 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index bc33a0774390..0e167e7fcd06 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -38,9 +38,6 @@ ext { jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} } dependencies { @@ -54,12 +51,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:jackson_threeten_version" - {{/threetenbp}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache index 2306edbfe84e..7fba2f30cd74 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -154,12 +154,7 @@ 3.1.1 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -266,20 +261,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 - - {{/threetenbp}} jakarta.annotation jakarta.annotation-api diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index 2fa35f5249a8..aeed99cbc1ea 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -65,12 +65,7 @@ import java.util.TimeZone; import javax.annotation.Nullable; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import {{invokerPackage}}.auth.Authentication; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache index 8481b945bca9..0ebda8673f9e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -154,12 +142,7 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache index b5e01dff5e94..593252074de4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -112,13 +112,11 @@ {{/openApiNullable}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache index 5705ea7df67f..c1b811d01b6b 100644 --- a/modules/openapi-generator/src/main/resources/Java/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache @@ -159,14 +159,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + 1.8 + 1.8 @@ -175,12 +169,7 @@ 3.1.1 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -296,28 +285,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} - {{^java8}} - - - com.brsanthu - migbase64 - 2.2 - - {{/java8}} {{#useBeanValidation}} @@ -363,9 +335,6 @@ 1.6.3 1.19.4 2.12.5 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} 1.3.5 {{#useBeanValidation}} 2.0.2 diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache index 7599d6e08ef3..883a84b2c763 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache @@ -25,6 +25,21 @@ target ${project.artifactId}-${project.version} + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + + + org.apache.maven.plugins maven-enforcer-plugin diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache index 046297f2ad7f..4a5222372aba 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache @@ -19,6 +19,21 @@ src/main/java + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + + + org.codehaus.mojo @@ -101,7 +116,11 @@ provided {{/useBeanValidation}} - + + joda-time + joda-time + 2.10.13 + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache index 2c36ff37ee4e..f5c8d59779d0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache @@ -178,20 +178,11 @@ ${jackson-jaxrs-version} compile -{{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-jaxrs-version} -{{/java8}} -{{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - -{{/java8}} {{#useBeanValidationFeature}} org.hibernate @@ -199,6 +190,11 @@ 5.2.2.Final {{/useBeanValidationFeature}} + + joda-time + joda-time + 2.10.13 + @@ -210,7 +206,7 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} 1.5.22 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache index 338527fe4899..1fcbb290e4f2 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache @@ -218,7 +218,6 @@ {{/generateSpringBootApplication}} compile -{{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 @@ -226,16 +225,6 @@ ${jackson-jaxrs-version} {{/generateSpringBootApplication}} -{{/java8}} -{{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda -{{^generateSpringBootApplication}} - ${jackson-jaxrs-version} -{{/generateSpringBootApplication}} - -{{/java8}} {{#generateSpringApplication}} @@ -332,7 +321,7 @@ - {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{^java8}}1.7{{/java8}}{{#java8}}1.8{{/java8}}{{/supportJava6}} + 1.8 ${java.version} ${java.version} 1.5.18 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache index 9787babbd3a4..7484478faf51 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -172,20 +172,11 @@ ${jackson-jaxrs-version} compile -{{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-jaxrs-version} -{{/java8}} -{{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - -{{/java8}} {{#useBeanValidationFeature}} org.hibernate @@ -199,6 +190,11 @@ ${jakarta-annotation-version} provided + + joda-time + joda-time + 2.10.13 + @@ -210,7 +206,7 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} 1.5.18 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index 752f94497fe0..aec054a25a42 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -187,20 +187,11 @@ ${jackson-jaxrs-version} compile -{{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-jaxrs-version} -{{/java8}} -{{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - -{{/java8}} {{#generateSpringApplication}} @@ -250,6 +241,11 @@ 3.6.1 {{/useSwaggerUI}} + + joda-time + joda-time + 2.10.13 + @@ -261,7 +257,7 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} 1.5.22 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/jacksonJsonProvider.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/jacksonJsonProvider.mustache index 5fa284e809ed..b2f385f6ca66 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/jacksonJsonProvider.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/jacksonJsonProvider.mustache @@ -4,12 +4,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.*; -{{/java8}} -{{^java8}} -import com.fasterxml.jackson.datatype.joda.*; -{{/java8}} import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; @@ -26,14 +21,9 @@ public class JacksonJsonProvider extends JacksonJaxbJsonProvider { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) -{{#java8}} .registerModule(new JavaTimeModule()) -{{/java8}} -{{^java8}} - .registerModule(new JodaModule()) -{{/java8}} .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache index 828013c794ca..aeeac6f0d4e2 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache @@ -143,7 +143,11 @@ jakarta.servlet-api ${servlet-api-version} - + + jakarta.annotation + jakarta.annotation-api + ${annotation-api-version} + junit junit @@ -166,6 +170,11 @@ jackson-jaxrs-json-provider ${jackson-version} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + org.testng testng @@ -206,7 +215,7 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} 1.5.22 @@ -220,5 +229,6 @@ 4.13.1 4.0.4 UTF-8 + 1.3.5 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache index 9d55026baf11..87f620b61e77 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache @@ -150,20 +150,11 @@ jersey-media-multipart ${jersey2-version} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - {{/java8}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider @@ -175,6 +166,17 @@ migbase64 2.2 + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.3 + + + com.sun.xml.bind + jaxb-impl + 2.3.3 + runtime + {{#supportJava6}} @@ -211,7 +213,7 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} 1.5.18 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/JacksonConfig.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/JacksonConfig.mustache index 43af8d129963..ab728041c8ab 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/JacksonConfig.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/JacksonConfig.mustache @@ -1,19 +1,7 @@ package {{invokerPackage}}; import com.fasterxml.jackson.databind.ObjectMapper; -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{^java8}} -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import com.fasterxml.jackson.datatype.joda.JodaModule; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.ISODateTimeFormat; -{{/java8}} import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Provider; @@ -26,28 +14,7 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { objectMapper = new ObjectMapper() -{{#java8}} .registerModule(new JavaTimeModule()) -{{/java8}} -{{^java8}} - .registerModule(new JodaModule() { - { - addSerializer(DateTime.class, new StdSerializer(DateTime.class) { - @Override - public void serialize(DateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { - jgen.writeString(ISODateTimeFormat.dateTimeNoMillis().print(value)); - } - }); - addSerializer(LocalDate.class, new StdSerializer(LocalDate.class) { - @Override - public void serialize(LocalDate value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { - jgen.writeString(ISODateTimeFormat.date().print(value)); - } - }); - - } - }) -{{/java8}} .setDateFormat(new RFC3339DateFormat()); } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache index 3750df40bf87..891007b9dc00 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache @@ -9,12 +9,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{^java8}} -import com.fasterxml.jackson.datatype.joda.JodaModule; -{{/java8}} @Provider @Produces(MediaType.APPLICATION_JSON) @@ -27,12 +22,7 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { this.objectMapper = new ObjectMapper(); -{{#java8}} this.objectMapper.registerModule(new JavaTimeModule()); -{{/java8}} -{{^java8}} - this.objectMapper.registerModule(new JodaModule()); -{{/java8}} // sample to convert any DateTime to readable timestamps //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); @@ -41,4 +31,4 @@ public class JacksonConfig implements ContextResolver { public ObjectMapper getContext(Class objectType) { return objectMapper; } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache index ca943874af91..6211d4576ff3 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache @@ -18,13 +18,7 @@ dependencies { {{#useBeanValidation}} providedCompile 'jakarta.validation:jakarta.validation-api:2.0.2' {{/useBeanValidation}} -{{^java8}} - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.9' - compile 'joda-time:joda-time:2.7' -{{/java8}} -{{#java8}} compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9' -{{/java8}} testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache index 86e1c728807f..67211a593253 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache @@ -23,8 +23,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 + 1.8 @@ -156,26 +156,16 @@ provided {{/useBeanValidation}} -{{^java8}} - - joda-time - joda-time - 2.7 - com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 2.9.9 -{{/java8}} -{{#java8}} - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - 2.9.9 + joda-time + joda-time + 2.10.13 -{{/java8}} - @@ -194,7 +184,7 @@ 4.8.1 4.0.4 {{#useBeanValidation}} - 2.0.2 + 2.0.2 {{/useBeanValidation}} 1.3.5 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache index b1b3bddee0ca..955e61279200 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -22,8 +22,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 + 1.8 @@ -133,26 +133,11 @@ ${jakarta-annotation-version} provided - - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - - joda-time - joda-time - 2.7 - - {{/java8}} io.swagger swagger-jaxrs @@ -185,15 +170,19 @@ {{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + {{/useBeanValidation}} - + + joda-time + joda-time + 2.10.13 + @@ -214,7 +203,7 @@ 4.0.4 1.3.5 {{#useBeanValidation}} - 2.0.2 + 2.0.2 {{/useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache index 3aa05e79fbd8..0f0315ff52a2 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache @@ -35,12 +35,15 @@ - {{#interfaceOnly}} + + {{#interfaceOnly}} org.apache.maven.plugins maven-jar-plugin 2.2 - {{/interfaceOnly}}{{^interfaceOnly}} + + {{/interfaceOnly}} + {{^interfaceOnly}} org.apache.maven.plugins maven-war-plugin @@ -60,7 +63,8 @@ - {{/interfaceOnly}} + + {{/interfaceOnly}} @@ -70,25 +74,26 @@ ${jakarta.ws.rs-version} provided - {{#java8}} - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - {{/java8}} - {{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} - {{/java8}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + + joda-time + joda-time + ${joda-version} + + + javax.annotation + javax.annotation-api + ${javax.annotation-api-version} + {{#useSwaggerAnnotations}} io.swagger @@ -108,7 +113,8 @@ junit ${junit-version} test - {{^interfaceOnly}} + + {{^interfaceOnly}} org.testng testng @@ -128,7 +134,8 @@ org.beanshell - {{/interfaceOnly}} + + {{/interfaceOnly}} {{#useBeanValidation}} @@ -140,15 +147,15 @@ {{/useBeanValidation}} -{{#java8}} 1.8 ${java.version} ${java.version} -{{/java8}} 2.9.9 4.13.1 + 2.10.13 + 1.3.2 {{#useBeanValidation}} - 2.0.2 + 2.0.2 {{/useBeanValidation}} 2.1.6 diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache index b93a1eb8c9f2..4e75048b371d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache @@ -11,10 +11,8 @@ minLength not set, maxLength set }}{{#minItems}}{{^maxItems}}@Size(min = {{minItems}}) {{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set }}{{^minItems}}{{#maxItems}}@Size(max = {{.}}) {{/maxItems}}{{/minItems}}{{! -@Email: useBeanValidation set && isEmail && java8 set -}}{{#useBeanValidation}}{{#isEmail}}{{#java8}}@javax.validation.constraints.Email{{/java8}}{{/isEmail}}{{/useBeanValidation}}{{! -@Email: performBeanValidation set && isEmail && not java8 set -}}{{#performBeanValidation}}{{#isEmail}}{{^java8}}@org.hibernate.validator.constraints.Email{{/java8}}{{/isEmail}}{{/performBeanValidation}}{{! +@Email: useBeanValidation set && isEmail set +}}{{#useBeanValidation}}{{#isEmail}}@javax.validation.constraints.Email{{/isEmail}}{{/useBeanValidation}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}}@Min({{.}}) {{/minimum}}{{#maximum}}@Max({{.}}) {{/maximum}}{{/isInteger}}{{! diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache index a171e3cff16b..5649aaa99dbc 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache @@ -16,9 +16,6 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; {{/springFoxDocumentationProvider}} import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - {{^java8}} -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - {{/java8}} {{/reactive}} {{#reactive}} import org.springframework.web.reactive.config.CorsRegistry; @@ -55,7 +52,7 @@ public class OpenAPI2SpringBoot implements CommandLineRunner { @Bean public Web{{^reactive}}Mvc{{/reactive}}{{#reactive}}Flux{{/reactive}}Configurer webConfigurer() { - return new Web{{^reactive}}Mvc{{/reactive}}{{#reactive}}Flux{{/reactive}}Configurer{{^java8}}Adapter{{/java8}}() { + return new Web{{^reactive}}Mvc{{/reactive}}{{#reactive}}Flux{{/reactive}}Configurer() { /*@Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index c929876ffc44..9fc6b89ca756 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -6,7 +6,7 @@ {{artifactId}} {{artifactVersion}} - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} {{#springFoxDocumentationProvider}} @@ -147,12 +147,10 @@ jackson-dataformat-xml {{/withXml}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index 64a0b7189bae..41a40decfc73 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -6,7 +6,7 @@ {{artifactId}} {{artifactVersion}} - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} {{#springFoxDocumentationProvider}} @@ -119,12 +119,10 @@ jackson-dataformat-xml {{/withXml}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index 3610261ac22a..a1cd9ae20857 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -217,13 +217,6 @@ ${jackson-version} {{/withXml}} - {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype @@ -285,11 +278,11 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} 1.3.5 - 2.3.3 + 2.3.3 9.2.15.v20160210 1.7.21 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache index cd21ad973ca5..f240b38c05e1 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache @@ -46,11 +46,9 @@ public class OpenAPIDocumentationConfig { .select() .apis(RequestHandlerSelectors.basePackage("{{apiPackage}}")) .build() - {{#java8}} .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - {{/java8}} {{#joda}} .directModelSubstitute(org.joda.time.LocalDate.class, java.sql.Date.class) .directModelSubstitute(org.joda.time.DateTime.class, java.util.Date.class) diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache index ead7f7e3c7d3..aa685b08efdb 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache @@ -34,6 +34,7 @@ 4.5.13 4.1.2 1.5.10 + 1.3.5 @@ -108,6 +109,11 @@ swagger-annotations ${version.swagger} + + jakarta.annotation + jakarta.annotation-api + ${version.annotation.api} + com.google.code.findbugs @@ -137,6 +143,21 @@ target ${project.artifactId}-${project.version} + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + + + org.apache.maven.plugins maven-enforcer-plugin diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java index 13160dc8cda0..287a730518b9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java @@ -556,22 +556,22 @@ public void toDefaultValueTest() { ModelUtils.setGenerateAliasAsModel(false); defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new ArrayList>()"); + Assert.assertEquals(defaultValue, "new ArrayList<>()"); ModelUtils.setGenerateAliasAsModel(true); defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new ArrayList()"); + Assert.assertEquals(defaultValue, "new ArrayList<>()"); // Create a map schema with additionalProperties type set to array alias schema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/NestedArray")); ModelUtils.setGenerateAliasAsModel(false); defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new HashMap>()"); + Assert.assertEquals(defaultValue, "new HashMap<>()"); ModelUtils.setGenerateAliasAsModel(true); defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new HashMap()"); + Assert.assertEquals(defaultValue, "new HashMap<>()"); // Test default value for date format DateSchema dateSchema = new DateSchema(); @@ -735,7 +735,7 @@ public void maplikeDefaultValueForModelWithStringToStringMapping() { Assert.assertNull(cm.defaultValue, "Expected no defined default value in spec"); String defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new HashMap()", "Expected string-string map aliased model to default to new HashMap()"); + Assert.assertEquals(defaultValue, "new HashMap<>()", "Expected string-string map aliased model to default to new HashMap()"); } @Test @@ -751,7 +751,7 @@ public void maplikeDefaultValueForModelWithStringToModelMapping() { Assert.assertNull(cm.defaultValue, "Expected no defined default value in spec"); String defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals(defaultValue, "new HashMap()", "Expected string-ref map aliased model to default to new HashMap()"); + Assert.assertEquals(defaultValue, "new HashMap<>()", "Expected string-ref map aliased model to default to new HashMap()"); } @Test diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index bc18eeb917a6..d328a4d6ae13 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -275,7 +275,6 @@ public void updateCodegenPropertyEnumWithCustomNames() { @Test public void testGeneratePing() throws Exception { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); File output = Files.createTempDirectory("test").toFile(); @@ -341,7 +340,6 @@ public void testGeneratePing() throws Exception { @Test public void testGeneratePingSomeObj() throws Exception { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.MODEL_PACKAGE, "zz.yyyy.model.xxxx"); properties.put(CodegenConstants.API_PACKAGE, "zz.yyyy.api.xxxx"); properties.put(CodegenConstants.INVOKER_PACKAGE, "zz.yyyy.invoker.xxxx"); @@ -415,7 +413,6 @@ public void testGeneratePingSomeObj() throws Exception { @Test public void testJdkHttpClient() throws Exception { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); File output = Files.createTempDirectory("test").toFile(); @@ -482,7 +479,6 @@ public void testJdkHttpClientWithAndWithoutDiscriminator() throws Exception { @Test public void testJdkHttpAsyncClient() throws Exception { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); properties.put(JavaClientCodegen.ASYNC_NATIVE, true); @@ -649,7 +645,6 @@ public void testFreeFormObjects() { public void testImportMapping() throws IOException { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); Map importMappings = new HashMap<>(); @@ -905,7 +900,6 @@ public void testAnyType() { public void testRestTemplateFormMultipart() throws IOException { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); @@ -954,7 +948,6 @@ public void testRestTemplateFormMultipart() throws IOException { public void testWebClientFormMultipart() throws IOException { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); @@ -1032,7 +1025,6 @@ public void testAllowModelWithNoProperties() throws Exception { public void testRestTemplateWithUseAbstractionForFiles() throws IOException { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true); @@ -1162,7 +1154,6 @@ public void testCustomMethodParamsAreCamelizedWhenUsingFeign() throws IOExceptio public void testWebClientWithUseAbstractionForFiles() throws IOException { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true); @@ -1205,7 +1196,6 @@ public void testWebClientWithUseAbstractionForFiles() throws IOException { @Test public void testRestTemplateWithFreeFormInQueryParameters() throws IOException { final Map properties = new HashMap<>(); - properties.put(AbstractJavaCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); final File output = Files.createTempDirectory("test") @@ -1234,7 +1224,6 @@ public void testRestTemplateWithFreeFormInQueryParameters() throws IOException { @Test public void testWebClientWithFreeFormInQueryParameters() throws IOException { final Map properties = new HashMap<>(); - properties.put(AbstractJavaCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); final File output = Files.createTempDirectory("test") @@ -1265,7 +1254,6 @@ public void testWebClientWithFreeFormInQueryParameters() throws IOException { @Test public void testNativeClientWhiteSpacePathParamEncoding() throws IOException { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); File output = Files.createTempDirectory("test").toFile(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java index 11c39751450d..eb263d353014 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java @@ -75,7 +75,7 @@ public void converterInArrayTest() { Assert.assertEquals(enumVar.dataType, "List"); Assert.assertEquals(enumVar.datatypeWithEnum, "List"); Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "new ArrayList()"); + Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()"); Assert.assertEquals(enumVar.baseType, "List"); Assert.assertTrue(enumVar.isEnum); @@ -108,7 +108,7 @@ public void converterInArrayInArrayTest() { Assert.assertEquals(enumVar.dataType, "List>"); Assert.assertEquals(enumVar.datatypeWithEnum, "List>"); Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "new ArrayList>()"); + Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()"); Assert.assertEquals(enumVar.baseType, "List"); Assert.assertTrue(enumVar.isEnum); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java index 8827229bfade..3828d13d1231 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java @@ -128,7 +128,7 @@ public void listPropertyTest() { Assert.assertEquals(property.setter, "setUrls"); Assert.assertEquals(property.dataType, "List"); Assert.assertEquals(property.name, "urls"); - Assert.assertEquals(property.defaultValue, "new ArrayList()"); + Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); Assert.assertEquals(property.baseType, "List"); Assert.assertEquals(property.containerType, "array"); Assert.assertFalse(property.required); @@ -160,7 +160,7 @@ public void setPropertyTest() { Assert.assertEquals(property.setter, "setUrls"); Assert.assertEquals(property.dataType, "Set"); Assert.assertEquals(property.name, "urls"); - Assert.assertEquals(property.defaultValue, "new LinkedHashSet()"); + Assert.assertEquals(property.defaultValue, "new LinkedHashSet<>()"); Assert.assertEquals(property.baseType, "Set"); Assert.assertEquals(property.containerType, "set"); Assert.assertFalse(property.required); @@ -190,7 +190,7 @@ public void mapPropertyTest() { Assert.assertEquals(property.setter, "setTranslations"); Assert.assertEquals(property.dataType, "Map"); Assert.assertEquals(property.name, "translations"); - Assert.assertEquals(property.defaultValue, "new HashMap()"); + Assert.assertEquals(property.defaultValue, "new HashMap<>()"); Assert.assertEquals(property.baseType, "Map"); Assert.assertEquals(property.containerType, "map"); Assert.assertFalse(property.required); @@ -220,7 +220,7 @@ public void mapWithListPropertyTest() { Assert.assertEquals(property.setter, "setTranslations"); Assert.assertEquals(property.dataType, "Map>"); Assert.assertEquals(property.name, "translations"); - Assert.assertEquals(property.defaultValue, "new HashMap>()"); + Assert.assertEquals(property.defaultValue, "new HashMap<>()"); Assert.assertEquals(property.baseType, "Map"); Assert.assertEquals(property.containerType, "map"); Assert.assertFalse(property.required); @@ -246,7 +246,7 @@ public void list2DPropertyTest() { Assert.assertEquals(property.setter, "setList2D"); Assert.assertEquals(property.dataType, "List>"); Assert.assertEquals(property.name, "list2D"); - Assert.assertEquals(property.defaultValue, "new ArrayList>()"); + Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); Assert.assertEquals(property.baseType, "List"); Assert.assertEquals(property.containerType, "array"); Assert.assertFalse(property.required); @@ -331,7 +331,7 @@ public void complexListPropertyTest() { Assert.assertEquals(property.setter, "setChildren"); Assert.assertEquals(property.dataType, "List"); Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new ArrayList()"); + Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); Assert.assertEquals(property.baseType, "List"); Assert.assertEquals(property.containerType, "array"); Assert.assertFalse(property.required); @@ -362,7 +362,7 @@ public void complexMapPropertyTest() { Assert.assertEquals(property.setter, "setChildren"); Assert.assertEquals(property.dataType, "Map"); Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new HashMap()"); + Assert.assertEquals(property.defaultValue, "new HashMap<>()"); Assert.assertEquals(property.baseType, "Map"); Assert.assertEquals(property.containerType, "map"); Assert.assertFalse(property.required); @@ -399,7 +399,7 @@ public void arrayModelWithItemNameTest() { Assert.assertEquals(property.setter, "setChildren"); Assert.assertEquals(property.dataType, "List"); Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new ArrayList()"); + Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); Assert.assertEquals(property.baseType, "List"); Assert.assertEquals(property.containerType, "array"); Assert.assertFalse(property.required); @@ -904,7 +904,7 @@ public void modelWithWrappedXmlTest() { Assert.assertEquals(property2.setter, "setArray"); Assert.assertEquals(property2.dataType, "List"); Assert.assertEquals(property2.name, "array"); - Assert.assertEquals(property2.defaultValue, "new ArrayList()"); + Assert.assertEquals(property2.defaultValue, "new ArrayList<>()"); Assert.assertEquals(property2.baseType, "List"); Assert.assertTrue(property2.isContainer); Assert.assertTrue(property2.isXmlWrapped); @@ -1315,7 +1315,6 @@ public void generateEmpty() throws Exception { Assert.assertTrue(new File(inputSpec).exists()); JavaClientCodegen config = new org.openapitools.codegen.languages.JavaClientCodegen(); - config.setJava8Mode(true); config.setHideGenerationTimestamp(true); config.setOutputDir(output.getAbsolutePath()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFExtServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFExtServerCodegenTest.java index 893e8c8cba68..1c3f712d1919 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFExtServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFExtServerCodegenTest.java @@ -76,11 +76,6 @@ public boolean isGenerateSpringBootApplication() { return generateSpringBootApplication; } - // AbstractJavaCodegen.JAVA8_MODE - public boolean isJava8Mode() { - return java8Mode; - } - // CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING public boolean isSerializeBigDecimalAsString() { return serializeBigDecimalAsString; @@ -257,7 +252,6 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { additionalProperties.put(AbstractJavaCodegen.DATE_LIBRARY, "MyDateLibrary"); additionalProperties.put(AbstractJavaCodegen.DISABLE_HTML_ESCAPING, "true"); additionalProperties.put(AbstractJavaCodegen.FULL_JAVA_UTIL, "true"); - additionalProperties.put(AbstractJavaCodegen.JAVA8_MODE, "true"); additionalProperties.put(AbstractJavaCodegen.SUPPORT_ASYNC, "true"); additionalProperties.put(AbstractJavaCodegen.SUPPORT_JAVA6, "false"); additionalProperties.put(AbstractJavaCodegen.WITH_XML, "true"); @@ -333,7 +327,6 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { assertEquals(testerCodegen.getDateLibrary(), "MyDateLibrary"); assertEquals(testerCodegen.isDisableHtmlEscaping(), true); assertEquals(testerCodegen.isFullJavaUtil(), true); - assertEquals(testerCodegen.isJava8Mode(), true); assertEquals(testerCodegen.isSupportAsync(), true); assertEquals(testerCodegen.isWithXml(), true); assertEquals(testerCodegen.isOpenApiNullable(), false); @@ -509,7 +502,6 @@ public void testInitialConfigValues() throws Exception { assertNull(additionalProperties.get(AbstractJavaCodegen.DATE_LIBRARY)); assertEquals(additionalProperties.get(AbstractJavaCodegen.DISABLE_HTML_ESCAPING), Boolean.FALSE); assertEquals(additionalProperties.get(AbstractJavaCodegen.FULL_JAVA_UTIL), Boolean.FALSE); - assertNull(additionalProperties.get(AbstractJavaCodegen.JAVA8_MODE)); assertNull(additionalProperties.get(AbstractJavaCodegen.SUPPORT_ASYNC)); assertEquals(additionalProperties.get(AbstractJavaCodegen.SUPPORT_JAVA6), Boolean.FALSE); assertEquals(additionalProperties.get(AbstractJavaCodegen.WITH_XML), false); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java index c04197d9091c..78e24b17f853 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java @@ -28,7 +28,6 @@ import static org.openapitools.codegen.TestUtils.assertFileContains; import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; -import static org.openapitools.codegen.languages.AbstractJavaCodegen.JAVA8_MODE; import static org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen.USE_TAGS; import static org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen.INTERFACE_ONLY; import static org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen.SUPPORT_ASYNC; @@ -101,7 +100,6 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { codegen.additionalProperties().put("serverPort", "8088"); codegen.additionalProperties().put(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, "openapi.yml"); codegen.additionalProperties().put(SUPPORT_ASYNC, true); - codegen.additionalProperties().put(JAVA8_MODE, false); codegen.processOpts(); OpenAPI openAPI = new OpenAPI(); @@ -120,7 +118,6 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { Assert.assertEquals(codegen.getOpenApiSpecFileLocation(), "openapi.yml"); Assert.assertEquals(codegen.additionalProperties().get(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION), "openapi.yml"); Assert.assertEquals(codegen.additionalProperties().get(SUPPORT_ASYNC), "true"); - Assert.assertEquals(codegen.additionalProperties().get(JAVA8_MODE), true); //overridden by supportAsync=true } /** @@ -231,7 +228,6 @@ public void testToApiNameForSubresource() { @Test public void testGeneratePingDefaultLocation() throws Exception { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); File output = Files.createTempDirectory("test").toFile(); @@ -255,7 +251,6 @@ public void testGeneratePingDefaultLocation() throws Exception { @Test public void testGeneratePingNoSpecFile() throws Exception { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, ""); File output = Files.createTempDirectory("test").toFile(); @@ -279,7 +274,6 @@ public void testGeneratePingNoSpecFile() throws Exception { @Test public void testGeneratePingAlternativeLocation1() throws Exception { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, "src/main/resources/META-INF/openapi.yaml"); File output = Files.createTempDirectory("test").toFile(); @@ -304,7 +298,6 @@ public void testGeneratePingAlternativeLocation1() throws Exception { @Test public void testGeneratePingAlternativeLocation2() throws Exception { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, "openapi.yml"); File output = Files.createTempDirectory("test").toFile(); @@ -328,7 +321,6 @@ public void testGeneratePingAlternativeLocation2() throws Exception { @Test public void testGenerateApiWithPrecedingPathParameter_issue1347() throws Exception { Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.JAVA8_MODE, true); properties.put(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, "openapi.yml"); File output = Files.createTempDirectory("test").toFile(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 7c086c50a60f..166ac7bdf314 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -603,9 +603,10 @@ public void useBeanValidationTruePerformBeanValidationFalseJava8TrueForFormatEma @Test public void useBeanValidationTruePerformBeanValidationTrueJava8FalseForFormatEmail() throws IOException { - beanValidationForFormatEmail(true, true, false, "@org.hibernate.validator.constraints.Email", "@javax.validation.constraints.Email"); + beanValidationForFormatEmail(true, true, false, "@javax.validation.constraints.Email", "@org.hibernate.validator.constraints.Email"); } + // note: java8 option/mustache tag has been removed and default to true private void beanValidationForFormatEmail(boolean useBeanValidation, boolean performBeanValidation, boolean java8, String contains, String notContains) throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); output.deleteOnExit(); diff --git a/samples/client/others/java/okhttp-gson-streaming/README.md b/samples/client/others/java/okhttp-gson-streaming/README.md index 418a3fb42788..ef1bda7072e2 100644 --- a/samples/client/others/java/okhttp-gson-streaming/README.md +++ b/samples/client/others/java/okhttp-gson-streaming/README.md @@ -12,7 +12,7 @@ No description provided (generated by Openapi Generator https://github.com/opena ## Requirements Building the API client library requires: -1. Java 1.7+ +1. Java 1.8+ 2. Maven (3.8.3+)/Gradle (7.2+) ## Installation diff --git a/samples/client/others/java/okhttp-gson-streaming/build.gradle b/samples/client/others/java/okhttp-gson-streaming/build.gradle index e379bd4c65dc..da868426d5dd 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.gradle +++ b/samples/client/others/java/okhttp-gson-streaming/build.gradle @@ -116,7 +116,6 @@ dependencies { implementation 'javax.ws.rs:javax.ws.rs-api:2.0' implementation 'org.openapitools:jackson-databind-nullable:0.2.1' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - implementation 'org.threeten:threetenbp:1.4.3' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'junit:junit:4.13.1' testImplementation 'org.mockito:mockito-core:3.11.2' diff --git a/samples/client/others/java/okhttp-gson-streaming/build.sbt b/samples/client/others/java/okhttp-gson-streaming/build.sbt index bedd1f8bd629..802fc53bd900 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.sbt +++ b/samples/client/others/java/okhttp-gson-streaming/build.sbt @@ -17,7 +17,6 @@ lazy val root = (project in file(".")). "javax.ws.rs" % "jsr311-api" % "1.1.1", "javax.ws.rs" % "javax.ws.rs-api" % "2.0", "org.openapitools" % "jackson-databind-nullable" % "0.2.2", - "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", diff --git a/samples/client/others/java/okhttp-gson-streaming/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index 8a1529f3b2b8..72f0bb83d07f 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -285,11 +285,6 @@ commons-lang3 ${commons-lang3-version} - - org.threeten - threetenbp - ${threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -335,7 +330,6 @@ 2.8.8 3.12.0 0.2.2 - 1.5.0 1.3.5 4.13.2 UTF-8 diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java index 840cac41bd29..6c97a04c6b43 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java @@ -21,9 +21,6 @@ import okio.Buffer; import okio.BufferedSink; import okio.Okio; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import javax.net.ssl.*; import java.io.File; @@ -44,6 +41,9 @@ import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java index 33256f94541c..2a46b4d2bf1d 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java @@ -23,9 +23,6 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import okio.ByteString; @@ -35,6 +32,9 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy index 630c015aaa4e..eabab3d7438a 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy @@ -17,9 +17,9 @@ class Pet { String name - List photoUrls = new ArrayList() + List photoUrls = new ArrayList<>() - List tags = new ArrayList() + List tags = new ArrayList<>() /* pet status in the store */ String status } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 8e130aca02ee..05c2bd2e698b 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -89,7 +89,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -120,7 +120,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -151,7 +151,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -182,7 +182,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -213,7 +213,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -244,7 +244,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -275,7 +275,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -306,7 +306,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index f8e35cafcb37..3fb686b35797 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -48,7 +48,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 0c81db857cef..ba1b900987d2 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -48,7 +48,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java index 91a150fa94df..34a50221ea0f 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java @@ -56,7 +56,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -87,7 +87,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -118,7 +118,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java index 9c72665e822d..b31ae4dcf000 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java @@ -140,7 +140,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java index b1f30f1a4fc1..df68f20bc6b3 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -76,7 +76,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java index 57112ef976a5..8b2f5f203bf1 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java @@ -93,7 +93,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -124,7 +124,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -155,7 +155,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -186,7 +186,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 46e2e81f47a5..24149ce9314f 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -107,7 +107,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java index fa4dec4b495a..15e291c5b017 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java @@ -55,7 +55,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -205,7 +205,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java index 47b47122e39a..b569e2f29181 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -53,7 +53,7 @@ public class TypeHolderDefault { private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java index be1a7351861c..c138347293f3 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -57,7 +57,7 @@ public class TypeHolderExample { private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java index 351e04063b01..486cd00a6778 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java @@ -252,7 +252,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -375,7 +375,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -406,7 +406,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -529,7 +529,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -560,7 +560,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -683,7 +683,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -714,7 +714,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -837,7 +837,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -868,7 +868,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES index 0c47aa52ae1f..e8b75caa79f0 100644 --- a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES @@ -70,7 +70,6 @@ src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiException.java src/main/java/org/openapitools/client/Configuration.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/Pair.java src/main/java/org/openapitools/client/RFC3339DateFormat.java diff --git a/samples/client/petstore/java/apache-httpclient/build.gradle b/samples/client/petstore/java/apache-httpclient/build.gradle index bc0d42140990..e391ad78fdc1 100644 --- a/samples/client/petstore/java/apache-httpclient/build.gradle +++ b/samples/client/petstore/java/apache-httpclient/build.gradle @@ -118,7 +118,6 @@ ext { jackson_databind_version = "2.10.5.1" jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" - jackson_threetenbp_version = "2.9.10" httpclient_version = "4.5.13" jodatime_version = "2.9.9" junit_version = "4.13.1" @@ -135,7 +134,6 @@ dependencies { implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/apache-httpclient/pom.xml b/samples/client/petstore/java/apache-httpclient/pom.xml index 642d88706cd6..09768f6d15e9 100644 --- a/samples/client/petstore/java/apache-httpclient/pom.xml +++ b/samples/client/petstore/java/apache-httpclient/pom.xml @@ -152,8 +152,8 @@ maven-compiler-plugin 3.6.1 - 1.8 - 1.8 + 1.8 + 1.8 @@ -162,7 +162,7 @@ 3.1.1 none - 1.8 + 1.8 @@ -266,11 +266,6 @@ jackson-datatype-jsr310 ${jackson-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -290,7 +285,6 @@ 1.5.21 4.5.13 2.12.1 - 2.9.10 1.3.5 1.0.0 4.13.1 diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index 754393e13a02..a6e7049085af 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -12,12 +12,10 @@ package org.openapitools.client; -import org.threeten.bp.*; - import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +import java.time.OffsetDateTime; import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; @@ -120,11 +118,6 @@ public ApiClient(CloseableHttpClient httpClient) { objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); objectMapper.registerModule(new JavaTimeModule()); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 12383cdea06c..fde767b8e2fa 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -12,9 +12,9 @@ package org.openapitools.client; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java index 0dcbbd21c280..746ca46f6154 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -24,8 +24,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java index 948722b28de0..93653ea5824b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -20,7 +20,7 @@ import org.openapitools.client.model.*; import org.openapitools.client.Pair; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index b75583565424..b2924cbe555f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -21,7 +21,6 @@ import java.util.Map; import java.util.List; - @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HttpBasicAuth implements Authentication { private String username; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java index 87ec77092d6b..cef5858fe18f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b6361509275f..a7abbab8c555 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java index 34dcbe2336d4..4fccc19338f1 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeApiTest.java index 6967ebde9c5d..2ee81439d0b8 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -18,8 +18,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FormatTestTest.java index edcf176df668..a89fe772be76 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,8 +23,8 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index bda97ddf91da..ea6eee23f882 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -25,7 +25,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OrderTest.java index 16a95b2e5d41..007f1aaea8a1 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OrderTest.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/FILES b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/FILES index 066853f5d0aa..60e36d2d8c20 100644 --- a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/FILES +++ b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/FILES @@ -15,7 +15,6 @@ settings.gradle src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiResponseDecoder.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/EncodingUtils.java src/main/java/org/openapitools/client/ParamExpander.java src/main/java/org/openapitools/client/RFC3339DateFormat.java diff --git a/samples/client/petstore/java/feign-no-nullable/build.gradle b/samples/client/petstore/java/feign-no-nullable/build.gradle index 2231ca517ba1..b00f511b7fb9 100644 --- a/samples/client/petstore/java/feign-no-nullable/build.gradle +++ b/samples/client/petstore/java/feign-no-nullable/build.gradle @@ -105,7 +105,6 @@ ext { jackson_version = "2.10.3" jackson_databind_version = "2.10.3" jakarta_annotation_version = "1.3.5" - jackson_threetenbp_version = "2.9.10" feign_version = "10.11" feign_form_version = "3.8.0" junit_version = "5.7.0" @@ -123,7 +122,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "com.brsanthu:migbase64:2.2" implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" diff --git a/samples/client/petstore/java/feign-no-nullable/build.sbt b/samples/client/petstore/java/feign-no-nullable/build.sbt index 5f47c4495754..e258c3ef068f 100644 --- a/samples/client/petstore/java/feign-no-nullable/build.sbt +++ b/samples/client/petstore/java/feign-no-nullable/build.sbt @@ -19,7 +19,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", diff --git a/samples/client/petstore/java/feign-no-nullable/pom.xml b/samples/client/petstore/java/feign-no-nullable/pom.xml index 798bebf47d56..e9e690629304 100644 --- a/samples/client/petstore/java/feign-no-nullable/pom.xml +++ b/samples/client/petstore/java/feign-no-nullable/pom.xml @@ -263,9 +263,9 @@ ${jackson-databind-version} - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} com.github.scribejava @@ -327,7 +327,6 @@ 3.8.0 2.10.3 2.10.3 - 2.9.10 1.3.5 5.7.0 1.0.0 diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java index da622ac9d094..5779e5c17a51 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java @@ -5,13 +5,12 @@ import java.util.logging.Level; import java.util.logging.Logger; -import org.threeten.bp.*; import feign.okhttp.OkHttpClient; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import feign.Feign; import feign.RequestInterceptor; @@ -127,11 +126,7 @@ private ObjectMapper createObjectMapper() { objectMapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.setDateFormat(new RFC3339DateFormat()); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); + objectMapper.registerModule(new JavaTimeModule()); return objectMapper; } diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/FakeApi.java index 3a9fb59c4588..419674d94e6a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/FakeApi.java @@ -8,8 +8,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java index b71073a1acc9..4c15dc695336 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java @@ -4,7 +4,7 @@ import org.openapitools.client.EncodingUtils; import org.openapitools.client.model.ApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 681cde131684..bf27e303a9bd 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -92,7 +92,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -127,7 +127,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -162,7 +162,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -197,7 +197,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -232,7 +232,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -267,7 +267,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -302,7 +302,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -337,7 +337,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index a741789d3ada..2cf5c494d2c3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -51,7 +51,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 8cc942cb0139..be1aca1d6db6 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -51,7 +51,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index 6cbe60cc9d03..8c2c4f676e99 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -59,7 +59,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -94,7 +94,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -129,7 +129,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index 22e516c64c58..b2727221b3cc 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -151,7 +151,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 7a576704d8e0..21d41b6f2dba 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -82,7 +82,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(File filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index aa8bb4eaf832..862c1888cae9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index a3a475637b8d..a6ac34dc9209 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -98,7 +98,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -133,7 +133,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -168,7 +168,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -203,7 +203,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 43c027223e13..eced4bd0d5d4 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -116,7 +116,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java index 6b990afde26c..d2bd11d92c8e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index af99775de00f..bdb99b4a9443 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -56,7 +56,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -226,7 +226,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index b43e4d092dc8..f9e5852a9d70 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -54,7 +54,7 @@ public class TypeHolderDefault { private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 4bbb377dfe3b..ec6973375ea9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -58,7 +58,7 @@ public class TypeHolderExample { private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index 508f9e5147ff..249cd62cc8c0 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -271,7 +271,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -414,7 +414,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -449,7 +449,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -592,7 +592,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -627,7 +627,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -770,7 +770,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -805,7 +805,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -948,7 +948,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -983,7 +983,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java index 01dad296cb29..58d6563e94bc 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -5,14 +5,14 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeEach; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java index fdc269f4259e..0243341bd206 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,8 +23,6 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index b2ce8721036b..c2bfb3ce9ef5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -25,7 +25,6 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java index f84bff7dca9c..a63dbf7be9ed 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java @@ -20,7 +20,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java/feign/.openapi-generator/FILES b/samples/client/petstore/java/feign/.openapi-generator/FILES index a499c6287828..69579e43df66 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/FILES +++ b/samples/client/petstore/java/feign/.openapi-generator/FILES @@ -15,7 +15,6 @@ settings.gradle src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiResponseDecoder.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/EncodingUtils.java src/main/java/org/openapitools/client/ParamExpander.java src/main/java/org/openapitools/client/RFC3339DateFormat.java diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index aa0a64e08f8d..6897518dc223 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -106,7 +106,6 @@ ext { jackson_databind_version = "2.10.3" jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" - jackson_threetenbp_version = "2.9.10" feign_version = "10.11" feign_form_version = "3.8.0" junit_version = "5.7.0" @@ -125,7 +124,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "com.brsanthu:migbase64:2.2" implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index 50dd4219edbd..c7f4cdfc834b 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -19,7 +19,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", diff --git a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java index 9029ef9ffe7f..dfcf539a6b3c 100644 --- a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java @@ -7,8 +7,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java index d24c2298054f..2b0956a0ef46 100644 --- a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,8 +24,8 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** diff --git a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3ccd9310b55c..f0d874985363 100644 --- a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** diff --git a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/Order.java index 3d5229525795..1c4d739459f3 100644 --- a/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/feign10x/src/main/java/org/openapitools/client/model/Order.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** diff --git a/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/api/FakeApiTest.java index bbb4a9bbc854..dee9e411a817 100644 --- a/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -5,8 +5,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.junit.Before; diff --git a/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/FormatTestTest.java index 6081209ef19f..097984bdeac4 100644 --- a/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -21,8 +21,8 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index c308aec0a94d..95cd93a316d7 100644 --- a/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/OrderTest.java index c2d3025a2643..d65ce716e13e 100644 --- a/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/feign/feign10x/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index 1f08498e7960..91a7e47bb8f6 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -268,9 +268,9 @@ ${jackson-databind-nullable-version} - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} com.github.scribejava @@ -333,7 +333,6 @@ 2.10.3 0.2.2 2.10.3 - 2.9.10 1.3.5 5.7.0 1.0.0 diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java index 6d02aa546b8c..358ef5092945 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java @@ -5,14 +5,13 @@ import java.util.logging.Level; import java.util.logging.Logger; -import org.threeten.bp.*; import feign.okhttp.OkHttpClient; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import org.openapitools.jackson.nullable.JsonNullableModule; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import feign.Feign; import feign.RequestInterceptor; @@ -132,11 +131,7 @@ private ObjectMapper createObjectMapper() { objectMapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.setDateFormat(new RFC3339DateFormat()); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); + objectMapper.registerModule(new JavaTimeModule()); JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); return objectMapper; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index 915a61d95840..70b995edc331 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -9,8 +9,8 @@ import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java index 55adb67061eb..8c0dad2afdc4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java @@ -4,7 +4,7 @@ import org.openapitools.client.EncodingUtils; import org.openapitools.client.model.ApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 036bd0becce6..28a144fd4f4d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -54,7 +54,7 @@ public AdditionalPropertiesClass mapProperty(Map mapProperty) { public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { if (this.mapProperty == null) { - this.mapProperty = new HashMap(); + this.mapProperty = new HashMap<>(); } this.mapProperty.put(key, mapPropertyItem); return this; @@ -89,7 +89,7 @@ public AdditionalPropertiesClass mapOfMapProperty(Map mapOfMapPropertyItem) { if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 649c9e94fbe3..395b4c4d405d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -50,7 +50,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index abcfd84dab57..81437ecc350b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -50,7 +50,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java index ef4272c814b5..29e8fde2a2bc 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -58,7 +58,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -93,7 +93,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -128,7 +128,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java index 170b78af7b14..f5b42b0b8739 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -150,7 +150,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 306e4b90d6ee..6137dbb6280b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -81,7 +81,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(File filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java index 999d81c65763..f1ef660aa6c9 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index d3291df59fe8..f21d8f15c1e0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -97,7 +97,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -132,7 +132,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -167,7 +167,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -202,7 +202,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 257a9fe634f1..a7abbab8c555 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -115,7 +115,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java index e242e8994940..215add9f0cdf 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java @@ -23,13 +23,13 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; @@ -312,7 +312,7 @@ public NullableClass arrayNullableProp(List arrayNullableProp) { public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) { - this.arrayNullableProp = JsonNullable.>of(new ArrayList()); + this.arrayNullableProp = JsonNullable.>of(new ArrayList<>()); } try { this.arrayNullableProp.get().add(arrayNullablePropItem); @@ -359,7 +359,7 @@ public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullabl public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) { - this.arrayAndItemsNullableProp = JsonNullable.>of(new ArrayList()); + this.arrayAndItemsNullableProp = JsonNullable.>of(new ArrayList<>()); } try { this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem); @@ -406,7 +406,7 @@ public NullableClass arrayItemsNullable(List arrayItemsNullable) { public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { if (this.arrayItemsNullable == null) { - this.arrayItemsNullable = new ArrayList(); + this.arrayItemsNullable = new ArrayList<>(); } this.arrayItemsNullable.add(arrayItemsNullableItem); return this; @@ -441,7 +441,7 @@ public NullableClass objectNullableProp(Map objectNullableProp) public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) { - this.objectNullableProp = JsonNullable.>of(new HashMap()); + this.objectNullableProp = JsonNullable.>of(new HashMap<>()); } try { this.objectNullableProp.get().put(key, objectNullablePropItem); @@ -488,7 +488,7 @@ public NullableClass objectAndItemsNullableProp(Map objectAndIte public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) { - this.objectAndItemsNullableProp = JsonNullable.>of(new HashMap()); + this.objectAndItemsNullableProp = JsonNullable.>of(new HashMap<>()); } try { this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem); @@ -535,7 +535,7 @@ public NullableClass objectItemsNullable(Map objectItemsNullable public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { if (this.objectItemsNullable == null) { - this.objectItemsNullable = new HashMap(); + this.objectItemsNullable = new HashMap<>(); } this.objectItemsNullable.put(key, objectItemsNullableItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index d6a77e2107e4..3831a4d330ae 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -148,7 +148,7 @@ public ObjectWithDeprecatedFields bars(List bars) { public ObjectWithDeprecatedFields addBarsItem(String barsItem) { if (this.bars == null) { - this.bars = new ArrayList(); + this.bars = new ArrayList<>(); } this.bars.add(barsItem); return this; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java index 4bd1b9d4f2f5..1e36e84199d3 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index 54b9601550c5..27121c69698e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -55,7 +55,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -225,7 +225,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java index 6e6a591a614e..ea6b6062323b 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -6,8 +6,8 @@ import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; @@ -376,7 +376,9 @@ void testQueryParameterCollectionFormatTest() { List http = null; List url = null; List context = null; - // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + String allowEmpty = null; + Map language = null; + // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); // TODO: test validations } @@ -396,7 +398,9 @@ void testQueryParameterCollectionFormatTestQueryMap() { .ioutil(null) .http(null) .url(null) - .context(null); + .context(null) + .language(null) + .allowEmpty(null); // api.testQueryParameterCollectionFormat(queryParams); // TODO: test validations diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/StoreApiTest.java index 2b0ac4c9d346..68a9388a03a0 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -7,9 +7,9 @@ import org.junit.jupiter.api.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneOffset; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; import java.util.Map; import static com.github.tomakehurst.wiremock.client.WireMock.*; diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FormatTestTest.java index fdc269f4259e..0243341bd206 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,8 +23,6 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index b2ce8721036b..c2bfb3ce9ef5 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -25,7 +25,6 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NullableClassTest.java index fc61073c9eec..c6fd22a24e86 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -25,8 +25,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OrderTest.java index f84bff7dca9c..a63dbf7be9ed 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OrderTest.java @@ -20,7 +20,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/FILES b/samples/client/petstore/java/google-api-client/.openapi-generator/FILES index c94eb1d3630f..2c1fbc8c4a0c 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/FILES +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/FILES @@ -68,7 +68,6 @@ pom.xml settings.gradle src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/RFC3339DateFormat.java src/main/java/org/openapitools/client/ServerConfiguration.java src/main/java/org/openapitools/client/ServerVariable.java diff --git a/samples/client/petstore/java/google-api-client/README.md b/samples/client/petstore/java/google-api-client/README.md index 45432ff2e731..407d5e337502 100644 --- a/samples/client/petstore/java/google-api-client/README.md +++ b/samples/client/petstore/java/google-api-client/README.md @@ -13,7 +13,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod Building the API client library requires: -1. Java 1.7+ +1. Java 1.8+ 2. Maven/Gradle ## Installation diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index d4334f128b5b..0cd3192e9b60 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -32,8 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } // Rename the aar correctly @@ -78,8 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 publishing { publications { @@ -106,7 +106,6 @@ ext { jersey_common_version = "2.25.1" jodatime_version = "2.9.9" junit_version = "4.13.1" - jackson_threeten_version = "2.9.10" } dependencies { @@ -119,7 +118,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/google-api-client/build.sbt b/samples/client/petstore/java/google-api-client/build.sbt index ad1c65c2f6b1..1c7f90d0ecd2 100644 --- a/samples/client/petstore/java/google-api-client/build.sbt +++ b/samples/client/petstore/java/google-api-client/build.sbt @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.12.1" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.1" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index b3016450008d..01ca137bfce2 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -137,8 +137,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -147,7 +147,7 @@ 3.1.1 none - 1.7 + 1.8 @@ -244,9 +244,9 @@ ${jackson-databind-nullable-version} - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} jakarta.annotation @@ -271,7 +271,6 @@ 2.12.1 2.10.5.1 0.2.2 - 2.9.10 1.3.5 1.0.0 4.13.1 diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ApiClient.java index 80cb32e59f5c..9040113ee04f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ApiClient.java @@ -5,8 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import org.openapitools.jackson.nullable.JsonNullableModule; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.threeten.bp.*; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.google.api.client.googleapis.util.Utils; import com.google.api.client.http.AbstractHttpContent; import com.google.api.client.http.HttpRequestFactory; @@ -31,11 +30,7 @@ private static ObjectMapper createDefaultObjectMapper() { .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .setDateFormat(new RFC3339DateFormat()); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); + objectMapper.registerModule(new JavaTimeModule()); JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); return objectMapper; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java index 0ba78a734da5..daf6e2d718aa 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java @@ -6,8 +6,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java index b3ef67b61ca6..e335dc01eb09 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ import org.openapitools.client.ApiClient; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 7ed7eada218d..22fe0a8e0f42 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -91,7 +91,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -126,7 +126,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -161,7 +161,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -196,7 +196,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -231,7 +231,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -266,7 +266,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -301,7 +301,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -336,7 +336,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 649c9e94fbe3..395b4c4d405d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -50,7 +50,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index abcfd84dab57..81437ecc350b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -50,7 +50,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java index ef4272c814b5..29e8fde2a2bc 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -58,7 +58,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -93,7 +93,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -128,7 +128,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java index 170b78af7b14..f5b42b0b8739 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -150,7 +150,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5134b02e94af..43c10d8609b0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -81,7 +81,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java index 87ec77092d6b..cef5858fe18f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index d3291df59fe8..f21d8f15c1e0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -97,7 +97,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -132,7 +132,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -167,7 +167,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -202,7 +202,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 257a9fe634f1..a7abbab8c555 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -115,7 +115,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java index 34dcbe2336d4..4fccc19338f1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index 54b9601550c5..27121c69698e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -55,7 +55,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -225,7 +225,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f5425c1d5f9d..b4e2af9d2546 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -53,7 +53,7 @@ public class TypeHolderDefault { private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 94c308e6c304..e550b7a42198 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -57,7 +57,7 @@ public class TypeHolderExample { private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java index f797d243ea7b..f038a2d4b987 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java @@ -270,7 +270,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -413,7 +413,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -448,7 +448,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -591,7 +591,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -626,7 +626,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -769,7 +769,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -804,7 +804,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -947,7 +947,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -982,7 +982,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java index d8bfb243b103..b897e6b1db9c 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,8 +17,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.junit.Test; diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FormatTestTest.java index 6081209ef19f..097984bdeac4 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -21,8 +21,8 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index c308aec0a94d..95cd93a316d7 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OrderTest.java index c2d3025a2643..d65ce716e13e 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/FILES b/samples/client/petstore/java/jersey1/.openapi-generator/FILES index 0c47aa52ae1f..e8b75caa79f0 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey1/.openapi-generator/FILES @@ -70,7 +70,6 @@ src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiException.java src/main/java/org/openapitools/client/Configuration.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/Pair.java src/main/java/org/openapitools/client/RFC3339DateFormat.java diff --git a/samples/client/petstore/java/jersey1/README.md b/samples/client/petstore/java/jersey1/README.md index ac8b1bbacf91..662297635328 100644 --- a/samples/client/petstore/java/jersey1/README.md +++ b/samples/client/petstore/java/jersey1/README.md @@ -13,7 +13,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod Building the API client library requires: -1. Java 1.7+ +1. Java 1.8+ 2. Maven/Gradle ## Installation diff --git a/samples/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index 36ce7cd1fdc8..9953a84b09d5 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -32,8 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } // Rename the aar correctly @@ -78,8 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 publishing { publications { @@ -118,7 +118,6 @@ ext { jackson_databind_version = "2.10.5.1" jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" - jackson_threetenbp_version = "2.9.10" jersey_version = "1.19.4" jodatime_version = "2.9.9" junit_version = "4.13.1" @@ -134,8 +133,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - implementation "com.brsanthu:migbase64:2.2" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/jersey1/pom.xml b/samples/client/petstore/java/jersey1/pom.xml index 76365cd391b2..3513db746886 100644 --- a/samples/client/petstore/java/jersey1/pom.xml +++ b/samples/client/petstore/java/jersey1/pom.xml @@ -152,8 +152,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -162,7 +162,7 @@ 3.1.1 none - 1.7 + 1.8 @@ -262,15 +262,9 @@ ${jackson-version} - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - - - com.brsanthu - migbase64 - 2.2 + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} jakarta.annotation @@ -291,7 +285,6 @@ 1.6.3 1.19.4 2.12.5 - 2.9.10 1.3.5 1.0.0 4.13.1 diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java index d0f11019fb7e..bb003a638da1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java @@ -12,11 +12,10 @@ package org.openapitools.client; -import org.threeten.bp.*; - import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.time.OffsetDateTime; import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.sun.jersey.api.client.Client; @@ -93,11 +92,7 @@ public ApiClient() { objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); + objectMapper.registerModule(new JavaTimeModule()); objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 12383cdea06c..fde767b8e2fa 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -12,9 +12,9 @@ package org.openapitools.client; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java index e44804bc382e..6df1bf4f2718 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -24,8 +24,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java index c0862cb96675..e099d226df3f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java @@ -20,7 +20,7 @@ import org.openapitools.client.model.*; import org.openapitools.client.Pair; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index bd1f1225416a..b2924cbe555f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -15,13 +15,12 @@ import org.openapitools.client.Pair; -import com.migcomponents.migbase64.Base64; +import java.util.Base64; +import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.List; -import java.io.UnsupportedEncodingException; - @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HttpBasicAuth implements Authentication { private String username; @@ -49,10 +48,6 @@ public void applyToParams(List queryParams, Map headerPara return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 7ed7eada218d..22fe0a8e0f42 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -91,7 +91,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -126,7 +126,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -161,7 +161,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -196,7 +196,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -231,7 +231,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -266,7 +266,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -301,7 +301,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -336,7 +336,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 649c9e94fbe3..395b4c4d405d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -50,7 +50,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index abcfd84dab57..81437ecc350b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -50,7 +50,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java index ef4272c814b5..29e8fde2a2bc 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -58,7 +58,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -93,7 +93,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -128,7 +128,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java index 170b78af7b14..f5b42b0b8739 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -150,7 +150,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5134b02e94af..43c10d8609b0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -81,7 +81,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java index 87ec77092d6b..cef5858fe18f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index d3291df59fe8..f21d8f15c1e0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -97,7 +97,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -132,7 +132,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -167,7 +167,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -202,7 +202,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 257a9fe634f1..a7abbab8c555 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -115,7 +115,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java index 34dcbe2336d4..4fccc19338f1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java index 54b9601550c5..27121c69698e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java @@ -55,7 +55,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -225,7 +225,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f5425c1d5f9d..b4e2af9d2546 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -53,7 +53,7 @@ public class TypeHolderDefault { private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 94c308e6c304..e550b7a42198 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -57,7 +57,7 @@ public class TypeHolderExample { private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java index f797d243ea7b..f038a2d4b987 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java @@ -270,7 +270,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -413,7 +413,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -448,7 +448,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -591,7 +591,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -626,7 +626,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -769,7 +769,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -804,7 +804,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -947,7 +947,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -982,7 +982,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/FakeApiTest.java index 07f4a80a5b24..829f59265b57 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -18,13 +18,13 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.junit.Test; import org.junit.Ignore; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/FormatTestTest.java index 6081209ef19f..96564e63263d 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -21,8 +21,6 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index c308aec0a94d..dcd1cf237613 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,7 +23,6 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/OrderTest.java index c2d3025a2643..ad44b1157a55 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 13e6ca480d97..3ceda0bf3753 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -23,7 +23,6 @@ import java.util.Map; import java.util.List; - @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HttpBasicAuth implements Authentication { private String username; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 13e6ca480d97..3ceda0bf3753 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -23,7 +23,6 @@ import java.util.Map; import java.util.List; - @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HttpBasicAuth implements Authentication { private String username; diff --git a/samples/client/petstore/java/microprofile-rest-client/pom.xml b/samples/client/petstore/java/microprofile-rest-client/pom.xml index 2050156fe404..b0910863ff80 100644 --- a/samples/client/petstore/java/microprofile-rest-client/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client/pom.xml @@ -125,10 +125,9 @@ jakarta.activation-api ${jakarta.activation-version} - com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-jaxrs-version} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java index da3b5f04bbdf..9b415336ac06 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java @@ -44,7 +44,7 @@ public class Pet { private String name; @JsonbProperty("photoUrls") - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonbProperty("tags") private List tags = null; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/README.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/README.md index be5472e90b81..054726451fd9 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/README.md +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/README.md @@ -12,7 +12,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod ## Requirements Building the API client library requires: -1. Java 1.7+ +1. Java 1.8+ 2. Maven (3.8.3+)/Gradle (7.2+) ## Installation diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle index 485b0ace31c3..985bea3a0a30 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle @@ -117,7 +117,6 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.1' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - implementation 'org.threeten:threetenbp:1.4.3' implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'junit:junit:4.13.1' diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt index 18c2fc66cfd9..381f01d2fb5d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt @@ -18,7 +18,6 @@ lazy val root = (project in file(".")). "javax.ws.rs" % "javax.ws.rs-api" % "2.0", "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", - "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index 3e85ce99567e..b15d1ba190e5 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -290,11 +290,6 @@ commons-lang3 ${commons-lang3-version} - - org.threeten - threetenbp - ${threetenbp-version} - io.swagger.parser.v3 swagger-parser-v3 @@ -345,7 +340,6 @@ 2.8.8 3.12.0 0.2.2 - 1.5.0 1.3.5 4.13.2 UTF-8 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java index 95e5f6a6caa2..eb4b02d4f32c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java @@ -27,9 +27,6 @@ import okio.Buffer; import okio.BufferedSink; import okio.Okio; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; import org.apache.oltu.oauth2.common.message.types.GrantType; @@ -52,6 +49,9 @@ import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java index c2502541ff1d..618aa5564f71 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java @@ -23,9 +23,6 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import okio.ByteString; @@ -35,6 +32,9 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java index 781eb83cd822..e0aeaef1d699 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java @@ -34,8 +34,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java index 9ab78e005338..5d0b2caf7a77 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java @@ -30,7 +30,7 @@ import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b9bee5272497..ba76ac0a60be 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -107,7 +107,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -138,7 +138,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -169,7 +169,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -200,7 +200,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -231,7 +231,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -262,7 +262,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -293,7 +293,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -324,7 +324,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index d375bd8a4886..40c2a19a6c0c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -66,7 +66,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9ec157ed1515..b8f1be5d4d11 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -66,7 +66,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java index 66d23d236a84..cd1ee2ed678a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -74,7 +74,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -105,7 +105,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -136,7 +136,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java index 6b64ece26660..d57daf844078 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -186,7 +186,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4bb4e340969d..f4bbc48032a3 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -93,7 +93,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java index 420e0d231559..0e41e8c16a46 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java @@ -25,9 +25,9 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java index 51fb198904fe..a10df19d5ad5 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java @@ -125,7 +125,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -156,7 +156,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -187,7 +187,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -218,7 +218,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd9f59adbb8..99dd61c8a00d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,12 +23,12 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -123,7 +123,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java index 5e577e772049..48ce848e9258 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java @@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java index f0b54cafc011..b9a2ada6d23e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java @@ -68,7 +68,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -235,7 +235,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index b0760faa22b8..21c8c815f759 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -69,7 +69,7 @@ public class TypeHolderDefault { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java index ba378dfa531a..2693a74a557f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -73,7 +73,7 @@ public class TypeHolderExample { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java index 3bdccb19d382..6d9679103696 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java @@ -270,7 +270,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -393,7 +393,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -424,7 +424,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -547,7 +547,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -578,7 +578,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -701,7 +701,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -732,7 +732,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -855,7 +855,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -886,7 +886,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/JSONTest.java index 1c825e392562..bcb72b19e429 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/JSONTest.java @@ -17,8 +17,8 @@ import okio.ByteString; import org.junit.*; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.threeten.bp.ZoneId; import org.threeten.bp.ZoneOffset; import org.threeten.bp.format.DateTimeFormatter; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/api/FakeApiTest.java index 68036a2ef428..7569f403ad85 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -18,8 +18,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/FormatTestTest.java index 4d5b377c0b4f..324f11ac4580 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -24,8 +24,8 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 93829ac8d536..af2d1b2db303 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/OrderTest.java index 808e365efb56..266bb3290d5f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/OrderTest.java @@ -21,7 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md index 4f583d48ab41..b3e111f6884e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md @@ -12,7 +12,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod ## Requirements Building the API client library requires: -1. Java 1.7+ +1. Java 1.8+ 2. Maven (3.8.3+)/Gradle (7.2+) ## Installation diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index dff8053e1cc0..a11711753141 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -117,7 +117,6 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.1' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - implementation 'org.threeten:threetenbp:1.4.3' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'junit:junit:4.13.1' testImplementation 'org.mockito:mockito-core:3.11.2' diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index 4a60fdd08d35..1d2c7f42ad18 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -18,7 +18,6 @@ lazy val root = (project in file(".")). "javax.ws.rs" % "javax.ws.rs-api" % "2.0", "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", - "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index e169b432739a..dca8ff4e0288 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -290,11 +290,6 @@ commons-lang3 ${commons-lang3-version} - - org.threeten - threetenbp - ${threetenbp-version} - com.google.android @@ -347,7 +342,6 @@ 2.8.8 3.12.0 0.2.2 - 1.5.0 1.3.5 4.13.2 UTF-8 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index 30aaedf4ee4a..c30989218335 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -21,9 +21,6 @@ import okio.Buffer; import okio.BufferedSink; import okio.Okio; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; import org.apache.oltu.oauth2.common.message.types.GrantType; @@ -46,6 +43,9 @@ import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java index c2502541ff1d..618aa5564f71 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java @@ -23,9 +23,6 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import okio.ByteString; @@ -35,6 +32,9 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index db2f0272abb1..ad6d8797c599 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -31,8 +31,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index a81b1b364434..83a8b871025f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,7 +27,7 @@ import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 87753e1c3506..a7ec47a50707 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -109,7 +109,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -140,7 +140,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -171,7 +171,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -202,7 +202,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -233,7 +233,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -264,7 +264,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -295,7 +295,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -326,7 +326,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 286ee7b3a580..3120e32652a8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -68,7 +68,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 5fefc2e724b6..d7a8877fada2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -68,7 +68,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java index 7ea18a7ce3ec..9fafea980f7d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -76,7 +76,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -107,7 +107,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -138,7 +138,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java index 538f1e573b2b..09430f203a92 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -188,7 +188,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f98a11ec8aed..c41b639396db 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -95,7 +95,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java index db316b339b5e..738a17edbb34 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java @@ -25,9 +25,9 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import android.os.Parcelable; import android.os.Parcel; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java index a1da6e960e1f..b45a4f0e4261 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java @@ -127,7 +127,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -158,7 +158,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -189,7 +189,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -220,7 +220,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 12712e38fd7a..4e7a4b450c7d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,12 +23,12 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import android.os.Parcelable; import android.os.Parcel; @@ -125,7 +125,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java index 1e9ba61a9827..50ec3f991cdd 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java @@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import android.os.Parcelable; import android.os.Parcel; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java index d317d654ca20..144e6c1e2ef2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java @@ -70,7 +70,7 @@ public class Pet implements Parcelable { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -237,7 +237,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index c090ad1a8137..16dbdb6acdc7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -71,7 +71,7 @@ public class TypeHolderDefault implements Parcelable { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9be2e51334f2..3783d9efd7f3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -75,7 +75,7 @@ public class TypeHolderExample implements Parcelable { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java index 3a076ccef854..2e1b4c8a665f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java @@ -272,7 +272,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -395,7 +395,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -426,7 +426,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -549,7 +549,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -580,7 +580,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -703,7 +703,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -734,7 +734,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -857,7 +857,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -888,7 +888,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java index d554993dd01b..cbcadd005fd7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -18,8 +18,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/FormatTestTest.java index 32dbe0df5c15..9c600e488b5f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -24,8 +24,8 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 808773a5d852..3a23e8217ba4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/OrderTest.java index b5cc55e4f581..8bad0b69dc3e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/OrderTest.java @@ -21,7 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index 50183621bd37..b926b1131003 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -12,7 +12,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod ## Requirements Building the API client library requires: -1. Java 1.7+ +1. Java 1.8+ 2. Maven (3.8.3+)/Gradle (7.2+) ## Installation diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 2c1a962ea632..baeda777ae8b 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -117,7 +117,6 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.1' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - implementation 'org.threeten:threetenbp:1.4.3' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'junit:junit:4.13.1' testImplementation 'org.mockito:mockito-core:3.11.2' diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index 3c38b6153588..be21127f29a4 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -18,7 +18,6 @@ lazy val root = (project in file(".")). "javax.ws.rs" % "javax.ws.rs-api" % "2.0", "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", - "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index 71729a41614a..5670deeaee4a 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -290,11 +290,6 @@ commons-lang3 ${commons-lang3-version} - - org.threeten - threetenbp - ${threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -340,7 +335,6 @@ 2.8.8 3.12.0 0.2.2 - 1.5.0 1.3.5 4.13.2 UTF-8 diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index 0336656f5c42..d745edd6e62b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -21,9 +21,6 @@ import okio.Buffer; import okio.BufferedSink; import okio.Okio; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; import org.apache.oltu.oauth2.common.message.types.GrantType; @@ -46,6 +43,9 @@ import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index a4a6807e3781..5c6bc189f483 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -23,9 +23,6 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import okio.ByteString; @@ -35,6 +32,9 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 90c0357a07be..bb8297664059 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -32,8 +32,8 @@ import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; import org.openapitools.client.model.User; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index 1c82fdd82188..b96e2b3207a3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,7 +27,7 @@ import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index d5f4dc14d804..35bd22027afa 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -95,7 +95,7 @@ public AdditionalPropertiesClass mapProperty(Map mapProperty) { public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { if (this.mapProperty == null) { - this.mapProperty = new HashMap(); + this.mapProperty = new HashMap<>(); } this.mapProperty.put(key, mapPropertyItem); return this; @@ -126,7 +126,7 @@ public AdditionalPropertiesClass mapOfMapProperty(Map mapOfMapPropertyItem) { if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; @@ -226,7 +226,7 @@ public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(Map(); + this.mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); } this.mapWithUndeclaredPropertiesAnytype3.put(key, mapWithUndeclaredPropertiesAnytype3Item); return this; @@ -280,7 +280,7 @@ public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(Map(); + this.mapWithUndeclaredPropertiesString = new HashMap<>(); } this.mapWithUndeclaredPropertiesString.put(key, mapWithUndeclaredPropertiesStringItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index d375bd8a4886..40c2a19a6c0c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -66,7 +66,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9ec157ed1515..b8f1be5d4d11 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -66,7 +66,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java index 66d23d236a84..cd1ee2ed678a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -74,7 +74,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -105,7 +105,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -136,7 +136,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java index 793d088bad2b..74ed8a4be3dd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java @@ -153,7 +153,7 @@ public Drawing shapes(List shapes) { public Drawing addShapesItem(Shape shapesItem) { if (this.shapes == null) { - this.shapes = new ArrayList(); + this.shapes = new ArrayList<>(); } this.shapes.add(shapesItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java index 6b64ece26660..d57daf844078 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -186,7 +186,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4bb4e340969d..f4bbc48032a3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -93,7 +93,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java index 48923c990846..4db725665f90 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -25,9 +25,9 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java index 51fb198904fe..a10df19d5ad5 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java @@ -125,7 +125,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -156,7 +156,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -187,7 +187,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -218,7 +218,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd9f59adbb8..99dd61c8a00d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,12 +23,12 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -123,7 +123,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java index cd29b3cb2ee2..487938d61871 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java @@ -24,13 +24,13 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -253,7 +253,7 @@ public NullableClass arrayNullableProp(List arrayNullableProp) { public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { if (this.arrayNullableProp == null) { - this.arrayNullableProp = new ArrayList(); + this.arrayNullableProp = new ArrayList<>(); } this.arrayNullableProp.add(arrayNullablePropItem); return this; @@ -284,7 +284,7 @@ public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullabl public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { if (this.arrayAndItemsNullableProp == null) { - this.arrayAndItemsNullableProp = new ArrayList(); + this.arrayAndItemsNullableProp = new ArrayList<>(); } this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); return this; @@ -315,7 +315,7 @@ public NullableClass arrayItemsNullable(List arrayItemsNullable) { public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { if (this.arrayItemsNullable == null) { - this.arrayItemsNullable = new ArrayList(); + this.arrayItemsNullable = new ArrayList<>(); } this.arrayItemsNullable.add(arrayItemsNullableItem); return this; @@ -346,7 +346,7 @@ public NullableClass objectNullableProp(Map objectNullableProp) public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { if (this.objectNullableProp == null) { - this.objectNullableProp = new HashMap(); + this.objectNullableProp = new HashMap<>(); } this.objectNullableProp.put(key, objectNullablePropItem); return this; @@ -377,7 +377,7 @@ public NullableClass objectAndItemsNullableProp(Map objectAndIte public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { if (this.objectAndItemsNullableProp == null) { - this.objectAndItemsNullableProp = new HashMap(); + this.objectAndItemsNullableProp = new HashMap<>(); } this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); return this; @@ -408,7 +408,7 @@ public NullableClass objectItemsNullable(Map objectItemsNullable public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { if (this.objectItemsNullable == null) { - this.objectItemsNullable = new HashMap(); + this.objectItemsNullable = new HashMap<>(); } this.objectItemsNullable.put(key, objectItemsNullableItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 773a079fe4fa..57cb79304637 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -152,7 +152,7 @@ public ObjectWithDeprecatedFields bars(List bars) { public ObjectWithDeprecatedFields addBarsItem(String barsItem) { if (this.bars == null) { - this.bars = new ArrayList(); + this.bars = new ArrayList<>(); } this.bars.add(barsItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java index 82d8a256c0b1..a2ed7e9b20fa 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java @@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java index 5d2d5688cb3c..d9cdea6f67cc 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -66,7 +66,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -233,7 +233,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java index c7c647842d31..41fdc9de03e6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java @@ -66,11 +66,11 @@ public class PetWithRequiredTags { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList(); + private List tags = new ArrayList<>(); /** * pet status in the store diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java index 9d56087899b3..ab06507b40d4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java @@ -10,6 +10,11 @@ import java.nio.charset.StandardCharsets; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.time.format.DateTimeFormatter; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.ZoneOffset; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; @@ -18,11 +23,6 @@ import okio.ByteString; import org.junit.*; import org.openapitools.client.model.Order; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.format.DateTimeFormatter; import org.openapitools.client.model.*; @@ -142,7 +142,7 @@ public void testLocalDateTypeAdapter() { public void testDefaultDate() throws Exception { final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; final String dateStr = "2015-11-07T14:11:05.267Z"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); + order.setShipDate(OffsetDateTime.from(datetimeFormat.parse(dateStr))); String str = json.serialize(order); Type type = new TypeToken() {}.getType(); @@ -155,7 +155,7 @@ public void testCustomDate() throws Exception { final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); final String dateStr = "2015-11-07T14:11:05-02:00"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); + order.setShipDate(OffsetDateTime.from(datetimeFormat.parse(dateStr))); String str = json.serialize(order); Type type = new TypeToken() {}.getType(); diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java index 471887d2611e..1f30e84453cf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,9 +17,10 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; import org.openapitools.client.model.User; @@ -128,6 +129,21 @@ public void getArrayOfEnumsTest() throws ApiException { // TODO: test validations } + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws ApiException { + FileSchemaTestClass fileSchemaTestClass = null; + api.testBodyWithFileSchema(fileSchemaTestClass); + // TODO: test validations + } + /** * * diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java index 6d3c5e1c2a82..cd995e7fa052 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -24,8 +24,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 808773a5d852..8f5b70d27fea 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -26,7 +26,6 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NullableClassTest.java index 74c390c8a664..3d13b21e707e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -27,8 +27,6 @@ import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java index b5cc55e4f581..2e0171dac8af 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/OrderTest.java @@ -21,7 +21,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/JacksonObjectMapper.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/JacksonObjectMapper.java index f6ea587ad2e0..333098260522 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/JacksonObjectMapper.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/JacksonObjectMapper.java @@ -49,4 +49,4 @@ private static Jackson2ObjectMapperFactory createFactory() { public static JacksonObjectMapper jackson() { return new JacksonObjectMapper(); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/build.gradle b/samples/client/petstore/java/rest-assured/build.gradle index 2c13b6f32cb7..4cd43a6e7b70 100644 --- a/samples/client/petstore/java/rest-assured/build.gradle +++ b/samples/client/petstore/java/rest-assured/build.gradle @@ -102,7 +102,6 @@ ext { junit_version = "4.13.1" gson_version = "2.8.6" gson_fire_version = "1.8.4" - threetenbp_version = "1.4.3" okio_version = "1.17.5" } @@ -112,7 +111,6 @@ dependencies { implementation "io.rest-assured:rest-assured:$rest_assured_version" implementation "io.gsonfire:gson-fire:$gson_fire_version" implementation 'com.google.code.gson:gson:$gson_version' - implementation "org.threeten:threetenbp:$threetenbp_version" implementation "com.squareup.okio:okio:$okio_version" implementation "jakarta.validation:jakarta.validation-api:2.0.2" implementation "org.hibernate:hibernate-validator:6.0.19.Final" diff --git a/samples/client/petstore/java/rest-assured/build.sbt b/samples/client/petstore/java/rest-assured/build.sbt index 9fe390caca5f..4f801c50ff54 100644 --- a/samples/client/petstore/java/rest-assured/build.sbt +++ b/samples/client/petstore/java/rest-assured/build.sbt @@ -15,7 +15,6 @@ lazy val root = (project in file(".")). "com.google.code.findbugs" % "jsr305" % "3.0.2", "com.google.code.gson" % "gson" % "2.8.6", "io.gsonfire" % "gson-fire" % "1.8.4" % "compile", - "org.threeten" % "threetenbp" % "1.4.3" % "compile", "com.squareup.okio" % "okio" % "1.17.5" % "compile", "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", diff --git a/samples/client/petstore/java/rest-assured/pom.xml b/samples/client/petstore/java/rest-assured/pom.xml index 8a6b704adb0e..1e0f965d33cb 100644 --- a/samples/client/petstore/java/rest-assured/pom.xml +++ b/samples/client/petstore/java/rest-assured/pom.xml @@ -226,11 +226,6 @@ gson ${gson-version} - - org.threeten - threetenbp - ${threetenbp-version} - io.gsonfire gson-fire @@ -268,7 +263,6 @@ 4.3.0 2.8.6 1.8.4 - 1.4.3 1.3.5 2.0.2 1.17.5 diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java index 274416e5dedc..edcc9eed5b95 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java @@ -23,9 +23,6 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import org.openapitools.client.model.*; import okio.ByteString; @@ -36,6 +33,9 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java index 574330f55e9b..f870a0f5aaa5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java @@ -18,8 +18,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java index c50c5ecb2a24..a3208f8a5b41 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java @@ -14,7 +14,7 @@ package org.openapitools.client.api; import com.google.gson.reflect.TypeToken; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index f9eef4cc8a92..61d3719165a6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -91,7 +91,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -122,7 +122,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -154,7 +154,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -185,7 +185,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -216,7 +216,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -248,7 +248,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -280,7 +280,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -312,7 +312,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index d64ee1c3d044..f6b21b232ebe 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -50,7 +50,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 054a5cc7d7b5..794697abc453 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -50,7 +50,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java index e31cd2b7e091..cd85842d0e6b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -58,7 +58,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -89,7 +89,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -121,7 +121,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java index 20963b543ad9..1b3644ddf5c1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -170,7 +170,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 34a9959b84fc..574c78efbb8d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -78,7 +78,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java index c00fe425ad6c..6844e8665a37 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java @@ -25,9 +25,9 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import javax.validation.constraints.*; import javax.validation.Valid; import org.hibernate.validator.constraints.*; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index 3927ebee5f80..e2ab0f1fb4d5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -109,7 +109,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -141,7 +141,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -172,7 +172,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -203,7 +203,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index c4d90ecc4291..63c9d6d9d58d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,12 +23,12 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import javax.validation.constraints.*; import javax.validation.Valid; import org.hibernate.validator.constraints.*; @@ -109,7 +109,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java index df8865dd0b72..4ad9a1cec535 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java @@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import javax.validation.constraints.*; import javax.validation.Valid; import org.hibernate.validator.constraints.*; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index 901f293dd1d9..254d6823ec3a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -52,7 +52,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -222,7 +222,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 36d491c78fa4..3fcc932d8e3a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -53,7 +53,7 @@ public class TypeHolderDefault { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 3e10b16870d3..d945f570f56b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -57,7 +57,7 @@ public class TypeHolderExample { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java index 4f37c48d2a01..9a42f393cdc8 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java @@ -255,7 +255,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -379,7 +379,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -410,7 +410,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -534,7 +534,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -565,7 +565,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -689,7 +689,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -720,7 +720,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -844,7 +844,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -875,7 +875,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java index 57aba781775f..a6b1698aece0 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,8 +17,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java index 32dbe0df5c15..9c600e488b5f 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -24,8 +24,8 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 808773a5d852..3a23e8217ba4 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java index b5cc55e4f581..8bad0b69dc3e 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java @@ -21,7 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/FILES b/samples/client/petstore/java/resteasy/.openapi-generator/FILES index a0828809b3d8..4f43b35a7380 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/FILES +++ b/samples/client/petstore/java/resteasy/.openapi-generator/FILES @@ -70,7 +70,6 @@ src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiException.java src/main/java/org/openapitools/client/Configuration.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/JSON.java src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/Pair.java diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java index f206e1a562f9..3f1e53a3741b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java @@ -23,7 +23,7 @@ import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 12383cdea06c..fde767b8e2fa 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -12,9 +12,9 @@ package org.openapitools.client; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index bc44d2e39908..d5d420a9852c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -11,8 +11,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java index 6c9ab56a94c2..e96a3b637417 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java @@ -7,7 +7,7 @@ import javax.ws.rs.core.GenericType; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index b75583565424..b2924cbe555f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -21,7 +21,6 @@ import java.util.Map; import java.util.List; - @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HttpBasicAuth implements Authentication { private String username; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java index 87ec77092d6b..cef5858fe18f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b6361509275f..a7abbab8c555 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java index 34dcbe2336d4..4fccc19338f1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java index 07f4a80a5b24..4731d235db33 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -18,8 +18,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.junit.Test; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FormatTestTest.java index 6081209ef19f..097984bdeac4 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -21,8 +21,8 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index c308aec0a94d..95cd93a316d7 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OrderTest.java index c2d3025a2643..d65ce716e13e 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES index 457cfb54d185..fc83fa09e36d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES @@ -68,7 +68,6 @@ pom.xml settings.gradle src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/RFC3339DateFormat.java src/main/java/org/openapitools/client/ServerConfiguration.java diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index 96a7e7dd4132..1afb4a27eb0d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -105,7 +105,6 @@ ext { spring_web_version = "5.2.5.RELEASE" jodatime_version = "2.9.9" junit_version = "4.13.1" - jackson_threeten_version = "2.9.10" } dependencies { @@ -119,7 +118,6 @@ dependencies { implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index a63c67fcf200..ea7f628b9151 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -137,8 +137,8 @@ maven-compiler-plugin 3.6.1 - 1.8 - 1.8 + 1.8 + 1.8 @@ -262,11 +262,6 @@ jackson-datatype-jsr310 ${jackson-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -290,7 +285,6 @@ 2.10.5.1 0.2.2 1.3.5 - 2.9.10 1.0.0 4.13.1 diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index 8e5e2933cec3..66552bc800ba 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -31,11 +31,6 @@ import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.DefaultUriBuilderFactory; -import org.threeten.bp.*; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; -import com.fasterxml.jackson.databind.ObjectMapper; import org.openapitools.jackson.nullable.JsonNullableModule; @@ -61,7 +56,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; - +import java.time.OffsetDateTime; import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; @@ -335,12 +330,6 @@ public DateFormat getDateFormat() { */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter) { - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - mapper.setDateFormat(dateFormat); - } - } return this; } @@ -755,17 +744,6 @@ protected RestTemplate buildRestTemplate() { RestTemplate restTemplate = new RestTemplate(messageConverters); - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter){ - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - mapper.registerModule(new JsonNullableModule()); - } - } // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); return restTemplate; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 12383cdea06c..fde767b8e2fa 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -12,9 +12,9 @@ package org.openapitools.client; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index 0d2c015de234..d82e43ff8754 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -6,8 +6,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java index 217e995d4a94..066744bc489e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ import org.openapitools.client.ApiClient; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.Collections; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index c6fa4aa7e6ea..76958400e15c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.dataformat.xml.annotation.*; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index a452e0b47fed..b6216d3eb007 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.dataformat.xml.annotation.*; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index 1d158746721f..ebbc0be0538d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.dataformat.xml.annotation.*; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/FakeApiTest.java index f633c1fae721..55eece2b2afc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,8 +17,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/FormatTestTest.java index 710501b51bd4..8088bdbd8610 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -22,8 +22,8 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f8a8c734baaf..688e6c69da58 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -24,7 +24,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/OrderTest.java index d24c8479f5d6..da63441c6597 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES index 457cfb54d185..fc83fa09e36d 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/FILES +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES @@ -68,7 +68,6 @@ pom.xml settings.gradle src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/RFC3339DateFormat.java src/main/java/org/openapitools/client/ServerConfiguration.java diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index b70d21521b50..98c362fb4d2c 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -105,7 +105,6 @@ ext { spring_web_version = "5.2.5.RELEASE" jodatime_version = "2.9.9" junit_version = "4.13.1" - jackson_threeten_version = "2.9.10" } dependencies { @@ -119,7 +118,6 @@ dependencies { implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index 7421690cdc9d..f93b1c31b3d7 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -137,8 +137,8 @@ maven-compiler-plugin 3.6.1 - 1.8 - 1.8 + 1.8 + 1.8 @@ -254,11 +254,6 @@ jackson-datatype-jsr310 ${jackson-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -282,7 +277,6 @@ 2.10.5.1 0.2.2 1.3.5 - 2.9.10 1.0.0 4.13.1 diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index 42d81a59578f..38f2d40c103a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -26,11 +26,6 @@ import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.DefaultUriBuilderFactory; -import org.threeten.bp.*; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; -import com.fasterxml.jackson.databind.ObjectMapper; import org.openapitools.jackson.nullable.JsonNullableModule; @@ -56,7 +51,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; - +import java.time.OffsetDateTime; import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; @@ -330,12 +325,6 @@ public DateFormat getDateFormat() { */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter) { - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - mapper.setDateFormat(dateFormat); - } - } return this; } @@ -742,17 +731,6 @@ private String buildCookieHeader(MultiValueMap cookies) { */ protected RestTemplate buildRestTemplate() { RestTemplate restTemplate = new RestTemplate(); - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter){ - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - mapper.registerModule(new JsonNullableModule()); - } - } // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); return restTemplate; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 12383cdea06c..fde767b8e2fa 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -12,9 +12,9 @@ package org.openapitools.client; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index 0d2c015de234..d82e43ff8754 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -6,8 +6,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java index 217e995d4a94..066744bc489e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ import org.openapitools.client.ApiClient; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.Collections; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index 87ec77092d6b..cef5858fe18f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b6361509275f..a7abbab8c555 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index 34dcbe2336d4..4fccc19338f1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/FakeApiTest.java index f633c1fae721..55eece2b2afc 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,8 +17,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/FormatTestTest.java index 710501b51bd4..8088bdbd8610 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -22,8 +22,8 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f8a8c734baaf..688e6c69da58 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -24,7 +24,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/OrderTest.java index d24c8479f5d6..da63441c6597 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index 0ea8f2fe7a90..e78adcf9fe85 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -106,7 +106,6 @@ ext { play_version = "2.6.7" swagger_annotations_version = "1.5.22" junit_version = "4.13.1" - threetenbp_version = "1.4.0" json_fire_version = "1.8.0" } @@ -120,7 +119,6 @@ dependencies { exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' } implementation "io.gsonfire:gson-fire:$json_fire_version" - implementation "org.threeten:threetenbp:$threetenbp_version" implementation "com.typesafe.play:play-ahc-ws_2.12:$play_version" implementation "jakarta.validation:jakarta.validation-api:2.0.2" implementation "com.squareup.retrofit2:converter-jackson:$retrofit_version" diff --git a/samples/client/petstore/java/retrofit2-play26/build.sbt b/samples/client/petstore/java/retrofit2-play26/build.sbt index 3b482330d1ea..5865ff862106 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.sbt +++ b/samples/client/petstore/java/retrofit2-play26/build.sbt @@ -19,7 +19,6 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "org.threeten" % "threetenbp" % "1.4.0" % "compile", "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.1" % "test", diff --git a/samples/client/petstore/java/retrofit2-play26/pom.xml b/samples/client/petstore/java/retrofit2-play26/pom.xml index b6c323b64163..d3b6bedc6e19 100644 --- a/samples/client/petstore/java/retrofit2-play26/pom.xml +++ b/samples/client/petstore/java/retrofit2-play26/pom.xml @@ -147,7 +147,7 @@ 3.1.1 none - 1.8 + 1.8 @@ -241,11 +241,6 @@ gson-fire ${gson-fire-version} - - org.threeten - threetenbp - ${threetenbp-version} - com.squareup.retrofit2 @@ -312,7 +307,6 @@ 2.6.7 0.2.2 2.5.0 - 1.4.0 1.3.5 2.0.2 1.0.1 diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index e87dcd696da0..6279aae50c8b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -13,8 +13,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java index 2aed903655bc..b3729f27abee 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java @@ -9,7 +9,7 @@ import okhttp3.ResponseBody; import okhttp3.MultipartBody; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java index cba5025fe7db..b70f44ff6354 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index dd9aad2dbb62..cc156a3c189a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java index 00a3983cf94a..03e9cc97199b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java index aec2e41c34e8..82a96b9818b3 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -5,8 +5,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.junit.Before; diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java index 6081209ef19f..097984bdeac4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -21,8 +21,8 @@ import java.io.File; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index c308aec0a94d..95cd93a316d7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java index c2d3025a2643..d65ce716e13e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index 8a5e2ab91c4c..81b1be643e4f 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -32,8 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } // Rename the aar correctly @@ -78,8 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 publishing { publications { @@ -101,7 +101,6 @@ ext { retrofit_version = "2.3.0" swagger_annotations_version = "1.5.22" junit_version = "4.13.1" - threetenbp_version = "1.4.0" json_fire_version = "1.8.0" } @@ -115,7 +114,6 @@ dependencies { exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' } implementation "io.gsonfire:gson-fire:$json_fire_version" - implementation "org.threeten:threetenbp:$threetenbp_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2/build.sbt b/samples/client/petstore/java/retrofit2/build.sbt index 10ac2d347a1a..d02a9f954734 100644 --- a/samples/client/petstore/java/retrofit2/build.sbt +++ b/samples/client/petstore/java/retrofit2/build.sbt @@ -14,7 +14,6 @@ lazy val root = (project in file(".")). "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "org.threeten" % "threetenbp" % "1.4.0" % "compile", "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.1" % "test", diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index aa4e1008af84..001f1189d296 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -137,8 +137,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -147,7 +147,7 @@ 3.1.1 none - 1.7 + 1.8 @@ -241,11 +241,6 @@ gson-fire ${gson-fire-version} - - org.threeten - threetenbp - ${threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -262,13 +257,12 @@ UTF-8 - 1.7 + 1.8 ${java.version} ${java.version} 1.8.3 1.6.3 2.5.0 - 1.4.0 1.3.5 1.0.1 4.13.1 diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ApiClient.java index de26a0f8b160..ae1e0d9476d3 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ApiClient.java @@ -9,7 +9,6 @@ import okhttp3.ResponseBody; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.threeten.bp.format.DateTimeFormatter; import retrofit2.Converter; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; @@ -25,6 +24,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; +import java.time.format.DateTimeFormatter; import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java index 21ee1d248f59..65ad4ef6f55d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java @@ -23,9 +23,6 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import org.openapitools.client.model.*; @@ -35,6 +32,9 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index 21149ceff116..033d6d3b7393 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -13,8 +13,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java index 55b998e696c7..02f041e675d2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java @@ -9,7 +9,7 @@ import okhttp3.ResponseBody; import okhttp3.MultipartBody; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 21db6cb109ff..36bee14604b0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -88,7 +88,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -119,7 +119,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -150,7 +150,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -181,7 +181,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -212,7 +212,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -243,7 +243,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -274,7 +274,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -305,7 +305,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 8c7d76947343..6f1d7613afd2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -47,7 +47,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2408d2577088..d8ab663ad868 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -47,7 +47,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java index 1c7469d68e08..dd8ac4f26798 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -55,7 +55,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -86,7 +86,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -117,7 +117,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java index 2b249f35495e..42fd0a61f6a8 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -167,7 +167,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4c0ebf716d9a..61acde71d80b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -74,7 +74,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java index 52900682b0f7..8f1c8ca978db 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -25,9 +25,9 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; /** * FormatTest diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java index cc0b38f6c4d8..260da3e477f9 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java @@ -106,7 +106,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -137,7 +137,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -168,7 +168,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -199,7 +199,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1c705d4b1ee4..c63ddd66e633 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,12 +23,12 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -104,7 +104,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java index 530f0eefd41a..73560da07a8a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java @@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; /** * Order diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java index 1c1c47105f9d..1664c5658d1a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java @@ -49,7 +49,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -216,7 +216,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f9fdaf50fe4c..2a5f0ab42dff 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -50,7 +50,7 @@ public class TypeHolderDefault { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index a19d60e90227..69c11bdd4615 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -54,7 +54,7 @@ public class TypeHolderExample { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java index 197aac987bc6..d13eb4c2202b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -251,7 +251,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -374,7 +374,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -405,7 +405,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -528,7 +528,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -559,7 +559,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -682,7 +682,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -713,7 +713,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -836,7 +836,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -867,7 +867,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java index aec2e41c34e8..eaff766c5d56 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -5,13 +5,13 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.junit.Before; import org.junit.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java index 4d5b377c0b4f..c6ffb82e15b5 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -24,8 +24,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 93829ac8d536..f9229a1a76b4 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -26,7 +26,6 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java index 808e365efb56..b97d88a4de21 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java @@ -21,7 +21,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2rx/pom.xml b/samples/client/petstore/java/retrofit2rx/pom.xml deleted file mode 100644 index d195f17ba588..000000000000 --- a/samples/client/petstore/java/retrofit2rx/pom.xml +++ /dev/null @@ -1,280 +0,0 @@ - - 4.0.0 - org.openapitools - petstore-retrofit2-rx - jar - petstore-retrofit2-rx - 1.0.0 - https://github.com/openapitools/openapi-generator - OpenAPI Java - - scm:git:git@github.com:openapitools/openapi-generator.git - scm:git:git@github.com:openapitools/openapi-generator.git - https://github.com/openapitools/openapi-generator - - - - - Unlicense - https://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - OpenAPI-Generator Contributors - team@openapitools.org - OpenAPITools.org - http://openapitools.org - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.1.1 - - none - 1.7 - - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.squareup.retrofit2 - converter-gson - ${retrofit-version} - - - com.squareup.retrofit2 - retrofit - ${retrofit-version} - - - com.squareup.retrofit2 - converter-scalars - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - org.apache.oltu.oauth2 - common - - - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - org.threeten - threetenbp - ${threetenbp-version} - - - io.reactivex - rxjava - ${rxjava-version} - - - com.squareup.retrofit2 - adapter-rxjava - ${retrofit-version} - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.7 - ${java.version} - ${java.version} - 1.8.3 - 1.5.22 - 2.5.0 - 1.3.0 - 1.4.0 - 1.0.1 - 4.13 - - diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 3fe39eddae0f..cf00597d3ad7 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -32,8 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } // Rename the aar correctly @@ -78,8 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 publishing { publications { @@ -102,7 +102,6 @@ ext { swagger_annotations_version = "1.5.22" junit_version = "4.13.1" rx_java_version = "2.1.1" - threetenbp_version = "1.4.0" json_fire_version = "1.8.0" } @@ -118,7 +117,6 @@ dependencies { exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' } implementation "io.gsonfire:gson-fire:$json_fire_version" - implementation "org.threeten:threetenbp:$threetenbp_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2rx2/build.sbt b/samples/client/petstore/java/retrofit2rx2/build.sbt index 63064b30ddfd..15343f5f501c 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.sbt +++ b/samples/client/petstore/java/retrofit2rx2/build.sbt @@ -16,7 +16,6 @@ lazy val root = (project in file(".")). "io.reactivex.rxjava2" % "rxjava" % "2.1.1" % "compile", "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "org.threeten" % "threetenbp" % "1.4.0" % "compile", "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.1" % "test", diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index ef8ef477ff04..529dfbe0e99e 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -137,8 +137,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -147,7 +147,7 @@ 3.1.1 none - 1.7 + 1.8 @@ -241,11 +241,6 @@ gson-fire ${gson-fire-version} - - org.threeten - threetenbp - ${threetenbp-version} - io.reactivex.rxjava2 rxjava @@ -272,14 +267,13 @@ UTF-8 - 1.7 + 1.8 ${java.version} ${java.version} 1.8.3 1.6.3 2.5.0 2.1.1 - 1.4.0 1.3.5 1.0.1 4.13.1 diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ApiClient.java index efcfe90bc964..6077194ccee1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ApiClient.java @@ -9,7 +9,6 @@ import okhttp3.ResponseBody; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.threeten.bp.format.DateTimeFormatter; import retrofit2.Converter; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; @@ -26,6 +25,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; +import java.time.format.DateTimeFormatter; import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java index 21ee1d248f59..65ad4ef6f55d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java @@ -23,9 +23,6 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import org.openapitools.client.model.*; @@ -35,6 +32,9 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index 2732fb61f517..c6c66d3764b0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -14,8 +14,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java index f0f9bfc01f5f..6bbb058dc173 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java @@ -10,7 +10,7 @@ import okhttp3.ResponseBody; import okhttp3.MultipartBody; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 21db6cb109ff..36bee14604b0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -88,7 +88,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -119,7 +119,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -150,7 +150,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -181,7 +181,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -212,7 +212,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -243,7 +243,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -274,7 +274,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -305,7 +305,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 8c7d76947343..6f1d7613afd2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -47,7 +47,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2408d2577088..d8ab663ad868 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -47,7 +47,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java index 1c7469d68e08..dd8ac4f26798 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -55,7 +55,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -86,7 +86,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -117,7 +117,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java index 2b249f35495e..42fd0a61f6a8 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -167,7 +167,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4c0ebf716d9a..61acde71d80b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -74,7 +74,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java index 52900682b0f7..8f1c8ca978db 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -25,9 +25,9 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; /** * FormatTest diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java index cc0b38f6c4d8..260da3e477f9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java @@ -106,7 +106,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -137,7 +137,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -168,7 +168,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -199,7 +199,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1c705d4b1ee4..c63ddd66e633 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,12 +23,12 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -104,7 +104,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java index 530f0eefd41a..73560da07a8a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java @@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; /** * Order diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java index 1c1c47105f9d..1664c5658d1a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java @@ -49,7 +49,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -216,7 +216,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f9fdaf50fe4c..2a5f0ab42dff 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -50,7 +50,7 @@ public class TypeHolderDefault { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index a19d60e90227..69c11bdd4615 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -54,7 +54,7 @@ public class TypeHolderExample { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java index 197aac987bc6..d13eb4c2202b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -251,7 +251,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -374,7 +374,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -405,7 +405,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -528,7 +528,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -559,7 +559,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -682,7 +682,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -713,7 +713,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -836,7 +836,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -867,7 +867,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java index aec2e41c34e8..82a96b9818b3 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -5,8 +5,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.junit.Before; diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java index 4d5b377c0b4f..324f11ac4580 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -24,8 +24,8 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 93829ac8d536..af2d1b2db303 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java index 808e365efb56..266bb3290d5f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java @@ -21,7 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2rx3/build.gradle b/samples/client/petstore/java/retrofit2rx3/build.gradle index c1ed0c63156e..745fe5e47f77 100644 --- a/samples/client/petstore/java/retrofit2rx3/build.gradle +++ b/samples/client/petstore/java/retrofit2rx3/build.gradle @@ -32,8 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } // Rename the aar correctly @@ -78,8 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 publishing { publications { @@ -102,7 +102,6 @@ ext { swagger_annotations_version = "1.5.22" junit_version = "4.13.1" rx_java_version = "3.0.4" - threetenbp_version = "1.4.0" json_fire_version = "1.8.0" } @@ -118,7 +117,6 @@ dependencies { exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' } implementation "io.gsonfire:gson-fire:$json_fire_version" - implementation "org.threeten:threetenbp:$threetenbp_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2rx3/build.sbt b/samples/client/petstore/java/retrofit2rx3/build.sbt index a5a113fd9dc4..54fce745d72b 100644 --- a/samples/client/petstore/java/retrofit2rx3/build.sbt +++ b/samples/client/petstore/java/retrofit2rx3/build.sbt @@ -16,7 +16,6 @@ lazy val root = (project in file(".")). "io.reactivex.rxjava3" % "rxjava" % "3.0.4" % "compile", "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "org.threeten" % "threetenbp" % "1.4.0" % "compile", "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.1" % "test", diff --git a/samples/client/petstore/java/retrofit2rx3/pom.xml b/samples/client/petstore/java/retrofit2rx3/pom.xml index 2eefb1398853..e52efacdda22 100644 --- a/samples/client/petstore/java/retrofit2rx3/pom.xml +++ b/samples/client/petstore/java/retrofit2rx3/pom.xml @@ -137,8 +137,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -147,7 +147,7 @@ 3.1.1 none - 1.7 + 1.8 @@ -241,11 +241,6 @@ gson-fire ${gson-fire-version} - - org.threeten - threetenbp - ${threetenbp-version} - io.reactivex.rxjava3 rxjava @@ -272,14 +267,13 @@ UTF-8 - 1.7 + 1.8 ${java.version} ${java.version} 1.8.3 1.6.3 2.5.0 3.0.4 - 1.4.0 1.3.5 1.0.1 4.13.1 diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ApiClient.java index b9237129593c..404a311e73f8 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ApiClient.java @@ -9,7 +9,6 @@ import okhttp3.ResponseBody; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.threeten.bp.format.DateTimeFormatter; import retrofit2.Converter; import retrofit2.Retrofit; import hu.akarnokd.rxjava3.retrofit.RxJava3CallAdapterFactory; @@ -26,6 +25,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; +import java.time.format.DateTimeFormatter; import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/JSON.java index 21ee1d248f59..65ad4ef6f55d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/JSON.java @@ -23,9 +23,6 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; import org.openapitools.client.model.*; @@ -35,6 +32,9 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeApi.java index dcd343c7b3a2..2d388c9b7f2f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -14,8 +14,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java index 00839a720e47..e3962148376c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java @@ -10,7 +10,7 @@ import okhttp3.ResponseBody; import okhttp3.MultipartBody; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 21db6cb109ff..36bee14604b0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -88,7 +88,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -119,7 +119,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -150,7 +150,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -181,7 +181,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -212,7 +212,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -243,7 +243,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -274,7 +274,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -305,7 +305,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 8c7d76947343..6f1d7613afd2 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -47,7 +47,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2408d2577088..d8ab663ad868 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -47,7 +47,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java index 1c7469d68e08..dd8ac4f26798 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -55,7 +55,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -86,7 +86,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -117,7 +117,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java index 2b249f35495e..42fd0a61f6a8 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -167,7 +167,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4c0ebf716d9a..61acde71d80b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -74,7 +74,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java index 52900682b0f7..8f1c8ca978db 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -25,9 +25,9 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; /** * FormatTest diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java index cc0b38f6c4d8..260da3e477f9 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java @@ -106,7 +106,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -137,7 +137,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -168,7 +168,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -199,7 +199,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1c705d4b1ee4..c63ddd66e633 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,12 +23,12 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -104,7 +104,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java index 530f0eefd41a..73560da07a8a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java @@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; /** * Order diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java index 1c1c47105f9d..1664c5658d1a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java @@ -49,7 +49,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -216,7 +216,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f9fdaf50fe4c..2a5f0ab42dff 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -50,7 +50,7 @@ public class TypeHolderDefault { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java index a19d60e90227..69c11bdd4615 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -54,7 +54,7 @@ public class TypeHolderExample { public static final String SERIALIZED_NAME_ARRAY_ITEM = "array_item"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample() { } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java index 197aac987bc6..d13eb4c2202b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java @@ -251,7 +251,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -374,7 +374,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -405,7 +405,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -528,7 +528,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -559,7 +559,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -682,7 +682,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -713,7 +713,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -836,7 +836,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -867,7 +867,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java index 69ae2c9fc5f4..a18414831d45 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -5,8 +5,8 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java index 32dbe0df5c15..9c600e488b5f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -24,8 +24,8 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 808773a5d852..3a23e8217ba4 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java index b5cc55e4f581..8bad0b69dc3e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java @@ -21,7 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/FILES b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/FILES index a1f2be808133..71b0a60e2803 100644 --- a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/FILES +++ b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/FILES @@ -70,7 +70,6 @@ src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiException.java src/main/java/org/openapitools/client/Configuration.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/Pair.java src/main/java/org/openapitools/client/RFC3339DateFormat.java diff --git a/samples/client/petstore/java/vertx-no-nullable/build.gradle b/samples/client/petstore/java/vertx-no-nullable/build.gradle index 220dccd2c311..214821c88741 100644 --- a/samples/client/petstore/java/vertx-no-nullable/build.gradle +++ b/samples/client/petstore/java/vertx-no-nullable/build.gradle @@ -35,7 +35,6 @@ ext { vertx_version = "3.4.2" junit_version = "4.13.1" jakarta_annotation_version = "1.3.5" - jackson_threeten_version = "2.9.10" } dependencies { @@ -47,7 +46,6 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:jackson_threeten_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" testImplementation "io.vertx:vertx-unit:$vertx_version" diff --git a/samples/client/petstore/java/vertx-no-nullable/pom.xml b/samples/client/petstore/java/vertx-no-nullable/pom.xml index c7c3a930c979..da1fa32648fc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/pom.xml +++ b/samples/client/petstore/java/vertx-no-nullable/pom.xml @@ -147,7 +147,7 @@ 3.1.1 none - 1.8 + 1.8 @@ -245,11 +245,6 @@ jackson-datatype-jsr310 ${jackson-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 - jakarta.annotation jakarta.annotation-api diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java index 1e69483c20f5..10f7d1935d0b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java @@ -28,7 +28,7 @@ import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import java.text.DateFormat; import java.util.*; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 12383cdea06c..fde767b8e2fa 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -12,9 +12,9 @@ package org.openapitools.client; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/FakeApi.java index 4f13a18d585e..2a30781bdad8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/FakeApi.java @@ -5,8 +5,8 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/FakeApiImpl.java index 613b901f354c..4383f3537d59 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -4,8 +4,8 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java index 5d55c6aa266d..b7922264c5c4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,7 +1,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java index 3e39564dd286..592748032b6f 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java @@ -1,6 +1,6 @@ package org.openapitools.client.api; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java index dc267344c6c9..a7388f52cd83 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java @@ -4,8 +4,8 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java index 466c016abc08..6ed5725ec837 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java @@ -1,6 +1,6 @@ package org.openapitools.client.api.rxjava; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index fb9fdfe8bfac..22fc2aa19c6c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -24,9 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b6361509275f..a7abbab8c555 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,12 +22,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java index 34dcbe2336d4..4fccc19338f1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java index 65a01b904dbd..b907b722c290 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -16,8 +16,8 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java index 4b89e54f56ae..0e626ca0f440 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,8 +23,8 @@ import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index bda97ddf91da..ea6eee23f882 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -25,7 +25,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java index 16a95b2e5d41..007f1aaea8a1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index 5c152ae84fb0..4b98e2c6ca92 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -147,7 +147,7 @@ 3.1.1 none - 1.8 + 1.8 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/FILES b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/FILES index 20afa0c232d4..6277d88f5ab6 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/FILES +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/FILES @@ -18,7 +18,6 @@ src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiException.java src/main/java/org/openapitools/client/ApiResponse.java src/main/java/org/openapitools/client/Configuration.java -src/main/java/org/openapitools/client/CustomInstantDeserializer.java src/main/java/org/openapitools/client/JSON.java src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/Pair.java diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/README.md index c16d0a5f2fb7..147549882a0f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/README.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/README.md @@ -13,7 +13,7 @@ This specification shows how to use x-auth-id-alias extension for API keys. Building the API client library requires: -1. Java 1.7+ +1. Java 1.8+ 2. Maven (3.8.3+)/Gradle (7.2+) ## Installation diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle index 58eba25952ed..60dbc5c1ad09 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle @@ -33,8 +33,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } // Rename the aar correctly @@ -78,8 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 publishing { publications { @@ -105,7 +105,6 @@ ext { jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" - threetenbp_version = "2.9.10" } dependencies { @@ -120,8 +119,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - implementation "com.brsanthu:migbase64:2.2" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt index 90ede61e7a78..3cfb74edc016 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt @@ -19,9 +19,8 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", - "com.brsanthu" % "migbase64" % "2.2", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml index bee91f771940..23cb38c9061e 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml @@ -312,11 +312,6 @@ jackson-datatype-jsr310 ${jackson-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -343,7 +338,6 @@ 2.13.0 2.13.0 0.2.2 - 2.9.10 1.3.5 4.13.2 2.17.3 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index e6bb7d3fad50..a6e3678186c0 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -47,7 +47,7 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Date; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import java.net.URLEncoder; diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/CustomInstantDeserializer.java deleted file mode 100644 index 83d4514b071b..000000000000 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java index f5874d83bf2c..3d6ba4c8e434 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -1,11 +1,10 @@ package org.openapitools.client; -import org.threeten.bp.*; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; import org.openapitools.jackson.nullable.JsonNullableModule; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import java.text.DateFormat; import java.util.HashMap; @@ -29,11 +28,7 @@ public JSON() { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); + mapper.registerModule(new JavaTimeModule()); JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JavaTimeFormatter.java index fdd6d4434ca2..0559ac98ab96 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -12,9 +12,9 @@ package org.openapitools.client; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index cdf367d2a505..f7ae20160d33 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -16,14 +16,13 @@ import org.openapitools.client.Pair; import org.openapitools.client.ApiException; -import com.migcomponents.migbase64.Base64; +import java.util.Base64; +import java.nio.charset.StandardCharsets; import java.net.URI; import java.util.Map; import java.util.List; -import java.io.UnsupportedEncodingException; - @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HttpBasicAuth implements Authentication { private String username; @@ -51,10 +50,6 @@ public void applyToParams(List queryParams, Map headerPara return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 7baabf8242a1..bcbc32d6595b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -23,7 +23,6 @@ import java.util.Map; import java.util.List; - @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HttpBasicAuth implements Authentication { private String username; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 13e6ca480d97..3ceda0bf3753 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -23,7 +23,6 @@ import java.util.Map; import java.util.List; - @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HttpBasicAuth implements Authentication { private String username; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES index 8dd51f71a270..6d8d3656155a 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -15,9 +15,7 @@ src/main/java/org/openapitools/api/StoreApi.java src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/JacksonConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index d6ebd909ee86..81e608be23ab 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -6,7 +6,7 @@ spring-boot-beanvalidation-no-nullable 1.0.0 - 1.7 + 1.8 ${java.version} ${java.version} 1.6.4 @@ -51,9 +51,8 @@ jackson-dataformat-yaml - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java index 8f6282c8d10f..f265e75c51b3 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java @@ -10,7 +10,6 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @SpringBootApplication @ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) @@ -39,7 +38,7 @@ public int getExitCode() { @Bean public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurerAdapter() { + return new WebMvcConfigurer() { /*@Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index f1a1b951814b..2e2c7056c5be 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -9,10 +9,10 @@ import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; +import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index 57fb48219922..ae87691bfb1f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -4,10 +4,10 @@ import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; +import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 2d35561243db..3d1a4822bb94 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -6,7 +6,7 @@ package org.openapitools.api; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index bf733026fd36..131788ef580d 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -1,7 +1,7 @@ package org.openapitools.api; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java deleted file mode 100644 index 8f936b311447..000000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index f28ec12951fd..85329fa9f21f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -71,7 +71,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -98,7 +98,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -125,7 +125,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -152,7 +152,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -179,7 +179,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -206,7 +206,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -233,7 +233,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -260,7 +260,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 0facaee5e606..5664a5b4e731 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -33,7 +33,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 1be9988fc5bc..cc83e1746d91 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -33,7 +33,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 52090b658b85..2ffb6eb34c83 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -41,7 +41,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -68,7 +68,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -95,7 +95,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index dabe3611437e..090f2f021bc0 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -125,7 +125,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8d27d598bb27..59e5a5e272cf 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -55,7 +55,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(File filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 9c2828613d9e..af0143fc04b0 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -6,11 +6,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index 81ec542f86bb..85b52ae042e9 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -81,7 +81,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -108,7 +108,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -135,7 +135,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -162,7 +162,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 704d5daf9615..9168e59da15f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -4,13 +4,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -82,7 +82,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index a69c5a43f4e8..5b3f52d439d7 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -5,8 +5,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 5192f3943c04..84ae9ca686cd 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -38,7 +38,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -148,7 +148,7 @@ public Pet photoUrls(Set photoUrls) { public Pet addPhotoUrlsItem(String photoUrlsItem) { if (this.photoUrls == null) { - this.photoUrls = new LinkedHashSet(); + this.photoUrls = new LinkedHashSet<>(); } this.photoUrls.add(photoUrlsItem); return this; @@ -176,7 +176,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 625823af85ea..f4b8dbb157b9 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -36,7 +36,7 @@ public class TypeHolderDefault { @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; @@ -121,7 +121,7 @@ public TypeHolderDefault arrayItem(List arrayItem) { public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList(); + this.arrayItem = new ArrayList<>(); } this.arrayItem.add(arrayItemItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index 90533252ffd8..ecce8e4fbccd 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -39,7 +39,7 @@ public class TypeHolderExample { @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; @@ -143,7 +143,7 @@ public TypeHolderExample arrayItem(List arrayItem) { public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList(); + this.arrayItem = new ArrayList<>(); } this.arrayItem.add(arrayItemItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index ac1c8c10e5dc..ab9f16947cde 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -201,7 +201,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -304,7 +304,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -331,7 +331,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -434,7 +434,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -461,7 +461,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -564,7 +564,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -591,7 +591,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -694,7 +694,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -721,7 +721,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java index 7caef40973ef..cb088f451935 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java @@ -11,7 +11,6 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @SpringBootApplication @ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) @@ -40,7 +39,7 @@ public int getExitCode() { @Bean public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurerAdapter() { + return new WebMvcConfigurer() { /*@Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java index 22b7ba48291b..935f3db6d63f 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java @@ -50,7 +50,7 @@ public class Pet { @JsonProperty("photoUrls") @JacksonXmlProperty(localName = "photoUrl") @Valid - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") @JacksonXmlProperty(localName = "tag") @@ -186,7 +186,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/java-inflector/.openapi-generator/FILES b/samples/server/petstore/java-inflector/.openapi-generator/FILES index be2f3fed2fad..fdb8efbe6b28 100644 --- a/samples/server/petstore/java-inflector/.openapi-generator/FILES +++ b/samples/server/petstore/java-inflector/.openapi-generator/FILES @@ -34,6 +34,8 @@ src/gen/java/org/openapitools/model/MapTest.java src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java src/gen/java/org/openapitools/model/Model200Response.java src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelFile.java +src/gen/java/org/openapitools/model/ModelList.java src/gen/java/org/openapitools/model/ModelReturn.java src/gen/java/org/openapitools/model/Name.java src/gen/java/org/openapitools/model/NumberOnly.java diff --git a/samples/server/petstore/java-inflector/.openapi-generator/VERSION b/samples/server/petstore/java-inflector/.openapi-generator/VERSION index d99e7162d01f..5f68295fc196 100644 --- a/samples/server/petstore/java-inflector/.openapi-generator/VERSION +++ b/samples/server/petstore/java-inflector/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-inflector/README.md b/samples/server/petstore/java-inflector/README.md index c1309670c5ad..924e49fe194d 100644 --- a/samples/server/petstore/java-inflector/README.md +++ b/samples/server/petstore/java-inflector/README.md @@ -5,4 +5,3 @@ Run with ``` mvn package jetty:run `` - diff --git a/samples/server/petstore/java-inflector/inflector.yaml b/samples/server/petstore/java-inflector/inflector.yaml index c75f4fce1858..b7d071b0c4e6 100644 --- a/samples/server/petstore/java-inflector/inflector.yaml +++ b/samples/server/petstore/java-inflector/inflector.yaml @@ -36,6 +36,8 @@ MapTest : org.openapitools.model.MapTest MixedPropertiesAndAdditionalPropertiesClass : org.openapitools.model.MixedPropertiesAndAdditionalPropertiesClass Model200Response : org.openapitools.model.Model200Response ModelApiResponse : org.openapitools.model.ModelApiResponse +ModelFile : org.openapitools.model.ModelFile +ModelList : org.openapitools.model.ModelList ModelReturn : org.openapitools.model.ModelReturn Name : org.openapitools.model.Name NumberOnly : org.openapitools.model.NumberOnly diff --git a/samples/server/petstore/java-inflector/pom.xml b/samples/server/petstore/java-inflector/pom.xml index 7330747f60e5..05b4f6391eff 100644 --- a/samples/server/petstore/java-inflector/pom.xml +++ b/samples/server/petstore/java-inflector/pom.xml @@ -25,6 +25,21 @@ target ${project.artifactId}-${project.version} + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + + + org.apache.maven.plugins maven-enforcer-plugin @@ -149,7 +164,7 @@ 9.2.9.v20150224 1.0.1 1.3.5 - 4.8.2 + 4.13.1 1.6.3 diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCatAllOf.java index eb3adc62b17f..b66babcdc5ee 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java index cd2a3722affd..2b7dfeb6e059 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java index 30d4e26d3b4a..b654fcedebba 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java index e698be80dc31..a183df292ef3 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 251301a930d7..231e04756dba 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import org.openapitools.model.ModelFile; @@ -15,31 +16,31 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen") public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file; + private ModelFile _file; @JsonProperty("files") - private List files = null; + private List files = null; /** **/ - public FileSchemaTestClass file(java.io.File file) { - this.file = file; + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; return this; } @ApiModelProperty(value = "") @JsonProperty("file") - public java.io.File getFile() { - return file; + public ModelFile getFile() { + return _file; } - public void setFile(java.io.File file) { - this.file = file; + public void setFile(ModelFile _file) { + this._file = _file; } /** **/ - public FileSchemaTestClass files(List files) { + public FileSchemaTestClass files(List files) { this.files = files; return this; } @@ -47,10 +48,10 @@ public FileSchemaTestClass files(List files) { @ApiModelProperty(value = "") @JsonProperty("files") - public List getFiles() { + public List getFiles() { return files; } - public void setFiles(List files) { + public void setFiles(List files) { this.files = files; } @@ -64,13 +65,13 @@ public boolean equals(Object o) { return false; } FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(file, fileSchemaTestClass.file) && + return Objects.equals(_file, fileSchemaTestClass._file) && Objects.equals(files, fileSchemaTestClass.files); } @Override public int hashCode() { - return Objects.hash(file, files); + return Objects.hash(_file, files); } @Override @@ -78,7 +79,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); sb.append(" files: ").append(toIndentedString(files)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java index f56eaf455f5e..0ba9970df741 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 9b6ec98bc9c3..7cd40575db2f 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java index 8d74040bad47..9941883c30be 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java index ad9e92e53376..62f6a501f1ac 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelFile.java new file mode 100644 index 000000000000..7073df37eaf5 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelFile.java @@ -0,0 +1,79 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + +/** + * Must be named `File` for test. + **/ + +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen") +public class ModelFile { + @JsonProperty("sourceURI") + private String sourceURI; + + /** + * Test capitalization + **/ + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + + @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") + public String getSourceURI() { + return sourceURI; + } + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelList.java new file mode 100644 index 000000000000..999c8b087bb8 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelList.java @@ -0,0 +1,75 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + + + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen") +public class ModelList { + @JsonProperty("123-list") + private String _123list; + + /** + **/ + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("123-list") + public String get123list() { + return _123list; + } + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(_123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java index 34afae577699..a470e947c815 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java index accf0f8d6a05..418e4f1e6923 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -29,7 +30,7 @@ public class Pet { private String name; @JsonProperty("photoUrls") - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") private List tags = null; @@ -134,6 +135,7 @@ public Pet photoUrls(Set photoUrls) { public Set getPhotoUrls() { return photoUrls; } + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java index 91054f48d802..b34b6dc259fe 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -3,6 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 79a35c9f5d5b..f7557955d241 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -28,7 +28,7 @@ public class TypeHolderDefault { private Boolean boolItem = true; @JsonProperty("array_item") - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java index 35b906bf80c0..5ce6daf8d028 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -31,7 +31,7 @@ public class TypeHolderExample { private Boolean boolItem; @JsonProperty("array_item") - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); /** **/ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java index 6ca09b073df4..0391e63f3b66 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java @@ -14,7 +14,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen") public class AnotherFakeController { - /** + /** * Uncomment and implement as you see fit. These operations will map * Directly to operation calls from the routing logic. Because the inflector * Code allows you to implement logic incrementally, they are disabled. @@ -27,4 +27,3 @@ public ResponseContext call123testSpecialTags(RequestContext request , Client bo */ } - diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java index 3e0defee0baf..84ba2a5b5768 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java @@ -14,7 +14,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen") public class FakeClassnameTestController { - /** + /** * Uncomment and implement as you see fit. These operations will map * Directly to operation calls from the routing logic. Because the inflector * Code allows you to implement logic incrementally, they are disabled. @@ -27,4 +27,3 @@ public ResponseContext testClassname(RequestContext request , Client body) { */ } - diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java index 4a02b3e5af36..d3be134a7bf4 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java @@ -23,7 +23,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen") public class FakeController { - /** + /** * Uncomment and implement as you see fit. These operations will map * Directly to operation calls from the routing logic. Because the inflector * Code allows you to implement logic incrementally, they are disabled. @@ -120,4 +120,3 @@ public ResponseContext uploadFileWithRequiredFile(RequestContext request , Long */ } - diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java index 67922658ed4d..bd5828a2ef49 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java @@ -17,7 +17,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen") public class PetController { - /** + /** * Uncomment and implement as you see fit. These operations will map * Directly to operation calls from the routing logic. Because the inflector * Code allows you to implement logic incrementally, they are disabled. @@ -72,4 +72,3 @@ public ResponseContext uploadFile(RequestContext request , Long petId, String ad */ } - diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java index bf3879199098..8e383b935cf3 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java @@ -15,7 +15,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen") public class StoreController { - /** + /** * Uncomment and implement as you see fit. These operations will map * Directly to operation calls from the routing logic. Because the inflector * Code allows you to implement logic incrementally, they are disabled. @@ -46,4 +46,3 @@ public ResponseContext placeOrder(RequestContext request , Order body) { */ } - diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java index 96afbf7964ff..1eb1c03a981a 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java @@ -10,12 +10,13 @@ import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen") public class UserController { - /** + /** * Uncomment and implement as you see fit. These operations will map * Directly to operation calls from the routing logic. Because the inflector * Code allows you to implement logic incrementally, they are disabled. @@ -70,4 +71,3 @@ public ResponseContext updateUser(RequestContext request , String username, User */ } - diff --git a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml index da8e574f0003..0c89ed214284 100644 --- a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -131,8 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -862,11 +862,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1144,8 +1144,8 @@ paths: x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1432,7 +1432,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1510,13 +1510,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,11 +1536,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: @@ -2184,3 +2187,4 @@ components: http_basic_test: scheme: basic type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java index a2625f7d89a2..22c3d0eed21b 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java @@ -53,7 +53,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -205,7 +205,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 23b2e2e9e622..027c1a059c78 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -55,7 +55,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -81,7 +81,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -107,7 +107,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -133,7 +133,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -159,7 +159,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -185,7 +185,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -211,7 +211,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -237,7 +237,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 0d1918e69b08..97fe7e6c1876 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -24,7 +24,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 653b2bf20156..ae571a3d2264 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -24,7 +24,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayTest.java index bac07348e18f..d16008230a2f 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayTest.java @@ -30,7 +30,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -56,7 +56,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -82,7 +82,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumArrays.java index 439dd9615b35..0fa1c622d1a3 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumArrays.java @@ -107,7 +107,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index a2a61f5f8f20..cd8b2ebb7a79 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -45,7 +45,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/MapTest.java index a47e2954a976..e125cd86e11a 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/MapTest.java @@ -65,7 +65,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -91,7 +91,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -117,7 +117,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -143,7 +143,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4e28308e41d2..10d5af73214d 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -69,7 +69,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java index 763058c7c847..865097fcdabc 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java @@ -29,7 +29,7 @@ public class Pet { private String name; @JsonProperty("photoUrls") - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") private List tags = null; @@ -155,7 +155,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 283a88d95991..5f2ce3356bfa 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -27,7 +27,7 @@ public class TypeHolderDefault { private Boolean boolItem = true; @JsonProperty("array_item") - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderExample.java index 7bbb66f3d8b2..a1d58394f6b4 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -30,7 +30,7 @@ public class TypeHolderExample { private Boolean boolItem; @JsonProperty("array_item") - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/XmlItem.java index bdd293d62d5d..bd878a2a8bcb 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/XmlItem.java @@ -180,7 +180,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -278,7 +278,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -304,7 +304,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -402,7 +402,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -428,7 +428,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -526,7 +526,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -552,7 +552,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -650,7 +650,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -676,7 +676,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/server/petstore/java-undertow/dependency-reduced-pom.xml b/samples/server/petstore/java-undertow/dependency-reduced-pom.xml index f86a92f3f0aa..42846129931c 100644 --- a/samples/server/petstore/java-undertow/dependency-reduced-pom.xml +++ b/samples/server/petstore/java-undertow/dependency-reduced-pom.xml @@ -16,6 +16,20 @@ target ${project.artifactId}-${project.version} + + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + + + maven-enforcer-plugin 3.0.0-M1 @@ -88,7 +102,7 @@ junit junit - 4.13 + 4.13.1 test @@ -100,32 +114,33 @@ org.apache.httpcomponents httpclient - 4.5.2 + 4.5.13 test - 4.1.2 - 2.9.10.4 - 2.2.0 - 1.10 - 3.1.2 - UTF-8 - 1.2 - 4.5.2 - 1.4.0.Final 0.5.2 - 2.6 + 2.2.0 + 4.5.13 + 1.2.0 1.8 - 2.9.10 - 0.1.1 + 4.13.1 1.5.10 - 2.1.0-beta.124 - 1.7.21 2.5 - 1.1.7 - 4.13 4.5.3 + 2.1.0-beta.124 + 3.1.2 + 2.6 + 1.3.5 + 0.1.1 + 2.10.5 + 4.1.2 + 2.1.6.Final + 1.7.21 + 2.10.5.1 + UTF-8 + 1.2 + 1.10 diff --git a/samples/server/petstore/java-undertow/pom.xml b/samples/server/petstore/java-undertow/pom.xml index 3e18815a1d13..eda5033ae546 100644 --- a/samples/server/petstore/java-undertow/pom.xml +++ b/samples/server/petstore/java-undertow/pom.xml @@ -34,6 +34,7 @@ 4.5.13 4.1.2 1.5.10 + 1.3.5 @@ -108,6 +109,11 @@ swagger-annotations ${version.swagger} + + jakarta.annotation + jakarta.annotation-api + ${version.annotation.api} + com.google.code.findbugs @@ -137,6 +143,21 @@ target ${project.artifactId}-${project.version} + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + + + org.apache.maven.plugins maven-enforcer-plugin diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java index 2837ebec20af..d23ea9785fd9 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java @@ -34,8 +34,8 @@ public class Pet { private Long id; private Category category; private String name; - private List photoUrls = new ArrayList(); - private List tags = new ArrayList(); + private List photoUrls = new ArrayList<>(); + private List tags = new ArrayList<>(); public enum StatusEnum { diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index 9643f632d71c..6323a4f8c0f0 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -176,7 +176,7 @@ com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-jaxrs-version} @@ -185,6 +185,11 @@ ${jakarta-annotation-version} provided + + joda-time + joda-time + 2.10.13 + @@ -196,7 +201,7 @@ - 1.7 + 1.8 ${java.version} ${java.version} 1.5.22 diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/Pet.java index 9f4defeaf74f..875d4e513ed6 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/Pet.java @@ -30,7 +30,7 @@ public class Pet { private String name; @ApiModelProperty(required = true, value = "") - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @ApiModelProperty(value = "") @Valid diff --git a/samples/server/petstore/jaxrs-cxf-cdi-default-value/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi-default-value/pom.xml index b85ec260a721..feca81c39db2 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi-default-value/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi-default-value/pom.xml @@ -12,6 +12,21 @@ src/main/java + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + + + org.codehaus.mojo @@ -92,7 +107,11 @@ ${beanvalidation-version} provided - + + joda-time + joda-time + 2.10.13 + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml index c2d476250e20..00f850a723e2 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml @@ -12,6 +12,21 @@ src/main/java + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + + + org.codehaus.mojo @@ -92,7 +107,11 @@ ${beanvalidation-version} provided - + + joda-time + joda-time + 2.10.13 + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Pet.java index e3a44d7fc395..acd246a87f08 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Pet.java @@ -27,7 +27,7 @@ public class Pet { private String name; - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); private List tags = null; @@ -163,7 +163,7 @@ public void setTags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml index 07106478d1f9..2144ac4a4b28 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -176,7 +176,7 @@ com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-jaxrs-version} @@ -185,6 +185,11 @@ ${jakarta-annotation-version} provided + + joda-time + joda-time + 2.10.13 + @@ -196,7 +201,7 @@ - 1.7 + 1.8 ${java.version} ${java.version} 1.5.22 diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/Pet.java index 9f4defeaf74f..875d4e513ed6 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/Pet.java @@ -30,7 +30,7 @@ public class Pet { private String name; @ApiModelProperty(required = true, value = "") - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @ApiModelProperty(value = "") @Valid diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 5f7076fa0c14..d5d58ce7743a 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -176,7 +176,7 @@ com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-jaxrs-version} @@ -185,6 +185,11 @@ ${jakarta-annotation-version} provided + + joda-time + joda-time + 2.10.13 + @@ -196,7 +201,7 @@ - 1.7 + 1.8 ${java.version} ${java.version} 1.5.22 diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java index 04bc408a7caa..743d3491a305 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java @@ -28,7 +28,7 @@ public class Pet { private String name; @ApiModelProperty(required = true, value = "") - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); @ApiModelProperty(value = "") @Valid diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 7a813e62d246..31931904fb27 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -25,7 +25,7 @@ public class TypeHolderDefault { private Boolean boolItem = true; @ApiModelProperty(required = true, value = "") - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); /** * Get stringItem * @return stringItem diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderExample.java index 3365957975d9..884227868060 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -28,7 +28,7 @@ public class TypeHolderExample { private Boolean boolItem; @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); /** * Get stringItem * @return stringItem diff --git a/samples/server/petstore/jaxrs-datelib-j8/pom.xml b/samples/server/petstore/jaxrs-datelib-j8/pom.xml index 9a6ef106bfe9..890b1e963709 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/pom.xml +++ b/samples/server/petstore/jaxrs-datelib-j8/pom.xml @@ -157,6 +157,17 @@ migbase64 2.2 + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.3 + + + com.sun.xml.bind + jaxb-impl + 2.3.3 + runtime + diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/JacksonJsonProvider.java index adf25aec2c69..fe8d07fcea40 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/JacksonJsonProvider.java @@ -26,4 +26,4 @@ public JacksonJsonProvider() { setMapper(objectMapper); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/jaxrs-jersey/pom.xml b/samples/server/petstore/jaxrs-jersey/pom.xml index 1f10526075de..e9d2c63c329d 100644 --- a/samples/server/petstore/jaxrs-jersey/pom.xml +++ b/samples/server/petstore/jaxrs-jersey/pom.xml @@ -143,7 +143,7 @@ com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-version} @@ -157,6 +157,17 @@ migbase64 2.2 + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.3 + + + com.sun.xml.bind + jaxb-impl + 2.3.3 + runtime + @@ -178,7 +189,7 @@ - 1.7 + 1.8 ${java.version} ${java.version} 1.5.18 diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/JacksonJsonProvider.java index d41d7a1e255d..fe8d07fcea40 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/JacksonJsonProvider.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.joda.*; +import com.fasterxml.jackson.datatype.jsr310.*; import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; @@ -21,9 +21,9 @@ public JacksonJsonProvider() { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .registerModule(new JodaModule()) + .registerModule(new JavaTimeModule()) .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 8c2ff2504c06..b977eddbc915 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -49,7 +49,7 @@ public AdditionalPropertiesClass mapProperty(Map mapProperty) { public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { if (this.mapProperty == null) { - this.mapProperty = new HashMap(); + this.mapProperty = new HashMap<>(); } this.mapProperty.put(key, mapPropertyItem); return this; @@ -77,7 +77,7 @@ public AdditionalPropertiesClass mapOfMapProperty(Map mapOfMapPropertyItem) { if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index d277c77993f3..593ba71954f3 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index f8b08e16723e..eaa207fee166 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java index fdde01afe2f5..5439e5e74fa8 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java @@ -54,7 +54,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -82,7 +82,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -110,7 +110,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java index 08e6db1ffc92..c44a2f70151c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java @@ -131,7 +131,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 3b94a5f7e59b..916f9a5b8817 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -69,7 +69,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java index 12516e0afba2..a744c0221d6e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java @@ -91,7 +91,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -119,7 +119,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -147,7 +147,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -175,7 +175,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index eb4fcd577811..0ed9488b276c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -97,7 +97,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java index f1f9e12b46ea..50077b523a35 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java @@ -222,7 +222,7 @@ public NullableClass arrayNullableProp(List arrayNullableProp) { public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { if (this.arrayNullableProp == null) { - this.arrayNullableProp = new ArrayList(); + this.arrayNullableProp = new ArrayList<>(); } this.arrayNullableProp.add(arrayNullablePropItem); return this; @@ -250,7 +250,7 @@ public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullabl public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { if (this.arrayAndItemsNullableProp == null) { - this.arrayAndItemsNullableProp = new ArrayList(); + this.arrayAndItemsNullableProp = new ArrayList<>(); } this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); return this; @@ -278,7 +278,7 @@ public NullableClass arrayItemsNullable(List arrayItemsNullable) { public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { if (this.arrayItemsNullable == null) { - this.arrayItemsNullable = new ArrayList(); + this.arrayItemsNullable = new ArrayList<>(); } this.arrayItemsNullable.add(arrayItemsNullableItem); return this; @@ -306,7 +306,7 @@ public NullableClass objectNullableProp(Map objectNullableProp) public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { if (this.objectNullableProp == null) { - this.objectNullableProp = new HashMap(); + this.objectNullableProp = new HashMap<>(); } this.objectNullableProp.put(key, objectNullablePropItem); return this; @@ -334,7 +334,7 @@ public NullableClass objectAndItemsNullableProp(Map objectAndIte public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { if (this.objectAndItemsNullableProp == null) { - this.objectAndItemsNullableProp = new HashMap(); + this.objectAndItemsNullableProp = new HashMap<>(); } this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); return this; @@ -362,7 +362,7 @@ public NullableClass objectItemsNullable(Map objectItemsNullable public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { if (this.objectItemsNullable == null) { - this.objectItemsNullable = new HashMap(); + this.objectItemsNullable = new HashMap<>(); } this.objectItemsNullable.put(key, objectItemsNullableItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java index d9c63ef46fde..a86dda302bdc 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java @@ -120,7 +120,7 @@ public ObjectWithDeprecatedFields bars(List bars) { public ObjectWithDeprecatedFields addBarsItem(String barsItem) { if (this.bars == null) { - this.bars = new ArrayList(); + this.bars = new ArrayList<>(); } this.bars.add(barsItem); return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java index 4c0d02c16b9e..257ce0ebe176 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java @@ -57,7 +57,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -193,7 +193,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/jaxrs-resteasy/default-value/pom.xml b/samples/server/petstore/jaxrs-resteasy/default-value/pom.xml index 928711e47ad4..247d82711edb 100644 --- a/samples/server/petstore/jaxrs-resteasy/default-value/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/default-value/pom.xml @@ -15,8 +15,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -126,17 +126,11 @@ ${jakarta-annotation-version} provided - com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-version} - - joda-time - joda-time - 2.7 - io.swagger swagger-jaxrs @@ -168,14 +162,18 @@ - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + + joda-time + joda-time + 2.10.13 + @@ -195,6 +193,6 @@ 4.13.1 4.0.4 1.3.5 - 2.0.2 + 2.0.2 diff --git a/samples/server/petstore/jaxrs-resteasy/default-value/src/gen/java/org/openapitools/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/default-value/src/gen/java/org/openapitools/api/JacksonConfig.java index 0505794e04e6..56feb995554f 100644 --- a/samples/server/petstore/jaxrs-resteasy/default-value/src/gen/java/org/openapitools/api/JacksonConfig.java +++ b/samples/server/petstore/jaxrs-resteasy/default-value/src/gen/java/org/openapitools/api/JacksonConfig.java @@ -1,14 +1,7 @@ package org.openapitools.api; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import com.fasterxml.jackson.datatype.joda.JodaModule; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.ISODateTimeFormat; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Provider; @@ -21,23 +14,7 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { objectMapper = new ObjectMapper() - .registerModule(new JodaModule() { - { - addSerializer(DateTime.class, new StdSerializer(DateTime.class) { - @Override - public void serialize(DateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { - jgen.writeString(ISODateTimeFormat.dateTimeNoMillis().print(value)); - } - }); - addSerializer(LocalDate.class, new StdSerializer(LocalDate.class) { - @Override - public void serialize(LocalDate value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { - jgen.writeString(ISODateTimeFormat.date().print(value)); - } - }); - - } - }) + .registerModule(new JavaTimeModule()) .setDateFormat(new RFC3339DateFormat()); } diff --git a/samples/server/petstore/jaxrs-resteasy/default/pom.xml b/samples/server/petstore/jaxrs-resteasy/default/pom.xml index 4e86fffb5d90..e418c16ca4fb 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/default/pom.xml @@ -15,8 +15,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -126,17 +126,11 @@ ${jakarta-annotation-version} provided - com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-version} - - joda-time - joda-time - 2.7 - io.swagger swagger-jaxrs @@ -168,14 +162,18 @@ - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + + joda-time + joda-time + 2.10.13 + @@ -195,6 +193,6 @@ 4.13.1 4.0.4 1.3.5 - 2.0.2 + 2.0.2 diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/JacksonConfig.java index 0505794e04e6..56feb995554f 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/JacksonConfig.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/JacksonConfig.java @@ -1,14 +1,7 @@ package org.openapitools.api; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import com.fasterxml.jackson.datatype.joda.JodaModule; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.ISODateTimeFormat; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Provider; @@ -21,23 +14,7 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { objectMapper = new ObjectMapper() - .registerModule(new JodaModule() { - { - addSerializer(DateTime.class, new StdSerializer(DateTime.class) { - @Override - public void serialize(DateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { - jgen.writeString(ISODateTimeFormat.dateTimeNoMillis().print(value)); - } - }); - addSerializer(LocalDate.class, new StdSerializer(LocalDate.class) { - @Override - public void serialize(LocalDate value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { - jgen.writeString(ISODateTimeFormat.date().print(value)); - } - }); - - } - }) + .registerModule(new JavaTimeModule()) .setDateFormat(new RFC3339DateFormat()); } diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java index a13e58d99dff..73788837d0f7 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java @@ -20,8 +20,8 @@ public class Pet { private Long id; private Category category; private String name; - private List photoUrls = new ArrayList(); - private List tags = new ArrayList(); + private List photoUrls = new ArrayList<>(); + private List tags = new ArrayList<>(); /** * pet status in the store diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml index 44b7c44fe092..0d5e18c889c1 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml @@ -152,7 +152,11 @@ jackson-datatype-jsr310 2.9.9 - + + joda-time + joda-time + 2.10.13 + @@ -170,7 +174,7 @@ 1.6.3 4.8.1 4.0.4 - 2.0.2 + 2.0.2 1.3.5 diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/JacksonConfig.java index 0f868bc9aea8..df4b25e98d95 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/JacksonConfig.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/JacksonConfig.java @@ -31,4 +31,4 @@ public JacksonConfig() throws Exception { public ObjectMapper getContext(Class objectType) { return objectMapper; } -} \ No newline at end of file +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle index 6b89e90c1e33..c55a26708d29 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle @@ -16,8 +16,7 @@ dependencies { providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' providedCompile 'jakarta.validation:jakarta.validation-api:2.0.2' - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.9' - compile 'joda-time:joda-time:2.7' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9' testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml index de6afb232c23..e61595f90b00 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml @@ -16,8 +16,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -147,17 +147,16 @@ ${beanvalidation-version} provided - - joda-time - joda-time - 2.7 - com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 2.9.9 - + + joda-time + joda-time + 2.10.13 + @@ -175,7 +174,7 @@ 1.6.3 4.8.1 4.0.4 - 2.0.2 + 2.0.2 1.3.5 diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/Pet.java index 57012bf986e0..ba7e8ffbaad1 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/Pet.java @@ -24,9 +24,9 @@ public class Pet { private String name; - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList(); + private List tags = new ArrayList<>(); /** * pet status in the store diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/JacksonConfig.java index 447694d63101..df4b25e98d95 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/JacksonConfig.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/JacksonConfig.java @@ -9,7 +9,7 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.joda.JodaModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; @Provider @Produces(MediaType.APPLICATION_JSON) @@ -22,7 +22,7 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { this.objectMapper = new ObjectMapper(); - this.objectMapper.registerModule(new JodaModule()); + this.objectMapper.registerModule(new JavaTimeModule()); // sample to convert any DateTime to readable timestamps //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); @@ -31,4 +31,4 @@ public JacksonConfig() throws Exception { public ObjectMapper getContext(Class objectType) { return objectMapper; } -} \ No newline at end of file +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle index 6b89e90c1e33..c55a26708d29 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle @@ -16,8 +16,7 @@ dependencies { providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' providedCompile 'jakarta.validation:jakarta.validation-api:2.0.2' - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.9' - compile 'joda-time:joda-time:2.7' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9' testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml index 336166cdf9ce..7fa2d0fb348a 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml @@ -16,8 +16,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -147,17 +147,16 @@ ${beanvalidation-version} provided - - joda-time - joda-time - 2.7 - com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 2.9.9 - + + joda-time + joda-time + 2.10.13 + @@ -175,7 +174,7 @@ 1.6.3 4.8.1 4.0.4 - 2.0.2 + 2.0.2 1.3.5 diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/Pet.java index 57012bf986e0..ba7e8ffbaad1 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/Pet.java @@ -24,9 +24,9 @@ public class Pet { private String name; - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList(); + private List tags = new ArrayList<>(); /** * pet status in the store diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/JacksonConfig.java index 447694d63101..df4b25e98d95 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/JacksonConfig.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/JacksonConfig.java @@ -9,7 +9,7 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.joda.JodaModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; @Provider @Produces(MediaType.APPLICATION_JSON) @@ -22,7 +22,7 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { this.objectMapper = new ObjectMapper(); - this.objectMapper.registerModule(new JodaModule()); + this.objectMapper.registerModule(new JavaTimeModule()); // sample to convert any DateTime to readable timestamps //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); @@ -31,4 +31,4 @@ public JacksonConfig() throws Exception { public ObjectMapper getContext(Class objectType) { return objectMapper; } -} \ No newline at end of file +} diff --git a/samples/server/petstore/jaxrs-resteasy/java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml index c2a4501fca02..63e71078f52f 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml @@ -126,7 +126,6 @@ ${jakarta-annotation-version} provided - com.fasterxml.jackson.datatype jackson-datatype-jsr310 @@ -163,14 +162,18 @@ - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + + joda-time + joda-time + 2.10.13 + @@ -190,6 +193,6 @@ 4.13.1 4.0.4 1.3.5 - 2.0.2 + 2.0.2 diff --git a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml index d31af2a492f4..ac994bef5798 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml @@ -15,8 +15,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -126,17 +126,11 @@ ${jakarta-annotation-version} provided - com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-version} - - joda-time - joda-time - 2.7 - io.swagger swagger-jaxrs @@ -168,14 +162,18 @@ - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + + joda-time + joda-time + 2.10.13 + @@ -195,6 +193,6 @@ 4.13.1 4.0.4 1.3.5 - 2.0.2 + 2.0.2 diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/JacksonConfig.java index 0505794e04e6..56feb995554f 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/JacksonConfig.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/JacksonConfig.java @@ -1,14 +1,7 @@ package org.openapitools.api; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import com.fasterxml.jackson.datatype.joda.JodaModule; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.ISODateTimeFormat; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Provider; @@ -21,23 +14,7 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { objectMapper = new ObjectMapper() - .registerModule(new JodaModule() { - { - addSerializer(DateTime.class, new StdSerializer(DateTime.class) { - @Override - public void serialize(DateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { - jgen.writeString(ISODateTimeFormat.dateTimeNoMillis().print(value)); - } - }); - addSerializer(LocalDate.class, new StdSerializer(LocalDate.class) { - @Override - public void serialize(LocalDate value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { - jgen.writeString(ISODateTimeFormat.date().print(value)); - } - }); - - } - }) + .registerModule(new JavaTimeModule()) .setDateFormat(new RFC3339DateFormat()); } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java index a13e58d99dff..73788837d0f7 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java @@ -20,8 +20,8 @@ public class Pet { private Long id; private Category category; private String name; - private List photoUrls = new ArrayList(); - private List tags = new ArrayList(); + private List photoUrls = new ArrayList<>(); + private List tags = new ArrayList<>(); /** * pet status in the store diff --git a/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION index 0984c4c1ad21..5f68295fc196 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION @@ -1 +1 @@ -5.4.0-SNAPSHOT \ No newline at end of file +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml index 65350cadeee5..21c3c3f588e4 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml @@ -44,15 +44,25 @@ provided - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + + joda-time + joda-time + ${joda-version} + + + javax.annotation + javax.annotation-api + ${javax.annotation-api-version} + io.swagger swagger-annotations @@ -80,9 +90,14 @@ + 1.8 + ${java.version} + ${java.version} 2.9.9 4.13.1 - 2.0.2 + 2.10.13 + 1.3.2 + 2.0.2 2.1.6 diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 61bec1b6ff49..d8256b29ea3d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -22,14 +22,14 @@ @JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesClass implements Serializable { - private @Valid Map mapString = new HashMap(); - private @Valid Map mapNumber = new HashMap(); - private @Valid Map mapInteger = new HashMap(); - private @Valid Map mapBoolean = new HashMap(); - private @Valid Map> mapArrayInteger = new HashMap>(); - private @Valid Map> mapArrayAnytype = new HashMap>(); - private @Valid Map> mapMapString = new HashMap>(); - private @Valid Map> mapMapAnytype = new HashMap>(); + private @Valid Map mapString = new HashMap<>(); + private @Valid Map mapNumber = new HashMap<>(); + private @Valid Map mapInteger = new HashMap<>(); + private @Valid Map mapBoolean = new HashMap<>(); + private @Valid Map> mapArrayInteger = new HashMap<>(); + private @Valid Map> mapArrayAnytype = new HashMap<>(); + private @Valid Map> mapMapString = new HashMap<>(); + private @Valid Map> mapMapAnytype = new HashMap<>(); private @Valid Object anytype1; private @Valid Object anytype2; private @Valid Object anytype3; @@ -55,6 +55,22 @@ public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap<>(); + } + + this.mapString.put(key, mapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { + if (mapStringItem != null && this.mapString != null) { + this.mapString.remove(mapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapNumber(Map mapNumber) { @@ -76,6 +92,22 @@ public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap<>(); + } + + this.mapNumber.put(key, mapNumberItem); + return this; + } + + public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { + if (mapNumberItem != null && this.mapNumber != null) { + this.mapNumber.remove(mapNumberItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapInteger(Map mapInteger) { @@ -97,6 +129,22 @@ public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap<>(); + } + + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { + if (mapIntegerItem != null && this.mapInteger != null) { + this.mapInteger.remove(mapIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { @@ -118,6 +166,22 @@ public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap<>(); + } + + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { + if (mapBooleanItem != null && this.mapBoolean != null) { + this.mapBoolean.remove(mapBooleanItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { @@ -139,6 +203,22 @@ public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap<>(); + } + + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { + if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { + this.mapArrayInteger.remove(mapArrayIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { @@ -160,6 +240,22 @@ public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap<>(); + } + + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { + if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { + this.mapArrayAnytype.remove(mapArrayAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapString(Map> mapMapString) { @@ -181,6 +277,22 @@ public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap<>(); + } + + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { + if (mapMapStringItem != null && this.mapMapString != null) { + this.mapMapString.remove(mapMapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { @@ -202,6 +314,22 @@ public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap<>(); + } + + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { + if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { + this.mapMapAnytype.remove(mapMapAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass anytype1(Object anytype1) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index cbca7de2f692..6e2646e4da08 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,7 +21,7 @@ @JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayOfArrayOfNumberOnly implements Serializable { - private @Valid List> arrayArrayNumber = new ArrayList>(); + private @Valid List> arrayArrayNumber = new ArrayList<>(); /** **/ @@ -44,6 +44,22 @@ public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + public ArrayOfArrayOfNumberOnly removeArrayArrayNumberItem(List arrayArrayNumberItem) { + if (arrayArrayNumberItem != null && this.arrayArrayNumber != null) { + this.arrayArrayNumber.remove(arrayArrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index ad7cc3db32ef..f2ab42410746 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,7 +21,7 @@ @JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayOfNumberOnly implements Serializable { - private @Valid List arrayNumber = new ArrayList(); + private @Valid List arrayNumber = new ArrayList<>(); /** **/ @@ -44,6 +44,22 @@ public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + + this.arrayNumber.add(arrayNumberItem); + return this; + } + + public ArrayOfNumberOnly removeArrayNumberItem(BigDecimal arrayNumberItem) { + if (arrayNumberItem != null && this.arrayNumber != null) { + this.arrayNumber.remove(arrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java index f2b7469f65c7..6f2fe46e0ccd 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,9 +21,9 @@ @JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayTest implements Serializable { - private @Valid List arrayOfString = new ArrayList(); - private @Valid List> arrayArrayOfInteger = new ArrayList>(); - private @Valid List> arrayArrayOfModel = new ArrayList>(); + private @Valid List arrayOfString = new ArrayList<>(); + private @Valid List> arrayArrayOfInteger = new ArrayList<>(); + private @Valid List> arrayArrayOfModel = new ArrayList<>(); /** **/ @@ -46,6 +46,22 @@ public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + public ArrayTest removeArrayOfStringItem(String arrayOfStringItem) { + if (arrayOfStringItem != null && this.arrayOfString != null) { + this.arrayOfString.remove(arrayOfStringItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { @@ -67,6 +83,22 @@ public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + public ArrayTest removeArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (arrayArrayOfIntegerItem != null && this.arrayArrayOfInteger != null) { + this.arrayArrayOfInteger.remove(arrayArrayOfIntegerItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { @@ -88,6 +120,22 @@ public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + public ArrayTest removeArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (arrayArrayOfModelItem != null && this.arrayArrayOfModel != null) { + this.arrayArrayOfModel.remove(arrayArrayOfModelItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCatAllOf.java index db6873590460..7ba1d7c23fcb 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java index b5d2587fe85e..2ed18a6de6c3 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java index 269faf93678e..6c7208fe19b8 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java index bf05c76fd9ee..502d24d9bce4 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java @@ -87,7 +87,7 @@ public static ArrayEnumEnum fromValue(String value) { } } - private @Valid List arrayEnum = new ArrayList(); + private @Valid List arrayEnum = new ArrayList<>(); /** **/ @@ -131,6 +131,22 @@ public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + + this.arrayEnum.add(arrayEnumItem); + return this; + } + + public EnumArrays removeArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (arrayEnumItem != null && this.arrayEnum != null) { + this.arrayEnum.remove(arrayEnumItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java index 34ec3b13e072..af7ac236efe4 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 05ff7b2ea246..f2ee479c5b9a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -22,7 +22,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class FileSchemaTestClass implements Serializable { private @Valid ModelFile _file; - private @Valid List files = new ArrayList(); + private @Valid List files = new ArrayList<>(); /** **/ @@ -66,6 +66,22 @@ public void setFiles(List files) { this.files = files; } + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + + this.files.add(filesItem); + return this; + } + + public FileSchemaTestClass removeFilesItem(ModelFile filesItem) { + if (filesItem != null && this.files != null) { + this.files.remove(filesItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java index bbb010c5ff19..c6b8753a4e66 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index db68308cdce3..49ca21e5a565 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java index f5c57914a905..8d5dece7fbba 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java @@ -21,7 +21,7 @@ @JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class MapTest implements Serializable { - private @Valid Map> mapMapOfString = new HashMap>(); + private @Valid Map> mapMapOfString = new HashMap<>(); public enum InnerEnum { @@ -55,9 +55,9 @@ public static InnerEnum fromValue(String value) { } } - private @Valid Map mapOfEnumString = new HashMap(); - private @Valid Map directMap = new HashMap(); - private @Valid Map indirectMap = new HashMap(); + private @Valid Map mapOfEnumString = new HashMap<>(); + private @Valid Map directMap = new HashMap<>(); + private @Valid Map indirectMap = new HashMap<>(); /** **/ @@ -80,6 +80,22 @@ public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { + if (mapMapOfStringItem != null && this.mapMapOfString != null) { + this.mapMapOfString.remove(mapMapOfStringItem); + } + + return this; + } /** **/ public MapTest mapOfEnumString(Map mapOfEnumString) { @@ -101,6 +117,22 @@ public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { + if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { + this.mapOfEnumString.remove(mapOfEnumStringItem); + } + + return this; + } /** **/ public MapTest directMap(Map directMap) { @@ -122,6 +154,22 @@ public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + + this.directMap.put(key, directMapItem); + return this; + } + + public MapTest removeDirectMapItem(Boolean directMapItem) { + if (directMapItem != null && this.directMap != null) { + this.directMap.remove(directMapItem); + } + + return this; + } /** **/ public MapTest indirectMap(Map indirectMap) { @@ -143,6 +191,22 @@ public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + + this.indirectMap.put(key, indirectMapItem); + return this; + } + + public MapTest removeIndirectMapItem(Boolean indirectMapItem) { + if (indirectMapItem != null && this.indirectMap != null) { + this.indirectMap.remove(indirectMapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 77464620e9c6..92d8a9a44124 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -26,7 +26,7 @@ private @Valid UUID uuid; private @Valid Date dateTime; - private @Valid Map map = new HashMap(); + private @Valid Map map = new HashMap<>(); /** **/ @@ -91,6 +91,22 @@ public void setMap(Map map) { this.map = map; } + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + + this.map.put(key, mapItem); + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { + if (mapItem != null && this.map != null) { + this.map.remove(mapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java index 7aeb481a43a3..af86cf00edbb 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java index d541b6586f3c..3bcaaffb3d32 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelFile.java index 8ce42cac839e..95dfa998db35 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelFile.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelList.java index f09d013e2dca..ec97de0198c3 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelList.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java index 836ae092d183..b9055976ff5a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java index 7162d94b3b88..8ec79b936c8d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java @@ -28,8 +28,8 @@ private @Valid Long id; private @Valid Category category; private @Valid String name; - private @Valid Set photoUrls = new LinkedHashSet(); - private @Valid List tags = new ArrayList(); + private @Valid Set photoUrls = new LinkedHashSet<>(); + private @Valid List tags = new ArrayList<>(); public enum StatusEnum { @@ -152,6 +152,22 @@ public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } + + this.photoUrls.add(photoUrlsItem); + return this; + } + + public Pet removePhotoUrlsItem(String photoUrlsItem) { + if (photoUrlsItem != null && this.photoUrls != null) { + this.photoUrls.remove(photoUrlsItem); + } + + return this; + } /** **/ public Pet tags(List tags) { @@ -173,6 +189,22 @@ public void setTags(List tags) { this.tags = tags; } + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + + this.tags.add(tagsItem); + return this; + } + + public Pet removeTagsItem(Tag tagsItem) { + if (tagsItem != null && this.tags != null) { + this.tags.remove(tagsItem); + } + + return this; + } /** * pet status in the store **/ diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java index 0340c7996ab1..0fc3694ffad8 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java index a093d79a6d66..98cdf57b7fe5 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -25,7 +25,7 @@ private @Valid BigDecimal numberItem; private @Valid Integer integerItem; private @Valid Boolean boolItem = true; - private @Valid List arrayItem = new ArrayList(); + private @Valid List arrayItem = new ArrayList<>(); /** **/ @@ -137,6 +137,22 @@ public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderDefault removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java index daaffc8af457..f2fbe66277b5 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -26,7 +26,7 @@ private @Valid Float floatItem; private @Valid Integer integerItem; private @Valid Boolean boolItem; - private @Valid List arrayItem = new ArrayList(); + private @Valid List arrayItem = new ArrayList<>(); /** **/ @@ -160,6 +160,22 @@ public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderExample removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java index 241ebb4e1bc4..c70af4c9e31f 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java @@ -25,31 +25,31 @@ private @Valid BigDecimal attributeNumber; private @Valid Integer attributeInteger; private @Valid Boolean attributeBoolean; - private @Valid List wrappedArray = new ArrayList(); + private @Valid List wrappedArray = new ArrayList<>(); private @Valid String nameString; private @Valid BigDecimal nameNumber; private @Valid Integer nameInteger; private @Valid Boolean nameBoolean; - private @Valid List nameArray = new ArrayList(); - private @Valid List nameWrappedArray = new ArrayList(); + private @Valid List nameArray = new ArrayList<>(); + private @Valid List nameWrappedArray = new ArrayList<>(); private @Valid String prefixString; private @Valid BigDecimal prefixNumber; private @Valid Integer prefixInteger; private @Valid Boolean prefixBoolean; - private @Valid List prefixArray = new ArrayList(); - private @Valid List prefixWrappedArray = new ArrayList(); + private @Valid List prefixArray = new ArrayList<>(); + private @Valid List prefixWrappedArray = new ArrayList<>(); private @Valid String namespaceString; private @Valid BigDecimal namespaceNumber; private @Valid Integer namespaceInteger; private @Valid Boolean namespaceBoolean; - private @Valid List namespaceArray = new ArrayList(); - private @Valid List namespaceWrappedArray = new ArrayList(); + private @Valid List namespaceArray = new ArrayList<>(); + private @Valid List namespaceWrappedArray = new ArrayList<>(); private @Valid String prefixNsString; private @Valid BigDecimal prefixNsNumber; private @Valid Integer prefixNsInteger; private @Valid Boolean prefixNsBoolean; - private @Valid List prefixNsArray = new ArrayList(); - private @Valid List prefixNsWrappedArray = new ArrayList(); + private @Valid List prefixNsArray = new ArrayList<>(); + private @Valid List prefixNsWrappedArray = new ArrayList<>(); /** **/ @@ -156,6 +156,22 @@ public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList<>(); + } + + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + public XmlItem removeWrappedArrayItem(Integer wrappedArrayItem) { + if (wrappedArrayItem != null && this.wrappedArray != null) { + this.wrappedArray.remove(wrappedArrayItem); + } + + return this; + } /** **/ public XmlItem nameString(String nameString) { @@ -261,6 +277,22 @@ public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList<>(); + } + + this.nameArray.add(nameArrayItem); + return this; + } + + public XmlItem removeNameArrayItem(Integer nameArrayItem) { + if (nameArrayItem != null && this.nameArray != null) { + this.nameArray.remove(nameArrayItem); + } + + return this; + } /** **/ public XmlItem nameWrappedArray(List nameWrappedArray) { @@ -282,6 +314,22 @@ public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList<>(); + } + + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + public XmlItem removeNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (nameWrappedArrayItem != null && this.nameWrappedArray != null) { + this.nameWrappedArray.remove(nameWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixString(String prefixString) { @@ -387,6 +435,22 @@ public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList<>(); + } + + this.prefixArray.add(prefixArrayItem); + return this; + } + + public XmlItem removePrefixArrayItem(Integer prefixArrayItem) { + if (prefixArrayItem != null && this.prefixArray != null) { + this.prefixArray.remove(prefixArrayItem); + } + + return this; + } /** **/ public XmlItem prefixWrappedArray(List prefixWrappedArray) { @@ -408,6 +472,22 @@ public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList<>(); + } + + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + public XmlItem removePrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (prefixWrappedArrayItem != null && this.prefixWrappedArray != null) { + this.prefixWrappedArray.remove(prefixWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceString(String namespaceString) { @@ -513,6 +593,22 @@ public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList<>(); + } + + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + public XmlItem removeNamespaceArrayItem(Integer namespaceArrayItem) { + if (namespaceArrayItem != null && this.namespaceArray != null) { + this.namespaceArray.remove(namespaceArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { @@ -534,6 +630,22 @@ public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList<>(); + } + + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + public XmlItem removeNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (namespaceWrappedArrayItem != null && this.namespaceWrappedArray != null) { + this.namespaceWrappedArray.remove(namespaceWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsString(String prefixNsString) { @@ -639,6 +751,22 @@ public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList<>(); + } + + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + public XmlItem removePrefixNsArrayItem(Integer prefixNsArrayItem) { + if (prefixNsArrayItem != null && this.prefixNsArray != null) { + this.prefixNsArray.remove(prefixNsArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { @@ -660,6 +788,22 @@ public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList<>(); + } + + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + public XmlItem removePrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (prefixNsWrappedArrayItem != null && this.prefixNsWrappedArray != null) { + this.prefixNsWrappedArray.remove(prefixNsWrappedArrayItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml index d6386dc39bf4..d02806b2d38c 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.0.1 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: - " \' + 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:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -137,8 +137,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." operationId: findPetsByTags parameters: - description: Tags to filter by @@ -910,11 +910,11 @@ paths: type: number string: description: None - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string pattern_without_delimiter: description: None - pattern: ^[A-Z].* + pattern: "^[A-Z].*" type: string byte: description: None @@ -1212,8 +1212,8 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: "For this test, the body for this request much reference a schema\ + \ named `File`." operationId: testBodyWithFileSchema requestBody: content: @@ -1506,7 +1506,7 @@ components: type: integer type: object xml: - name: $special[model.name] + name: "$special[model.name]" Return: description: Model for testing reserved words properties: @@ -1584,13 +1584,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1610,11 +1610,11 @@ components: minimum: 67.8 type: number string: - pattern: /[a-z]/i + pattern: "/[a-z]/i" type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary diff --git a/samples/server/petstore/jaxrs-spec-interface/pom.xml b/samples/server/petstore/jaxrs-spec-interface/pom.xml index bb8acd34af96..a02106893a94 100644 --- a/samples/server/petstore/jaxrs-spec-interface/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface/pom.xml @@ -44,15 +44,25 @@ provided - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + + joda-time + joda-time + ${joda-version} + + + javax.annotation + javax.annotation-api + ${javax.annotation-api-version} + io.swagger swagger-annotations @@ -80,9 +90,14 @@ + 1.8 + ${java.version} + ${java.version} 2.9.9 4.13.1 - 2.0.2 + 2.10.13 + 1.3.2 + 2.0.2 2.1.6 diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 4ebb303b8370..d8256b29ea3d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -22,14 +22,14 @@ @JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesClass implements Serializable { - private @Valid Map mapString = new HashMap(); - private @Valid Map mapNumber = new HashMap(); - private @Valid Map mapInteger = new HashMap(); - private @Valid Map mapBoolean = new HashMap(); - private @Valid Map> mapArrayInteger = new HashMap>(); - private @Valid Map> mapArrayAnytype = new HashMap>(); - private @Valid Map> mapMapString = new HashMap>(); - private @Valid Map> mapMapAnytype = new HashMap>(); + private @Valid Map mapString = new HashMap<>(); + private @Valid Map mapNumber = new HashMap<>(); + private @Valid Map mapInteger = new HashMap<>(); + private @Valid Map mapBoolean = new HashMap<>(); + private @Valid Map> mapArrayInteger = new HashMap<>(); + private @Valid Map> mapArrayAnytype = new HashMap<>(); + private @Valid Map> mapMapString = new HashMap<>(); + private @Valid Map> mapMapAnytype = new HashMap<>(); private @Valid Object anytype1; private @Valid Object anytype2; private @Valid Object anytype3; @@ -57,7 +57,7 @@ public void setMapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); @@ -94,7 +94,7 @@ public void setMapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); @@ -131,7 +131,7 @@ public void setMapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); @@ -168,7 +168,7 @@ public void setMapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); @@ -205,7 +205,7 @@ public void setMapArrayInteger(Map> mapArrayInteger) { public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); @@ -242,7 +242,7 @@ public void setMapArrayAnytype(Map> mapArrayAnytype) { public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); @@ -279,7 +279,7 @@ public void setMapMapString(Map> mapMapString) { public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); @@ -316,7 +316,7 @@ public void setMapMapAnytype(Map> mapMapAnytype) { public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index e4dc1fd68370..6e2646e4da08 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,7 +21,7 @@ @JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayOfArrayOfNumberOnly implements Serializable { - private @Valid List> arrayArrayNumber = new ArrayList>(); + private @Valid List> arrayArrayNumber = new ArrayList<>(); /** **/ @@ -46,7 +46,7 @@ public void setArrayArrayNumber(List> arrayArrayNumber) { public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 19e29e9703b0..f2ab42410746 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,7 +21,7 @@ @JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayOfNumberOnly implements Serializable { - private @Valid List arrayNumber = new ArrayList(); + private @Valid List arrayNumber = new ArrayList<>(); /** **/ @@ -46,7 +46,7 @@ public void setArrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java index bda8bb29dc87..6f2fe46e0ccd 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,9 +21,9 @@ @JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayTest implements Serializable { - private @Valid List arrayOfString = new ArrayList(); - private @Valid List> arrayArrayOfInteger = new ArrayList>(); - private @Valid List> arrayArrayOfModel = new ArrayList>(); + private @Valid List arrayOfString = new ArrayList<>(); + private @Valid List> arrayArrayOfInteger = new ArrayList<>(); + private @Valid List> arrayArrayOfModel = new ArrayList<>(); /** **/ @@ -48,7 +48,7 @@ public void setArrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); @@ -85,7 +85,7 @@ public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); @@ -122,7 +122,7 @@ public void setArrayArrayOfModel(List> arrayArrayOfModel) { public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java index f9f302e48cc3..502d24d9bce4 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java @@ -87,7 +87,7 @@ public static ArrayEnumEnum fromValue(String value) { } } - private @Valid List arrayEnum = new ArrayList(); + private @Valid List arrayEnum = new ArrayList<>(); /** **/ @@ -133,7 +133,7 @@ public void setArrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 6828ddc9bd41..f2ee479c5b9a 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -22,7 +22,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class FileSchemaTestClass implements Serializable { private @Valid ModelFile _file; - private @Valid List files = new ArrayList(); + private @Valid List files = new ArrayList<>(); /** **/ @@ -68,7 +68,7 @@ public void setFiles(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java index fe54c2dbaf12..8d5dece7fbba 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java @@ -21,7 +21,7 @@ @JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class MapTest implements Serializable { - private @Valid Map> mapMapOfString = new HashMap>(); + private @Valid Map> mapMapOfString = new HashMap<>(); public enum InnerEnum { @@ -55,9 +55,9 @@ public static InnerEnum fromValue(String value) { } } - private @Valid Map mapOfEnumString = new HashMap(); - private @Valid Map directMap = new HashMap(); - private @Valid Map indirectMap = new HashMap(); + private @Valid Map mapOfEnumString = new HashMap<>(); + private @Valid Map directMap = new HashMap<>(); + private @Valid Map indirectMap = new HashMap<>(); /** **/ @@ -82,7 +82,7 @@ public void setMapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); @@ -119,7 +119,7 @@ public void setMapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); @@ -156,7 +156,7 @@ public void setDirectMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); @@ -193,7 +193,7 @@ public void setIndirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 54bbb7ca2f01..92d8a9a44124 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -26,7 +26,7 @@ private @Valid UUID uuid; private @Valid Date dateTime; - private @Valid Map map = new HashMap(); + private @Valid Map map = new HashMap<>(); /** **/ @@ -93,7 +93,7 @@ public void setMap(Map map) { public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java index b35574db4cd0..8ec79b936c8d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java @@ -28,8 +28,8 @@ private @Valid Long id; private @Valid Category category; private @Valid String name; - private @Valid Set photoUrls = new LinkedHashSet(); - private @Valid List tags = new ArrayList(); + private @Valid Set photoUrls = new LinkedHashSet<>(); + private @Valid List tags = new ArrayList<>(); public enum StatusEnum { @@ -154,7 +154,7 @@ public void setPhotoUrls(Set photoUrls) { public Pet addPhotoUrlsItem(String photoUrlsItem) { if (this.photoUrls == null) { - this.photoUrls = new LinkedHashSet(); + this.photoUrls = new LinkedHashSet<>(); } this.photoUrls.add(photoUrlsItem); @@ -191,7 +191,7 @@ public void setTags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 1d7658a94fa3..98cdf57b7fe5 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -25,7 +25,7 @@ private @Valid BigDecimal numberItem; private @Valid Integer integerItem; private @Valid Boolean boolItem = true; - private @Valid List arrayItem = new ArrayList(); + private @Valid List arrayItem = new ArrayList<>(); /** **/ @@ -139,7 +139,7 @@ public void setArrayItem(List arrayItem) { public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList(); + this.arrayItem = new ArrayList<>(); } this.arrayItem.add(arrayItemItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java index cdb7058acec5..f2fbe66277b5 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -26,7 +26,7 @@ private @Valid Float floatItem; private @Valid Integer integerItem; private @Valid Boolean boolItem; - private @Valid List arrayItem = new ArrayList(); + private @Valid List arrayItem = new ArrayList<>(); /** **/ @@ -162,7 +162,7 @@ public void setArrayItem(List arrayItem) { public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList(); + this.arrayItem = new ArrayList<>(); } this.arrayItem.add(arrayItemItem); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java index 8e593b393928..c70af4c9e31f 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java @@ -25,31 +25,31 @@ private @Valid BigDecimal attributeNumber; private @Valid Integer attributeInteger; private @Valid Boolean attributeBoolean; - private @Valid List wrappedArray = new ArrayList(); + private @Valid List wrappedArray = new ArrayList<>(); private @Valid String nameString; private @Valid BigDecimal nameNumber; private @Valid Integer nameInteger; private @Valid Boolean nameBoolean; - private @Valid List nameArray = new ArrayList(); - private @Valid List nameWrappedArray = new ArrayList(); + private @Valid List nameArray = new ArrayList<>(); + private @Valid List nameWrappedArray = new ArrayList<>(); private @Valid String prefixString; private @Valid BigDecimal prefixNumber; private @Valid Integer prefixInteger; private @Valid Boolean prefixBoolean; - private @Valid List prefixArray = new ArrayList(); - private @Valid List prefixWrappedArray = new ArrayList(); + private @Valid List prefixArray = new ArrayList<>(); + private @Valid List prefixWrappedArray = new ArrayList<>(); private @Valid String namespaceString; private @Valid BigDecimal namespaceNumber; private @Valid Integer namespaceInteger; private @Valid Boolean namespaceBoolean; - private @Valid List namespaceArray = new ArrayList(); - private @Valid List namespaceWrappedArray = new ArrayList(); + private @Valid List namespaceArray = new ArrayList<>(); + private @Valid List namespaceWrappedArray = new ArrayList<>(); private @Valid String prefixNsString; private @Valid BigDecimal prefixNsNumber; private @Valid Integer prefixNsInteger; private @Valid Boolean prefixNsBoolean; - private @Valid List prefixNsArray = new ArrayList(); - private @Valid List prefixNsWrappedArray = new ArrayList(); + private @Valid List prefixNsArray = new ArrayList<>(); + private @Valid List prefixNsWrappedArray = new ArrayList<>(); /** **/ @@ -158,7 +158,7 @@ public void setWrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); @@ -279,7 +279,7 @@ public void setNameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); @@ -316,7 +316,7 @@ public void setNameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); @@ -437,7 +437,7 @@ public void setPrefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); @@ -474,7 +474,7 @@ public void setPrefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); @@ -595,7 +595,7 @@ public void setNamespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); @@ -632,7 +632,7 @@ public void setNamespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); @@ -753,7 +753,7 @@ public void setPrefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); @@ -790,7 +790,7 @@ public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); diff --git a/samples/server/petstore/jaxrs-spec/pom.xml b/samples/server/petstore/jaxrs-spec/pom.xml index 0ed13d0cdda5..8b25e438cf77 100644 --- a/samples/server/petstore/jaxrs-spec/pom.xml +++ b/samples/server/petstore/jaxrs-spec/pom.xml @@ -59,15 +59,25 @@ provided - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + + joda-time + joda-time + ${joda-version} + + + javax.annotation + javax.annotation-api + ${javax.annotation-api-version} + io.swagger swagger-annotations @@ -115,9 +125,14 @@ + 1.8 + ${java.version} + ${java.version} 2.9.9 4.13.1 - 2.0.2 + 2.10.13 + 1.3.2 + 2.0.2 2.1.6 diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 4ebb303b8370..d8256b29ea3d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -22,14 +22,14 @@ @JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesClass implements Serializable { - private @Valid Map mapString = new HashMap(); - private @Valid Map mapNumber = new HashMap(); - private @Valid Map mapInteger = new HashMap(); - private @Valid Map mapBoolean = new HashMap(); - private @Valid Map> mapArrayInteger = new HashMap>(); - private @Valid Map> mapArrayAnytype = new HashMap>(); - private @Valid Map> mapMapString = new HashMap>(); - private @Valid Map> mapMapAnytype = new HashMap>(); + private @Valid Map mapString = new HashMap<>(); + private @Valid Map mapNumber = new HashMap<>(); + private @Valid Map mapInteger = new HashMap<>(); + private @Valid Map mapBoolean = new HashMap<>(); + private @Valid Map> mapArrayInteger = new HashMap<>(); + private @Valid Map> mapArrayAnytype = new HashMap<>(); + private @Valid Map> mapMapString = new HashMap<>(); + private @Valid Map> mapMapAnytype = new HashMap<>(); private @Valid Object anytype1; private @Valid Object anytype2; private @Valid Object anytype3; @@ -57,7 +57,7 @@ public void setMapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); @@ -94,7 +94,7 @@ public void setMapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); @@ -131,7 +131,7 @@ public void setMapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); @@ -168,7 +168,7 @@ public void setMapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); @@ -205,7 +205,7 @@ public void setMapArrayInteger(Map> mapArrayInteger) { public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); @@ -242,7 +242,7 @@ public void setMapArrayAnytype(Map> mapArrayAnytype) { public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); @@ -279,7 +279,7 @@ public void setMapMapString(Map> mapMapString) { public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); @@ -316,7 +316,7 @@ public void setMapMapAnytype(Map> mapMapAnytype) { public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index e4dc1fd68370..6e2646e4da08 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,7 +21,7 @@ @JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayOfArrayOfNumberOnly implements Serializable { - private @Valid List> arrayArrayNumber = new ArrayList>(); + private @Valid List> arrayArrayNumber = new ArrayList<>(); /** **/ @@ -46,7 +46,7 @@ public void setArrayArrayNumber(List> arrayArrayNumber) { public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 19e29e9703b0..f2ab42410746 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,7 +21,7 @@ @JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayOfNumberOnly implements Serializable { - private @Valid List arrayNumber = new ArrayList(); + private @Valid List arrayNumber = new ArrayList<>(); /** **/ @@ -46,7 +46,7 @@ public void setArrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java index bda8bb29dc87..6f2fe46e0ccd 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,9 +21,9 @@ @JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayTest implements Serializable { - private @Valid List arrayOfString = new ArrayList(); - private @Valid List> arrayArrayOfInteger = new ArrayList>(); - private @Valid List> arrayArrayOfModel = new ArrayList>(); + private @Valid List arrayOfString = new ArrayList<>(); + private @Valid List> arrayArrayOfInteger = new ArrayList<>(); + private @Valid List> arrayArrayOfModel = new ArrayList<>(); /** **/ @@ -48,7 +48,7 @@ public void setArrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); @@ -85,7 +85,7 @@ public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); @@ -122,7 +122,7 @@ public void setArrayArrayOfModel(List> arrayArrayOfModel) { public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java index f9f302e48cc3..502d24d9bce4 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java @@ -87,7 +87,7 @@ public static ArrayEnumEnum fromValue(String value) { } } - private @Valid List arrayEnum = new ArrayList(); + private @Valid List arrayEnum = new ArrayList<>(); /** **/ @@ -133,7 +133,7 @@ public void setArrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 6828ddc9bd41..f2ee479c5b9a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -22,7 +22,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class FileSchemaTestClass implements Serializable { private @Valid ModelFile _file; - private @Valid List files = new ArrayList(); + private @Valid List files = new ArrayList<>(); /** **/ @@ -68,7 +68,7 @@ public void setFiles(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java index fe54c2dbaf12..8d5dece7fbba 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java @@ -21,7 +21,7 @@ @JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class MapTest implements Serializable { - private @Valid Map> mapMapOfString = new HashMap>(); + private @Valid Map> mapMapOfString = new HashMap<>(); public enum InnerEnum { @@ -55,9 +55,9 @@ public static InnerEnum fromValue(String value) { } } - private @Valid Map mapOfEnumString = new HashMap(); - private @Valid Map directMap = new HashMap(); - private @Valid Map indirectMap = new HashMap(); + private @Valid Map mapOfEnumString = new HashMap<>(); + private @Valid Map directMap = new HashMap<>(); + private @Valid Map indirectMap = new HashMap<>(); /** **/ @@ -82,7 +82,7 @@ public void setMapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); @@ -119,7 +119,7 @@ public void setMapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); @@ -156,7 +156,7 @@ public void setDirectMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); @@ -193,7 +193,7 @@ public void setIndirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 54bbb7ca2f01..92d8a9a44124 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -26,7 +26,7 @@ private @Valid UUID uuid; private @Valid Date dateTime; - private @Valid Map map = new HashMap(); + private @Valid Map map = new HashMap<>(); /** **/ @@ -93,7 +93,7 @@ public void setMap(Map map) { public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java index b35574db4cd0..8ec79b936c8d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java @@ -28,8 +28,8 @@ private @Valid Long id; private @Valid Category category; private @Valid String name; - private @Valid Set photoUrls = new LinkedHashSet(); - private @Valid List tags = new ArrayList(); + private @Valid Set photoUrls = new LinkedHashSet<>(); + private @Valid List tags = new ArrayList<>(); public enum StatusEnum { @@ -154,7 +154,7 @@ public void setPhotoUrls(Set photoUrls) { public Pet addPhotoUrlsItem(String photoUrlsItem) { if (this.photoUrls == null) { - this.photoUrls = new LinkedHashSet(); + this.photoUrls = new LinkedHashSet<>(); } this.photoUrls.add(photoUrlsItem); @@ -191,7 +191,7 @@ public void setTags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 1d7658a94fa3..98cdf57b7fe5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -25,7 +25,7 @@ private @Valid BigDecimal numberItem; private @Valid Integer integerItem; private @Valid Boolean boolItem = true; - private @Valid List arrayItem = new ArrayList(); + private @Valid List arrayItem = new ArrayList<>(); /** **/ @@ -139,7 +139,7 @@ public void setArrayItem(List arrayItem) { public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList(); + this.arrayItem = new ArrayList<>(); } this.arrayItem.add(arrayItemItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java index cdb7058acec5..f2fbe66277b5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -26,7 +26,7 @@ private @Valid Float floatItem; private @Valid Integer integerItem; private @Valid Boolean boolItem; - private @Valid List arrayItem = new ArrayList(); + private @Valid List arrayItem = new ArrayList<>(); /** **/ @@ -162,7 +162,7 @@ public void setArrayItem(List arrayItem) { public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList(); + this.arrayItem = new ArrayList<>(); } this.arrayItem.add(arrayItemItem); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java index 8e593b393928..c70af4c9e31f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java @@ -25,31 +25,31 @@ private @Valid BigDecimal attributeNumber; private @Valid Integer attributeInteger; private @Valid Boolean attributeBoolean; - private @Valid List wrappedArray = new ArrayList(); + private @Valid List wrappedArray = new ArrayList<>(); private @Valid String nameString; private @Valid BigDecimal nameNumber; private @Valid Integer nameInteger; private @Valid Boolean nameBoolean; - private @Valid List nameArray = new ArrayList(); - private @Valid List nameWrappedArray = new ArrayList(); + private @Valid List nameArray = new ArrayList<>(); + private @Valid List nameWrappedArray = new ArrayList<>(); private @Valid String prefixString; private @Valid BigDecimal prefixNumber; private @Valid Integer prefixInteger; private @Valid Boolean prefixBoolean; - private @Valid List prefixArray = new ArrayList(); - private @Valid List prefixWrappedArray = new ArrayList(); + private @Valid List prefixArray = new ArrayList<>(); + private @Valid List prefixWrappedArray = new ArrayList<>(); private @Valid String namespaceString; private @Valid BigDecimal namespaceNumber; private @Valid Integer namespaceInteger; private @Valid Boolean namespaceBoolean; - private @Valid List namespaceArray = new ArrayList(); - private @Valid List namespaceWrappedArray = new ArrayList(); + private @Valid List namespaceArray = new ArrayList<>(); + private @Valid List namespaceWrappedArray = new ArrayList<>(); private @Valid String prefixNsString; private @Valid BigDecimal prefixNsNumber; private @Valid Integer prefixNsInteger; private @Valid Boolean prefixNsBoolean; - private @Valid List prefixNsArray = new ArrayList(); - private @Valid List prefixNsWrappedArray = new ArrayList(); + private @Valid List prefixNsArray = new ArrayList<>(); + private @Valid List prefixNsWrappedArray = new ArrayList<>(); /** **/ @@ -158,7 +158,7 @@ public void setWrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); @@ -279,7 +279,7 @@ public void setNameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); @@ -316,7 +316,7 @@ public void setNameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); @@ -437,7 +437,7 @@ public void setPrefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); @@ -474,7 +474,7 @@ public void setPrefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); @@ -595,7 +595,7 @@ public void setNamespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); @@ -632,7 +632,7 @@ public void setNamespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); @@ -753,7 +753,7 @@ public void setPrefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); @@ -790,7 +790,7 @@ public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml index 55cc66ba7111..f634bdb7905b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml @@ -134,7 +134,11 @@ jakarta.servlet-api ${servlet-api-version} - + + jakarta.annotation + jakarta.annotation-api + ${annotation-api-version} + junit junit @@ -157,6 +161,11 @@ jackson-jaxrs-json-provider ${jackson-version} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + org.testng testng @@ -195,7 +204,7 @@ - 1.7 + 1.8 ${java.version} ${java.version} 1.5.22 @@ -207,5 +216,6 @@ 4.13.1 4.0.4 UTF-8 + 1.3.5 diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/JacksonJsonProvider.java index d41d7a1e255d..fe8d07fcea40 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/JacksonJsonProvider.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.joda.*; +import com.fasterxml.jackson.datatype.jsr310.*; import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; @@ -21,9 +21,9 @@ public JacksonJsonProvider() { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .registerModule(new JodaModule()) + .registerModule(new JavaTimeModule()) .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index bf846cfb6bf7..309978113e37 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -95,7 +95,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -123,7 +123,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -151,7 +151,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -179,7 +179,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -207,7 +207,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -235,7 +235,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -263,7 +263,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -291,7 +291,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index d277c77993f3..593ba71954f3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index f8b08e16723e..eaa207fee166 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java index dfeb88958dca..3e716295efd3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java @@ -54,7 +54,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -82,7 +82,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -110,7 +110,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index 08e6db1ffc92..c44a2f70151c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -131,7 +131,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 3b94a5f7e59b..916f9a5b8817 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -69,7 +69,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java index 12516e0afba2..a744c0221d6e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -91,7 +91,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -119,7 +119,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -147,7 +147,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -175,7 +175,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index eb4fcd577811..0ed9488b276c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -97,7 +97,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java index 4c0d02c16b9e..257ce0ebe176 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -57,7 +57,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -193,7 +193,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java index a8450d0e61d5..6ffa7051dfbf 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -55,7 +55,7 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java index 026943cb64e3..8cea27299078 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -60,7 +60,7 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java index 46c2de9ca268..d4b1da18339e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java @@ -264,7 +264,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -372,7 +372,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -400,7 +400,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -508,7 +508,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -536,7 +536,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -644,7 +644,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -672,7 +672,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -780,7 +780,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -808,7 +808,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/pom.xml b/samples/server/petstore/jaxrs/jersey1/pom.xml index 3d86b2b27696..097c6b87019d 100644 --- a/samples/server/petstore/jaxrs/jersey1/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1/pom.xml @@ -134,7 +134,11 @@ jakarta.servlet-api ${servlet-api-version} - + + jakarta.annotation + jakarta.annotation-api + ${annotation-api-version} + junit junit @@ -157,6 +161,11 @@ jackson-jaxrs-json-provider ${jackson-version} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + org.testng testng @@ -195,7 +204,7 @@ - 1.7 + 1.8 ${java.version} ${java.version} 1.5.22 @@ -207,5 +216,6 @@ 4.13.1 4.0.4 UTF-8 + 1.3.5 diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/JacksonJsonProvider.java index d41d7a1e255d..fe8d07fcea40 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/JacksonJsonProvider.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.joda.*; +import com.fasterxml.jackson.datatype.jsr310.*; import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; @@ -21,9 +21,9 @@ public JacksonJsonProvider() { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .registerModule(new JodaModule()) + .registerModule(new JavaTimeModule()) .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index bf846cfb6bf7..309978113e37 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -95,7 +95,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -123,7 +123,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -151,7 +151,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -179,7 +179,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -207,7 +207,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -235,7 +235,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -263,7 +263,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -291,7 +291,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index d277c77993f3..593ba71954f3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index f8b08e16723e..eaa207fee166 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java index dfeb88958dca..3e716295efd3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java @@ -54,7 +54,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -82,7 +82,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -110,7 +110,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java index 08e6db1ffc92..c44a2f70151c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java @@ -131,7 +131,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 3b94a5f7e59b..916f9a5b8817 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -69,7 +69,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java index 12516e0afba2..a744c0221d6e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java @@ -91,7 +91,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -119,7 +119,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -147,7 +147,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -175,7 +175,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index eb4fcd577811..0ed9488b276c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -97,7 +97,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java index 4c0d02c16b9e..257ce0ebe176 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java @@ -57,7 +57,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -193,7 +193,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java index a8450d0e61d5..6ffa7051dfbf 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -55,7 +55,7 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java index 026943cb64e3..8cea27299078 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -60,7 +60,7 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java index 46c2de9ca268..d4b1da18339e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java @@ -264,7 +264,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -372,7 +372,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -400,7 +400,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -508,7 +508,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -536,7 +536,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -644,7 +644,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -672,7 +672,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -780,7 +780,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -808,7 +808,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml index 47724379c18e..21e5a3dea291 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml @@ -143,7 +143,7 @@ com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-version} @@ -157,6 +157,17 @@ migbase64 2.2 + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.3 + + + com.sun.xml.bind + jaxb-impl + 2.3.3 + runtime + @@ -178,7 +189,7 @@ - 1.7 + 1.8 ${java.version} ${java.version} 1.5.18 diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/JacksonJsonProvider.java index d41d7a1e255d..fe8d07fcea40 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/JacksonJsonProvider.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.joda.*; +import com.fasterxml.jackson.datatype.jsr310.*; import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; @@ -21,9 +21,9 @@ public JacksonJsonProvider() { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .registerModule(new JodaModule()) + .registerModule(new JavaTimeModule()) .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index bf846cfb6bf7..309978113e37 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -95,7 +95,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -123,7 +123,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -151,7 +151,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -179,7 +179,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -207,7 +207,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -235,7 +235,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -263,7 +263,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -291,7 +291,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index d277c77993f3..593ba71954f3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index f8b08e16723e..eaa207fee166 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java index dfeb88958dca..3e716295efd3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java @@ -54,7 +54,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -82,7 +82,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -110,7 +110,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index 08e6db1ffc92..c44a2f70151c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -131,7 +131,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 3b94a5f7e59b..916f9a5b8817 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -69,7 +69,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java index 12516e0afba2..a744c0221d6e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -91,7 +91,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -119,7 +119,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -147,7 +147,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -175,7 +175,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index eb4fcd577811..0ed9488b276c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -97,7 +97,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java index 4c0d02c16b9e..257ce0ebe176 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -57,7 +57,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -193,7 +193,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java index a8450d0e61d5..6ffa7051dfbf 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -55,7 +55,7 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java index 026943cb64e3..8cea27299078 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -60,7 +60,7 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java index 46c2de9ca268..d4b1da18339e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java @@ -264,7 +264,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -372,7 +372,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -400,7 +400,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -508,7 +508,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -536,7 +536,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -644,7 +644,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -672,7 +672,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -780,7 +780,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -808,7 +808,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index 018c3a205cca..58f05f6c3861 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -143,7 +143,7 @@ com.fasterxml.jackson.datatype - jackson-datatype-joda + jackson-datatype-jsr310 ${jackson-version} @@ -157,6 +157,17 @@ migbase64 2.2 + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.3 + + + com.sun.xml.bind + jaxb-impl + 2.3.3 + runtime + @@ -178,7 +189,7 @@ - 1.7 + 1.8 ${java.version} ${java.version} 1.5.18 diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/JacksonJsonProvider.java index d41d7a1e255d..fe8d07fcea40 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/JacksonJsonProvider.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.joda.*; +import com.fasterxml.jackson.datatype.jsr310.*; import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; @@ -21,9 +21,9 @@ public JacksonJsonProvider() { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .registerModule(new JodaModule()) + .registerModule(new JavaTimeModule()) .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index bf846cfb6bf7..309978113e37 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -95,7 +95,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -123,7 +123,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -151,7 +151,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -179,7 +179,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -207,7 +207,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -235,7 +235,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -263,7 +263,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -291,7 +291,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index d277c77993f3..593ba71954f3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index f8b08e16723e..eaa207fee166 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java index dfeb88958dca..3e716295efd3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java @@ -54,7 +54,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -82,7 +82,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -110,7 +110,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java index 08e6db1ffc92..c44a2f70151c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java @@ -131,7 +131,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 3b94a5f7e59b..916f9a5b8817 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -69,7 +69,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java index 12516e0afba2..a744c0221d6e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java @@ -91,7 +91,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -119,7 +119,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -147,7 +147,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -175,7 +175,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index eb4fcd577811..0ed9488b276c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -97,7 +97,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java index 4c0d02c16b9e..257ce0ebe176 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java @@ -57,7 +57,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -193,7 +193,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java index a8450d0e61d5..6ffa7051dfbf 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -55,7 +55,7 @@ public class TypeHolderDefault { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java index 026943cb64e3..8cea27299078 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -60,7 +60,7 @@ public class TypeHolderExample { public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java index 46c2de9ca268..d4b1da18339e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java @@ -264,7 +264,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -372,7 +372,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -400,7 +400,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -508,7 +508,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -536,7 +536,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -644,7 +644,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -672,7 +672,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -780,7 +780,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -808,7 +808,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml index 9308a10db9d3..5a556ac88569 100644 --- a/samples/server/petstore/spring-mvc-j8-async/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-async/pom.xml @@ -122,11 +122,6 @@ springfox-swagger-ui ${springfox-version} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - org.openapitools jackson-databind-nullable @@ -166,7 +161,7 @@ ${java.version} ${java.version} 1.3.5 - 2.3.3 + 2.3.3 9.2.15.v20160210 1.7.21 4.13.1 diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml index f14a30570c91..9e48eee987ed 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml @@ -122,11 +122,6 @@ springfox-swagger-ui ${springfox-version} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - org.openapitools jackson-databind-nullable @@ -166,7 +161,7 @@ ${java.version} ${java.version} 1.3.5 - 2.3.3 + 2.3.3 9.2.15.v20160210 1.7.21 4.13.1 diff --git a/samples/server/petstore/spring-mvc-no-nullable/pom.xml b/samples/server/petstore/spring-mvc-no-nullable/pom.xml index 4c44170eca32..ef2658adf026 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/pom.xml +++ b/samples/server/petstore/spring-mvc-no-nullable/pom.xml @@ -122,11 +122,6 @@ springfox-swagger-ui ${springfox-version} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - junit junit @@ -161,7 +156,7 @@ ${java.version} ${java.version} 1.3.5 - 2.3.3 + 2.3.3 9.2.15.v20160210 1.7.21 4.13.1 diff --git a/samples/server/petstore/spring-mvc-spring-pageable/pom.xml b/samples/server/petstore/spring-mvc-spring-pageable/pom.xml index 8e4e24b77ae2..7b02eec2ce64 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/pom.xml +++ b/samples/server/petstore/spring-mvc-spring-pageable/pom.xml @@ -122,11 +122,6 @@ springfox-swagger-ui ${springfox-version} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - org.openapitools jackson-databind-nullable @@ -166,7 +161,7 @@ ${java.version} ${java.version} 1.3.5 - 2.3.3 + 2.3.3 9.2.15.v20160210 1.7.21 4.13.1 diff --git a/samples/server/petstore/spring-mvc/pom.xml b/samples/server/petstore/spring-mvc/pom.xml index 64dbdca4b957..fc26074fc742 100644 --- a/samples/server/petstore/spring-mvc/pom.xml +++ b/samples/server/petstore/spring-mvc/pom.xml @@ -122,11 +122,6 @@ springfox-swagger-ui ${springfox-version} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - org.openapitools jackson-databind-nullable @@ -166,7 +161,7 @@ ${java.version} ${java.version} 1.3.5 - 2.3.3 + 2.3.3 9.2.15.v20160210 1.7.21 4.13.1 diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES index 8dd51f71a270..6d8d3656155a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -15,9 +15,7 @@ src/main/java/org/openapitools/api/StoreApi.java src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/JacksonConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index f865833516e0..af993bc1616c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -6,7 +6,7 @@ spring-boot-beanvalidation-no-nullable 1.0.0 - 1.7 + 1.8 ${java.version} ${java.version} 2.9.2 @@ -51,9 +51,8 @@ jackson-dataformat-yaml - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java index ac50b1a1e60e..c00e37f8afb5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java @@ -9,7 +9,6 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @SpringBootApplication @ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) @@ -38,7 +37,7 @@ public int getExitCode() { @Bean public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurerAdapter() { + return new WebMvcConfigurer() { /*@Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index b79564992a90..e6e5a8971c0b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -9,10 +9,10 @@ import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; +import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index af7c65420e5e..9109f8073e97 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -4,10 +4,10 @@ import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; +import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 5560ddc4ced0..4cfb300ab524 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -6,7 +6,7 @@ package org.openapitools.api; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index e72538504624..f7527e6836f1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -1,7 +1,7 @@ package org.openapitools.api; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.User; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java deleted file mode 100644 index 8f936b311447..000000000000 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 47118d90ba4e..ce3196f016c7 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -72,7 +72,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -99,7 +99,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -126,7 +126,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -153,7 +153,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -180,7 +180,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -207,7 +207,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -234,7 +234,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -261,7 +261,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 0b434e5d80dd..ade7581200f0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 704b68432d7d..e952ddbd6dc0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -34,7 +34,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 5ca8ee5b7d8e..3072ad53963a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -42,7 +42,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -69,7 +69,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -96,7 +96,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 27bbf28c2b38..80de575efa7c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -126,7 +126,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index ecb3820b0cf5..9a58b1331ccf 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -56,7 +56,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(File filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 4b2053f60f51..cfa462903d24 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -8,11 +8,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index 53e126c34fe7..9e861f3b3f67 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -82,7 +82,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -109,7 +109,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -136,7 +136,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -163,7 +163,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 68e453768196..ba8ff205bbcd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,13 +6,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -83,7 +83,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index a9627499bf79..6a406a5047d0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -7,8 +7,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 90683df8d08a..7e497a608654 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -39,7 +39,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private Set photoUrls = new LinkedHashSet(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -149,7 +149,7 @@ public Pet photoUrls(Set photoUrls) { public Pet addPhotoUrlsItem(String photoUrlsItem) { if (this.photoUrls == null) { - this.photoUrls = new LinkedHashSet(); + this.photoUrls = new LinkedHashSet<>(); } this.photoUrls.add(photoUrlsItem); return this; @@ -177,7 +177,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 922da4c45a33..98a4c66f2c59 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -37,7 +37,7 @@ public class TypeHolderDefault { @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; @@ -122,7 +122,7 @@ public TypeHolderDefault arrayItem(List arrayItem) { public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList(); + this.arrayItem = new ArrayList<>(); } this.arrayItem.add(arrayItemItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index c090002feadf..74fe4656a03b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -40,7 +40,7 @@ public class TypeHolderExample { @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; @@ -144,7 +144,7 @@ public TypeHolderExample arrayItem(List arrayItem) { public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList(); + this.arrayItem = new ArrayList<>(); } this.arrayItem.add(arrayItemItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index c9267532f459..04e857829fec 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -202,7 +202,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -305,7 +305,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -332,7 +332,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -435,7 +435,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -462,7 +462,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -565,7 +565,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -592,7 +592,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -695,7 +695,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -722,7 +722,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES index e44445556a9e..e5358dc21c32 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES @@ -21,9 +21,7 @@ src/main/java/org/openapitools/api/StoreApiDelegate.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java -src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/JacksonConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml index 93c4f5ec6dd5..89983aadb0cb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml @@ -6,7 +6,7 @@ springboot-spring-pageable-delegatePattern-without-j8 1.0.0 - 1.7 + 1.8 ${java.version} ${java.version} 2.9.2 @@ -51,9 +51,8 @@ jackson-dataformat-yaml - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 org.openapitools diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java index b7af36b6bbd3..7cad28eed8ac 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java @@ -10,7 +10,6 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @SpringBootApplication @ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) @@ -39,7 +38,7 @@ public int getExitCode() { @Bean public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurerAdapter() { + return new WebMvcConfigurer() { /*@Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 8073eb77d42a..db66a3da6658 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -9,10 +9,10 @@ import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; +import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 72efadd118c2..a13697822953 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -4,10 +4,10 @@ import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; +import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index a7da41b192be..e75dd153c23b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -4,10 +4,10 @@ import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; +import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 5560ddc4ced0..4cfb300ab524 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -6,7 +6,7 @@ package org.openapitools.api; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 3bc638dbeb9d..40c683556aaa 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -1,7 +1,7 @@ package org.openapitools.api; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.User; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index f1d806c05fd2..df4771c1caf1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,7 +1,7 @@ package org.openapitools.api; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.User; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java deleted file mode 100644 index 8f936b311447..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 167352b36568..67b605455de9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -73,7 +73,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -100,7 +100,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -127,7 +127,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -154,7 +154,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -181,7 +181,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -208,7 +208,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -235,7 +235,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -262,7 +262,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 622be10459ed..2b0522be2b08 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -35,7 +35,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index b0eb6b00dd7c..3ef80f22c568 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -35,7 +35,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 8f34930a5e83..309656c30172 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -43,7 +43,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -70,7 +70,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -97,7 +97,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index aacc863a201b..a22d2583b128 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -127,7 +127,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 1d8395401695..552cfcd2ee83 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -57,7 +57,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(File filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 8d81e6c2ce36..0c5b3f3d3306 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -8,11 +8,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java index d9bc6491e74a..7f0aec42b478 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -83,7 +83,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -110,7 +110,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -137,7 +137,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -164,7 +164,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a3e6d4338bf9..53b1f8fe6b14 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,13 +6,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -84,7 +84,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java index 6c5cc6ed8b20..b6eab7cba8a3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java @@ -7,8 +7,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index 1a4e757a147e..d96e2585864b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -37,7 +37,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") @Valid @@ -171,7 +171,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 66adede6dd12..39e0fa94cc76 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -38,7 +38,7 @@ public class TypeHolderDefault { @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index b03cc5c37ec4..afe25703c928 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -41,7 +41,7 @@ public class TypeHolderExample { @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 4c6f7d42bd96..f9ffb03d0ad0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -203,7 +203,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -306,7 +306,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -333,7 +333,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -436,7 +436,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -463,7 +463,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -566,7 +566,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -593,7 +593,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -696,7 +696,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -723,7 +723,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES index e3f3b5ffeda5..2218b36d761c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES @@ -15,9 +15,7 @@ src/main/java/org/openapitools/api/StoreApi.java src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/JacksonConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml index b8f2eb116283..286b606d5e3e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml @@ -6,7 +6,7 @@ springboot-spring-pageable-withoutj8 1.0.0 - 1.7 + 1.8 ${java.version} ${java.version} 2.9.2 @@ -51,9 +51,8 @@ jackson-dataformat-yaml - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 org.openapitools diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java index b7af36b6bbd3..7cad28eed8ac 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java @@ -10,7 +10,6 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @SpringBootApplication @ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) @@ -39,7 +38,7 @@ public int getExitCode() { @Bean public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurerAdapter() { + return new WebMvcConfigurer() { /*@Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 8073eb77d42a..db66a3da6658 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -9,10 +9,10 @@ import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; +import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index b20266d1f871..f564f7010388 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -4,10 +4,10 @@ import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; +import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 5560ddc4ced0..4cfb300ab524 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -6,7 +6,7 @@ package org.openapitools.api; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index e72538504624..f7527e6836f1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -1,7 +1,7 @@ package org.openapitools.api; import java.util.List; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import org.openapitools.model.User; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java deleted file mode 100644 index 8f936b311447..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 167352b36568..67b605455de9 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -73,7 +73,7 @@ public AdditionalPropertiesClass mapString(Map mapString) { public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { if (this.mapString == null) { - this.mapString = new HashMap(); + this.mapString = new HashMap<>(); } this.mapString.put(key, mapStringItem); return this; @@ -100,7 +100,7 @@ public AdditionalPropertiesClass mapNumber(Map mapNumber) { public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + this.mapNumber = new HashMap<>(); } this.mapNumber.put(key, mapNumberItem); return this; @@ -127,7 +127,7 @@ public AdditionalPropertiesClass mapInteger(Map mapInteger) { public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + this.mapInteger = new HashMap<>(); } this.mapInteger.put(key, mapIntegerItem); return this; @@ -154,7 +154,7 @@ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + this.mapBoolean = new HashMap<>(); } this.mapBoolean.put(key, mapBooleanItem); return this; @@ -181,7 +181,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map> mapA public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + this.mapArrayInteger = new HashMap<>(); } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; @@ -208,7 +208,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map> mapAr public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + this.mapArrayAnytype = new HashMap<>(); } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; @@ -235,7 +235,7 @@ public AdditionalPropertiesClass mapMapString(Map> m public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + this.mapMapString = new HashMap<>(); } this.mapMapString.put(key, mapMapStringItem); return this; @@ -262,7 +262,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map> public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + this.mapMapAnytype = new HashMap<>(); } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 622be10459ed..2b0522be2b08 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -35,7 +35,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index b0eb6b00dd7c..3ef80f22c568 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -35,7 +35,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 8f34930a5e83..309656c30172 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -43,7 +43,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -70,7 +70,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -97,7 +97,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index aacc863a201b..a22d2583b128 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -127,7 +127,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 1d8395401695..552cfcd2ee83 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -57,7 +57,7 @@ public FileSchemaTestClass files(List files) { public FileSchemaTestClass addFilesItem(File filesItem) { if (this.files == null) { - this.files = new ArrayList(); + this.files = new ArrayList<>(); } this.files.add(filesItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 8d81e6c2ce36..0c5b3f3d3306 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -8,11 +8,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java index d9bc6491e74a..7f0aec42b478 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -83,7 +83,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -110,7 +110,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -137,7 +137,7 @@ public MapTest directMap(Map directMap) { public MapTest putDirectMapItem(String key, Boolean directMapItem) { if (this.directMap == null) { - this.directMap = new HashMap(); + this.directMap = new HashMap<>(); } this.directMap.put(key, directMapItem); return this; @@ -164,7 +164,7 @@ public MapTest indirectMap(Map indirectMap) { public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { if (this.indirectMap == null) { - this.indirectMap = new HashMap(); + this.indirectMap = new HashMap<>(); } this.indirectMap.put(key, indirectMapItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a3e6d4338bf9..53b1f8fe6b14 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,13 +6,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -84,7 +84,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java index 6c5cc6ed8b20..b6eab7cba8a3 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java @@ -7,8 +7,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; -import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index 1a4e757a147e..d96e2585864b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -37,7 +37,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") @Valid @@ -171,7 +171,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 66adede6dd12..39e0fa94cc76 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -38,7 +38,7 @@ public class TypeHolderDefault { @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index b03cc5c37ec4..afe25703c928 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -41,7 +41,7 @@ public class TypeHolderExample { @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList(); + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 4c6f7d42bd96..f9ffb03d0ad0 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -203,7 +203,7 @@ public XmlItem wrappedArray(List wrappedArray) { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + this.wrappedArray = new ArrayList<>(); } this.wrappedArray.add(wrappedArrayItem); return this; @@ -306,7 +306,7 @@ public XmlItem nameArray(List nameArray) { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList(); + this.nameArray = new ArrayList<>(); } this.nameArray.add(nameArrayItem); return this; @@ -333,7 +333,7 @@ public XmlItem nameWrappedArray(List nameWrappedArray) { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + this.nameWrappedArray = new ArrayList<>(); } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -436,7 +436,7 @@ public XmlItem prefixArray(List prefixArray) { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + this.prefixArray = new ArrayList<>(); } this.prefixArray.add(prefixArrayItem); return this; @@ -463,7 +463,7 @@ public XmlItem prefixWrappedArray(List prefixWrappedArray) { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + this.prefixWrappedArray = new ArrayList<>(); } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -566,7 +566,7 @@ public XmlItem namespaceArray(List namespaceArray) { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + this.namespaceArray = new ArrayList<>(); } this.namespaceArray.add(namespaceArrayItem); return this; @@ -593,7 +593,7 @@ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + this.namespaceWrappedArray = new ArrayList<>(); } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -696,7 +696,7 @@ public XmlItem prefixNsArray(List prefixNsArray) { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + this.prefixNsArray = new ArrayList<>(); } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -723,7 +723,7 @@ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + this.prefixNsWrappedArray = new ArrayList<>(); } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; From 3cb4b7d08eda250b4562f770e3787f913fe9f451 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 10 Feb 2022 10:47:08 +0800 Subject: [PATCH 029/111] [Java] remove tabs from java templates (#11557) * remove tabs from java templates * replaces tabs with spaces in java templates --- .../resources/Java/libraries/apache-httpclient/pom.mustache | 2 +- .../main/resources/Java/libraries/native/oneof_model.mustache | 4 ++-- .../main/resources/Java/libraries/rest-assured/pom.mustache | 2 +- .../resources/Java/libraries/resttemplate/ApiClient.mustache | 2 +- .../openapi-generator/src/main/resources/Java/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache | 2 +- .../JavaJaxRS/spec/libraries/openliberty/pom.mustache | 2 +- samples/client/petstore/java/rest-assured-jackson/pom.xml | 2 +- samples/client/petstore/java/rest-assured/pom.xml | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- samples/server/petstore/jaxrs-cxf-cdi-default-value/pom.xml | 2 +- samples/server/petstore/jaxrs-cxf-cdi/pom.xml | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache index f407870c8e70..cce4ad259517 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache @@ -337,7 +337,7 @@ 2.12.1 1.3.5 {{#useBeanValidation}} - 2.0.2 + 2.0.2 {{/useBeanValidation}} 1.0.0 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache index 993961a6e849..ae48daf75dd9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache @@ -60,12 +60,12 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { - {{#mappedModels}} + {{#mappedModels}} case "{{{mappingName}}}": deserialized = tree.traverse(jp.getCodec()).readValueAs({{{modelName}}}.class); new{{classname}}.setActualInstance(deserialized); return new{{classname}}; - {{/mappedModels}} + {{/mappedModels}} default: log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache index 5ad6d57c29ca..77e8b612f51d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -343,7 +343,7 @@ {{/jackson}} 1.3.5 {{#useBeanValidation}} - 2.0.2 + 2.0.2 {{/useBeanValidation}} 1.17.5 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index fcc5da22b218..0b094ccd6a82 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -678,7 +678,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public ResponseEntity invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - Map uriParams = new HashMap<>(); + Map uriParams = new HashMap<>(); uriParams.putAll(pathParams); String finalUri = path; diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache index c1b811d01b6b..67d505ce0b6a 100644 --- a/modules/openapi-generator/src/main/resources/Java/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache @@ -337,7 +337,7 @@ 2.12.5 1.3.5 {{#useBeanValidation}} - 2.0.2 + 2.0.2 {{/useBeanValidation}} 1.0.0 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache index 4a5222372aba..90260741e462 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache @@ -125,7 +125,7 @@ {{#useBeanValidation}} - 2.0.2 + 2.0.2 {{/useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/pom.mustache index 6719f55780cc..29b13f8a817c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/pom.mustache @@ -61,7 +61,7 @@ usr ${project.artifactId} ${project.build.directory}/${app.name}.zip - 2.0.2 + 2.0.2 diff --git a/samples/client/petstore/java/rest-assured-jackson/pom.xml b/samples/client/petstore/java/rest-assured-jackson/pom.xml index 43201004cbd7..352e4eb19c33 100644 --- a/samples/client/petstore/java/rest-assured-jackson/pom.xml +++ b/samples/client/petstore/java/rest-assured-jackson/pom.xml @@ -289,7 +289,7 @@ 2.10.3 0.2.2 1.3.5 - 2.0.2 + 2.0.2 1.17.5 4.13.1 diff --git a/samples/client/petstore/java/rest-assured/pom.xml b/samples/client/petstore/java/rest-assured/pom.xml index 1e0f965d33cb..3c3f1f3adc5e 100644 --- a/samples/client/petstore/java/rest-assured/pom.xml +++ b/samples/client/petstore/java/rest-assured/pom.xml @@ -264,7 +264,7 @@ 2.8.6 1.8.4 1.3.5 - 2.0.2 + 2.0.2 1.17.5 4.13.1 diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index 66552bc800ba..a26851adcdbf 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -638,7 +638,7 @@ public String generateQueryUri(MultiValueMap queryParams, Map ResponseEntity invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - Map uriParams = new HashMap<>(); + Map uriParams = new HashMap<>(); uriParams.putAll(pathParams); String finalUri = path; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index 38f2d40c103a..efc2083f2d33 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -633,7 +633,7 @@ public String generateQueryUri(MultiValueMap queryParams, Map ResponseEntity invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - Map uriParams = new HashMap<>(); + Map uriParams = new HashMap<>(); uriParams.putAll(pathParams); String finalUri = path; diff --git a/samples/server/petstore/jaxrs-cxf-cdi-default-value/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi-default-value/pom.xml index feca81c39db2..cc6d673012e4 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi-default-value/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi-default-value/pom.xml @@ -115,7 +115,7 @@ - 2.0.2 + 2.0.2 diff --git a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml index 00f850a723e2..71ecc6d584d4 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml @@ -115,7 +115,7 @@ - 2.0.2 + 2.0.2 From fdb58f597c5a563ea4cc7bbaf1abab3786eaab70 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 10 Feb 2022 11:04:59 +0800 Subject: [PATCH 030/111] replace tabs with spaces in js templates (#11559) --- .../src/main/resources/Javascript/ApiClient.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache index eebfd6bd884d..50906dbed6a6 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache @@ -606,7 +606,7 @@ case 'Date': return this.parseDate(String(data)); case 'Blob': - return data; + return data; default: if (type === Object) { // generic object, return directly From 25b55c8c2e93465417be1cfd88a075c9533c7e9c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 10 Feb 2022 11:24:40 +0800 Subject: [PATCH 031/111] remove jdk 6 support (#11558) --- .../main/resources/JavaJaxRS/model.mustache | 5 ---- .../main/resources/JavaJaxRS/pojo.mustache | 25 ------------------- .../src/main/resources/JavaJaxRS/pom.mustache | 19 -------------- .../server/petstore/jaxrs-datelib-j8/pom.xml | 2 -- .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../java/org/openapitools/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../openapitools/model/ArrayOfNumberOnly.java | 1 - .../org/openapitools/model/ArrayTest.java | 1 - .../java/org/openapitools/model/BigCat.java | 1 - .../org/openapitools/model/BigCatAllOf.java | 1 - .../openapitools/model/Capitalization.java | 1 - .../gen/java/org/openapitools/model/Cat.java | 1 - .../java/org/openapitools/model/CatAllOf.java | 1 - .../java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ClassModel.java | 1 - .../java/org/openapitools/model/Client.java | 1 - .../gen/java/org/openapitools/model/Dog.java | 1 - .../java/org/openapitools/model/DogAllOf.java | 1 - .../org/openapitools/model/EnumArrays.java | 1 - .../java/org/openapitools/model/EnumTest.java | 1 - .../model/FileSchemaTestClass.java | 1 - .../org/openapitools/model/FormatTest.java | 1 - .../openapitools/model/HasOnlyReadOnly.java | 1 - .../java/org/openapitools/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../openapitools/model/Model200Response.java | 1 - .../openapitools/model/ModelApiResponse.java | 1 - .../org/openapitools/model/ModelFile.java | 1 - .../org/openapitools/model/ModelList.java | 1 - .../org/openapitools/model/ModelReturn.java | 1 - .../gen/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NumberOnly.java | 1 - .../java/org/openapitools/model/Order.java | 1 - .../openapitools/model/OuterComposite.java | 1 - .../gen/java/org/openapitools/model/Pet.java | 1 - .../org/openapitools/model/ReadOnlyFirst.java | 1 - .../openapitools/model/SpecialModelName.java | 1 - .../gen/java/org/openapitools/model/Tag.java | 1 - .../openapitools/model/TypeHolderDefault.java | 1 - .../openapitools/model/TypeHolderExample.java | 1 - .../gen/java/org/openapitools/model/User.java | 1 - .../java/org/openapitools/model/XmlItem.java | 1 - samples/server/petstore/jaxrs-jersey/pom.xml | 2 -- .../model/AdditionalPropertiesClass.java | 1 - .../java/org/openapitools/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../openapitools/model/ArrayOfNumberOnly.java | 1 - .../org/openapitools/model/ArrayTest.java | 1 - .../openapitools/model/Capitalization.java | 1 - .../gen/java/org/openapitools/model/Cat.java | 1 - .../java/org/openapitools/model/CatAllOf.java | 1 - .../java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ClassModel.java | 1 - .../java/org/openapitools/model/Client.java | 1 - .../openapitools/model/DeprecatedObject.java | 1 - .../gen/java/org/openapitools/model/Dog.java | 1 - .../java/org/openapitools/model/DogAllOf.java | 1 - .../org/openapitools/model/EnumArrays.java | 1 - .../java/org/openapitools/model/EnumTest.java | 1 - .../model/FileSchemaTestClass.java | 1 - .../gen/java/org/openapitools/model/Foo.java | 1 - .../org/openapitools/model/FormatTest.java | 1 - .../openapitools/model/HasOnlyReadOnly.java | 1 - .../openapitools/model/HealthCheckResult.java | 1 - .../model/InlineResponseDefault.java | 1 - .../java/org/openapitools/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../openapitools/model/Model200Response.java | 1 - .../openapitools/model/ModelApiResponse.java | 1 - .../org/openapitools/model/ModelFile.java | 1 - .../org/openapitools/model/ModelList.java | 1 - .../org/openapitools/model/ModelReturn.java | 1 - .../gen/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableClass.java | 1 - .../org/openapitools/model/NumberOnly.java | 1 - .../model/ObjectWithDeprecatedFields.java | 1 - .../java/org/openapitools/model/Order.java | 1 - .../openapitools/model/OuterComposite.java | 1 - .../model/OuterObjectWithEnumProperty.java | 1 - .../gen/java/org/openapitools/model/Pet.java | 1 - .../org/openapitools/model/ReadOnlyFirst.java | 1 - .../openapitools/model/SpecialModelName.java | 1 - .../gen/java/org/openapitools/model/Tag.java | 1 - .../gen/java/org/openapitools/model/User.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../java/org/openapitools/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../openapitools/model/ArrayOfNumberOnly.java | 1 - .../org/openapitools/model/ArrayTest.java | 1 - .../java/org/openapitools/model/BigCat.java | 1 - .../org/openapitools/model/BigCatAllOf.java | 1 - .../openapitools/model/Capitalization.java | 1 - .../gen/java/org/openapitools/model/Cat.java | 1 - .../java/org/openapitools/model/CatAllOf.java | 1 - .../java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ClassModel.java | 1 - .../java/org/openapitools/model/Client.java | 1 - .../gen/java/org/openapitools/model/Dog.java | 1 - .../java/org/openapitools/model/DogAllOf.java | 1 - .../org/openapitools/model/EnumArrays.java | 1 - .../java/org/openapitools/model/EnumTest.java | 1 - .../model/FileSchemaTestClass.java | 1 - .../org/openapitools/model/FormatTest.java | 1 - .../openapitools/model/HasOnlyReadOnly.java | 1 - .../java/org/openapitools/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../openapitools/model/Model200Response.java | 1 - .../openapitools/model/ModelApiResponse.java | 1 - .../org/openapitools/model/ModelFile.java | 1 - .../org/openapitools/model/ModelList.java | 1 - .../org/openapitools/model/ModelReturn.java | 1 - .../gen/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NumberOnly.java | 1 - .../java/org/openapitools/model/Order.java | 1 - .../openapitools/model/OuterComposite.java | 1 - .../gen/java/org/openapitools/model/Pet.java | 1 - .../org/openapitools/model/ReadOnlyFirst.java | 1 - .../openapitools/model/SpecialModelName.java | 1 - .../gen/java/org/openapitools/model/Tag.java | 1 - .../openapitools/model/TypeHolderDefault.java | 1 - .../openapitools/model/TypeHolderExample.java | 1 - .../gen/java/org/openapitools/model/User.java | 1 - .../java/org/openapitools/model/XmlItem.java | 1 - .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../java/org/openapitools/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../openapitools/model/ArrayOfNumberOnly.java | 1 - .../org/openapitools/model/ArrayTest.java | 1 - .../java/org/openapitools/model/BigCat.java | 1 - .../org/openapitools/model/BigCatAllOf.java | 1 - .../openapitools/model/Capitalization.java | 1 - .../gen/java/org/openapitools/model/Cat.java | 1 - .../java/org/openapitools/model/CatAllOf.java | 1 - .../java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ClassModel.java | 1 - .../java/org/openapitools/model/Client.java | 1 - .../gen/java/org/openapitools/model/Dog.java | 1 - .../java/org/openapitools/model/DogAllOf.java | 1 - .../org/openapitools/model/EnumArrays.java | 1 - .../java/org/openapitools/model/EnumTest.java | 1 - .../model/FileSchemaTestClass.java | 1 - .../org/openapitools/model/FormatTest.java | 1 - .../openapitools/model/HasOnlyReadOnly.java | 1 - .../java/org/openapitools/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../openapitools/model/Model200Response.java | 1 - .../openapitools/model/ModelApiResponse.java | 1 - .../org/openapitools/model/ModelFile.java | 1 - .../org/openapitools/model/ModelList.java | 1 - .../org/openapitools/model/ModelReturn.java | 1 - .../gen/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NumberOnly.java | 1 - .../java/org/openapitools/model/Order.java | 1 - .../openapitools/model/OuterComposite.java | 1 - .../gen/java/org/openapitools/model/Pet.java | 1 - .../org/openapitools/model/ReadOnlyFirst.java | 1 - .../openapitools/model/SpecialModelName.java | 1 - .../gen/java/org/openapitools/model/Tag.java | 1 - .../openapitools/model/TypeHolderDefault.java | 1 - .../openapitools/model/TypeHolderExample.java | 1 - .../gen/java/org/openapitools/model/User.java | 1 - .../java/org/openapitools/model/XmlItem.java | 1 - .../petstore/jaxrs/jersey2-useTags/pom.xml | 2 -- .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../java/org/openapitools/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../openapitools/model/ArrayOfNumberOnly.java | 1 - .../org/openapitools/model/ArrayTest.java | 1 - .../java/org/openapitools/model/BigCat.java | 1 - .../org/openapitools/model/BigCatAllOf.java | 1 - .../openapitools/model/Capitalization.java | 1 - .../gen/java/org/openapitools/model/Cat.java | 1 - .../java/org/openapitools/model/CatAllOf.java | 1 - .../java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ClassModel.java | 1 - .../java/org/openapitools/model/Client.java | 1 - .../gen/java/org/openapitools/model/Dog.java | 1 - .../java/org/openapitools/model/DogAllOf.java | 1 - .../org/openapitools/model/EnumArrays.java | 1 - .../java/org/openapitools/model/EnumTest.java | 1 - .../model/FileSchemaTestClass.java | 1 - .../org/openapitools/model/FormatTest.java | 1 - .../openapitools/model/HasOnlyReadOnly.java | 1 - .../java/org/openapitools/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../openapitools/model/Model200Response.java | 1 - .../openapitools/model/ModelApiResponse.java | 1 - .../org/openapitools/model/ModelFile.java | 1 - .../org/openapitools/model/ModelList.java | 1 - .../org/openapitools/model/ModelReturn.java | 1 - .../gen/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NumberOnly.java | 1 - .../java/org/openapitools/model/Order.java | 1 - .../openapitools/model/OuterComposite.java | 1 - .../gen/java/org/openapitools/model/Pet.java | 1 - .../org/openapitools/model/ReadOnlyFirst.java | 1 - .../openapitools/model/SpecialModelName.java | 1 - .../gen/java/org/openapitools/model/Tag.java | 1 - .../openapitools/model/TypeHolderDefault.java | 1 - .../openapitools/model/TypeHolderExample.java | 1 - .../gen/java/org/openapitools/model/User.java | 1 - .../java/org/openapitools/model/XmlItem.java | 1 - samples/server/petstore/jaxrs/jersey2/pom.xml | 2 -- .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 1 - .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../java/org/openapitools/model/Animal.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../openapitools/model/ArrayOfNumberOnly.java | 1 - .../org/openapitools/model/ArrayTest.java | 1 - .../java/org/openapitools/model/BigCat.java | 1 - .../org/openapitools/model/BigCatAllOf.java | 1 - .../openapitools/model/Capitalization.java | 1 - .../gen/java/org/openapitools/model/Cat.java | 1 - .../java/org/openapitools/model/CatAllOf.java | 1 - .../java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ClassModel.java | 1 - .../java/org/openapitools/model/Client.java | 1 - .../gen/java/org/openapitools/model/Dog.java | 1 - .../java/org/openapitools/model/DogAllOf.java | 1 - .../org/openapitools/model/EnumArrays.java | 1 - .../java/org/openapitools/model/EnumTest.java | 1 - .../model/FileSchemaTestClass.java | 1 - .../org/openapitools/model/FormatTest.java | 1 - .../openapitools/model/HasOnlyReadOnly.java | 1 - .../java/org/openapitools/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../openapitools/model/Model200Response.java | 1 - .../openapitools/model/ModelApiResponse.java | 1 - .../org/openapitools/model/ModelFile.java | 1 - .../org/openapitools/model/ModelList.java | 1 - .../org/openapitools/model/ModelReturn.java | 1 - .../gen/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NumberOnly.java | 1 - .../java/org/openapitools/model/Order.java | 1 - .../openapitools/model/OuterComposite.java | 1 - .../gen/java/org/openapitools/model/Pet.java | 1 - .../org/openapitools/model/ReadOnlyFirst.java | 1 - .../openapitools/model/SpecialModelName.java | 1 - .../gen/java/org/openapitools/model/Tag.java | 1 - .../openapitools/model/TypeHolderDefault.java | 1 - .../openapitools/model/TypeHolderExample.java | 1 - .../gen/java/org/openapitools/model/User.java | 1 - .../java/org/openapitools/model/XmlItem.java | 1 - 278 files changed, 328 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/model.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/model.mustache index 9e3aebc0a780..1c187edc4ec4 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/model.mustache @@ -2,12 +2,7 @@ package {{package}}; -{{^supportJava6}} import java.util.Objects; -{{/supportJava6}} -{{#supportJava6}} -import org.apache.commons.lang3.ObjectUtils; -{{/supportJava6}} {{#imports}}import {{import}}; {{/imports}} {{#jackson}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache index c77cdb6c9e2c..dd695a52ae3b 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache @@ -102,7 +102,6 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable {{/vars}} -{{^supportJava6}} @Override public boolean equals(Object o) { if (this == o) { @@ -123,30 +122,6 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializable return Objects.hash({{#vars}}{{name}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); } -{{/supportJava6}} -{{#supportJava6}} - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - }{{#hasVars}} - {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}ObjectUtils.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && - {{/-last}}{{/vars}}{{#parent}} && - super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} - return true;{{/hasVars}} - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti({{#vars}}{{name}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); - } - -{{/supportJava6}} - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache index 87f620b61e77..b423ab3c379d 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache @@ -177,21 +177,6 @@ 2.3.3 runtime - - {{#supportJava6}} - - org.apache.commons - commons-lang3 - ${commons_lang3_version} - - - - commons-io - commons-io - ${commons_io_version} - - {{/supportJava6}} - {{#useBeanValidation}} @@ -223,10 +208,6 @@ 9.2.9.v20150224 2.22.2 2.9.9 - {{#supportJava6}} - 2.5 - 3.5 - {{/supportJava6}} 4.13.1 1.2.0 4.0.4 diff --git a/samples/server/petstore/jaxrs-datelib-j8/pom.xml b/samples/server/petstore/jaxrs-datelib-j8/pom.xml index 890b1e963709..4081da921504 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/pom.xml +++ b/samples/server/petstore/jaxrs-datelib-j8/pom.xml @@ -168,8 +168,6 @@ 2.3.3 runtime - - jakarta.validation diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index c9f806f7d523..f665126332e7 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 61a99c3d4b87..5a2c98174d2b 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -77,7 +77,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 0370765dcc20..965b9f6f6ac6 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 7174c0f0eb67..356208351cf1 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -401,7 +401,6 @@ public int hashCode() { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index f7ecf1a1106e..ccb3f14301da 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8608ce3f5918..9a02c3794beb 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -77,7 +77,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index 4dadea8d0f96..03da2c16bf55 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 8fc7ab782b6f..d4305258e017 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java index bd20629cac45..19d06ca7a2ae 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java @@ -107,7 +107,6 @@ public int hashCode() { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 33121369fee4..3b4561c21e25 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -84,7 +84,6 @@ public int hashCode() { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index efb1371353d9..0535bd356aef 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -84,7 +84,6 @@ public int hashCode() { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java index 3bd201dd0617..3e274c6bd9ca 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java @@ -152,7 +152,6 @@ public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java index 5e0d5ae925d7..53d836748987 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java @@ -112,7 +112,6 @@ public int hashCode() { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java index 447514399d15..8fe84c942a25 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -110,7 +110,6 @@ public int hashCode() { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java index 6d180ab1ed1e..a88e44d4856d 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java @@ -203,7 +203,6 @@ public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java index dd713740017f..60fbf063d639 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java index d111978cc2b6..42243e5b4241 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java index ab8b79f3af5c..0c9610f86020 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java @@ -99,7 +99,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java index eb0be37f6d2b..8283b93db44a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java index aa5d892fdf7a..d457c92d8ad8 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java index 3e551b65d65b..4af57f85053e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java index 57014f0d6e3f..0265cacab581 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java index 99eccbc1e0c6..f3d2e1c3bbff 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java @@ -172,7 +172,6 @@ public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java index 8fd742b187e5..4ef56b1cb6e8 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java @@ -308,7 +308,6 @@ public int hashCode() { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 4eec1363dabb..8151ef2c0861 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -110,7 +110,6 @@ public int hashCode() { return Objects.hash(_file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java index 4b6922939e91..c490ef0e2ed6 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java @@ -427,7 +427,6 @@ public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index cbfa230c8a01..684cad64e655 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -100,7 +100,6 @@ public int hashCode() { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java index 0f920d2a3ea6..452f5455f342 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java @@ -218,7 +218,6 @@ public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 56f41997d170..b4963178f81b 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -139,7 +139,6 @@ public int hashCode() { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java index 2560c4929c20..e5d23723532e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java @@ -101,7 +101,6 @@ public int hashCode() { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java index 3ce446cefe27..1d394d063783 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -126,7 +126,6 @@ public int hashCode() { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelFile.java index 7f7730a2bc54..5c2e27cc7989 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelFile.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(sourceURI); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelList.java index 3a7dc9b941d9..30f0f8748afd 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelList.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(_123list); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java index b474bfebc98f..d193b252e217 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java index deeead372d63..4dbbd8371e05 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java @@ -152,7 +152,6 @@ public int hashCode() { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java index 63a02a6fceda..6b55ebcc1efe 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java index 87a841661665..bd319b8a781a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java @@ -238,7 +238,6 @@ public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java index 0c90b69d363d..5d0f1afcff2d 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java @@ -126,7 +126,6 @@ public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java index 421f34cf2dd9..d71a5546106f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java @@ -258,7 +258,6 @@ public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 51d1241ba7bf..fbf022ca8352 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -99,7 +99,6 @@ public int hashCode() { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java index 6d7f4f0b78e7..3c02b1b693d1 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java index cfe137b1be97..1aeee66afd08 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java @@ -99,7 +99,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java index c32060bf63a5..720e0a27c9d7 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -185,7 +185,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java index e6e731b04cfe..57cf91bccba3 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -211,7 +211,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java index 72e9b20a083e..75b3feb1480d 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java @@ -255,7 +255,6 @@ public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java index cb6de49fbdb2..db63c1246e6b 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java @@ -876,7 +876,6 @@ public int hashCode() { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/pom.xml b/samples/server/petstore/jaxrs-jersey/pom.xml index e9d2c63c329d..1c022c5c6019 100644 --- a/samples/server/petstore/jaxrs-jersey/pom.xml +++ b/samples/server/petstore/jaxrs-jersey/pom.xml @@ -168,8 +168,6 @@ 2.3.3 runtime - - jakarta.validation diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index b977eddbc915..6920a68f41cc 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -117,7 +117,6 @@ public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java index eec45c1f7efc..cdf146a25fa5 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java @@ -105,7 +105,6 @@ public int hashCode() { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 593ba71954f3..c7122c5c265a 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index eaa207fee166..d8670fadb5da 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java index 5439e5e74fa8..fcbf32b30eae 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java index 650d2c7b790b..e952af0fbc98 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java @@ -202,7 +202,6 @@ public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java index ef4f615bfe76..7d65d3acddcc 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java index f66090ad012c..92db279ac2d5 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java index af6055dba4ea..4a5657942d6b 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java index ccfe8e27684e..080d861f6d3a 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java index 0c87d7030a57..9153a3adf216 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java @@ -72,7 +72,6 @@ public int hashCode() { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DeprecatedObject.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DeprecatedObject.java index fb54d90c98ad..0fd9fc94e2e7 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DeprecatedObject.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DeprecatedObject.java @@ -72,7 +72,6 @@ public int hashCode() { return Objects.hash(name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java index e126444fd61e..4fa6da6374b4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java index d6c3cffecb6e..597a9cc13459 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java index c44a2f70151c..62743132023b 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java @@ -171,7 +171,6 @@ public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java index 681946aebb10..ef3a079d8f87 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java @@ -388,7 +388,6 @@ public int hashCode() { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 916f9a5b8817..352c2b49fd66 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -109,7 +109,6 @@ public int hashCode() { return Objects.hash(_file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java index eafca9cc314c..f2e274249f88 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java @@ -72,7 +72,6 @@ public int hashCode() { return Objects.hash(bar); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java index 007c151d2599..551793fbecc0 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java @@ -477,7 +477,6 @@ public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, _byte, binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index bac432e8584b..69ac562dc6a9 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -99,7 +99,6 @@ public int hashCode() { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java index 9757ba544587..30f85ab1078b 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(nullableMessage); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java index 8b0b655f031f..b176dfafec1c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(string); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java index a744c0221d6e..57f86a370c63 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java @@ -217,7 +217,6 @@ public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0ed9488b276c..5026c20169cd 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -138,7 +138,6 @@ public int hashCode() { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java index f02117c54aae..ae8f5397738a 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java @@ -100,7 +100,6 @@ public int hashCode() { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java index 5c7099e23035..28eb65f67817 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelFile.java index 56241ca33e54..135bad167483 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelFile.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(sourceURI); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelList.java index 9eaf3a486dd3..27e325aba294 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelList.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(_123list); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java index 57eeece83431..8f744e457889 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java index cdcef856cd21..c5c89ffd43d8 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java index 50077b523a35..216118481757 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java @@ -413,7 +413,6 @@ public int hashCode() { return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java index 3ec25c75ae59..aceea701ca1e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java index a86dda302bdc..0e501e421b94 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java @@ -162,7 +162,6 @@ public int hashCode() { return Objects.hash(uuid, id, deprecatedRef, bars); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java index b97b051ebc80..5a60e9121f40 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java @@ -237,7 +237,6 @@ public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java index 577504e1bef2..455f52c5ead2 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java index 2f7242fa36d1..3db01589abaa 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(value); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java index 257ce0ebe176..d1f217671cc2 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java @@ -257,7 +257,6 @@ public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 05c01064ff67..0827ed6b9fe3 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java index f58fec5336dc..5f5553bd34b4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java index 5ac82ca92382..ba07edce8ce1 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java index 37ab5453c3d2..26261801d0b2 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java @@ -254,7 +254,6 @@ public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index b69405239b38..cccf3e85e1bb 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index f90d93c37aec..670c6203b981 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 473358d6cda0..3eb8e9b79a5f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 309978113e37..c9a275522191 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -400,7 +400,6 @@ public int hashCode() { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 29bd12be784b..989b035dcd0e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index f05484cd7cc7..d9402d0413ce 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index fb246cac6598..9b8d857f61e7 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index b7018e370e50..f7de30a64d9b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java index 97cdd70ab0a1..2e99959a12f3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -106,7 +106,6 @@ public int hashCode() { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 593ba71954f3..c7122c5c265a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index eaa207fee166..d8670fadb5da 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java index 3e716295efd3..31c73b77576a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java index 867f51230021..f9693c0cc4b5 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java @@ -111,7 +111,6 @@ public int hashCode() { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java index feb9c4521ca6..73d506f60ed9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -109,7 +109,6 @@ public int hashCode() { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java index 650d2c7b790b..e952af0fbc98 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java @@ -202,7 +202,6 @@ public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java index ef4f615bfe76..7d65d3acddcc 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java index f66090ad012c..92db279ac2d5 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java index af6055dba4ea..4a5657942d6b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java index ccfe8e27684e..080d861f6d3a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java index 0c87d7030a57..9153a3adf216 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java @@ -72,7 +72,6 @@ public int hashCode() { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java index e126444fd61e..4fa6da6374b4 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java index d6c3cffecb6e..597a9cc13459 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index c44a2f70151c..62743132023b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -171,7 +171,6 @@ public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 4beac603f1eb..a9cb994ddaa8 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -307,7 +307,6 @@ public int hashCode() { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 916f9a5b8817..352c2b49fd66 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -109,7 +109,6 @@ public int hashCode() { return Objects.hash(_file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java index ce0919049780..f6d31b81f6bc 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java @@ -425,7 +425,6 @@ public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index bac432e8584b..69ac562dc6a9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -99,7 +99,6 @@ public int hashCode() { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java index a744c0221d6e..57f86a370c63 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -217,7 +217,6 @@ public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0ed9488b276c..5026c20169cd 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -138,7 +138,6 @@ public int hashCode() { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java index f02117c54aae..ae8f5397738a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java @@ -100,7 +100,6 @@ public int hashCode() { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java index 5c7099e23035..28eb65f67817 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelFile.java index 56241ca33e54..135bad167483 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelFile.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(sourceURI); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelList.java index 9eaf3a486dd3..27e325aba294 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelList.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(_123list); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java index 57eeece83431..8f744e457889 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java index cdcef856cd21..c5c89ffd43d8 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java index 3ec25c75ae59..aceea701ca1e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java index b97b051ebc80..5a60e9121f40 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java @@ -237,7 +237,6 @@ public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java index 577504e1bef2..455f52c5ead2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java index 257ce0ebe176..d1f217671cc2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -257,7 +257,6 @@ public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 05c01064ff67..0827ed6b9fe3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java index f89183eb3270..0d539a83fd98 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java index 5ac82ca92382..ba07edce8ce1 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 6ffa7051dfbf..42df80d492af 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -184,7 +184,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java index 8cea27299078..02e2798441ae 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -210,7 +210,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java index 37ab5453c3d2..26261801d0b2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java @@ -254,7 +254,6 @@ public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java index d4b1da18339e..cd07560ac569 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java @@ -875,7 +875,6 @@ public int hashCode() { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index b69405239b38..cccf3e85e1bb 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index f90d93c37aec..670c6203b981 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 473358d6cda0..3eb8e9b79a5f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 309978113e37..c9a275522191 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -400,7 +400,6 @@ public int hashCode() { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 29bd12be784b..989b035dcd0e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index f05484cd7cc7..d9402d0413ce 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index fb246cac6598..9b8d857f61e7 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index b7018e370e50..f7de30a64d9b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java index 97cdd70ab0a1..2e99959a12f3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java @@ -106,7 +106,6 @@ public int hashCode() { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 593ba71954f3..c7122c5c265a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index eaa207fee166..d8670fadb5da 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java index 3e716295efd3..31c73b77576a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java index 867f51230021..f9693c0cc4b5 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java @@ -111,7 +111,6 @@ public int hashCode() { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java index feb9c4521ca6..73d506f60ed9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -109,7 +109,6 @@ public int hashCode() { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java index 650d2c7b790b..e952af0fbc98 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java @@ -202,7 +202,6 @@ public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java index ef4f615bfe76..7d65d3acddcc 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java index f66090ad012c..92db279ac2d5 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java index af6055dba4ea..4a5657942d6b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java index ccfe8e27684e..080d861f6d3a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java index 0c87d7030a57..9153a3adf216 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java @@ -72,7 +72,6 @@ public int hashCode() { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java index e126444fd61e..4fa6da6374b4 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java index d6c3cffecb6e..597a9cc13459 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java index c44a2f70151c..62743132023b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java @@ -171,7 +171,6 @@ public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java index 4beac603f1eb..a9cb994ddaa8 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java @@ -307,7 +307,6 @@ public int hashCode() { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 916f9a5b8817..352c2b49fd66 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -109,7 +109,6 @@ public int hashCode() { return Objects.hash(_file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java index ce0919049780..f6d31b81f6bc 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java @@ -425,7 +425,6 @@ public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index bac432e8584b..69ac562dc6a9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -99,7 +99,6 @@ public int hashCode() { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java index a744c0221d6e..57f86a370c63 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java @@ -217,7 +217,6 @@ public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0ed9488b276c..5026c20169cd 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -138,7 +138,6 @@ public int hashCode() { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java index f02117c54aae..ae8f5397738a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java @@ -100,7 +100,6 @@ public int hashCode() { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java index 5c7099e23035..28eb65f67817 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelFile.java index 56241ca33e54..135bad167483 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelFile.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(sourceURI); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelList.java index 9eaf3a486dd3..27e325aba294 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelList.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(_123list); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java index 57eeece83431..8f744e457889 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java index cdcef856cd21..c5c89ffd43d8 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java index 3ec25c75ae59..aceea701ca1e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java index b97b051ebc80..5a60e9121f40 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java @@ -237,7 +237,6 @@ public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java index 577504e1bef2..455f52c5ead2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java index 257ce0ebe176..d1f217671cc2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java @@ -257,7 +257,6 @@ public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 05c01064ff67..0827ed6b9fe3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java index f89183eb3270..0d539a83fd98 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java index 5ac82ca92382..ba07edce8ce1 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 6ffa7051dfbf..42df80d492af 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -184,7 +184,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java index 8cea27299078..02e2798441ae 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -210,7 +210,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java index 37ab5453c3d2..26261801d0b2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java @@ -254,7 +254,6 @@ public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java index d4b1da18339e..cd07560ac569 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java @@ -875,7 +875,6 @@ public int hashCode() { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml index 21e5a3dea291..6b35eaae9559 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml @@ -168,8 +168,6 @@ 2.3.3 runtime - - jakarta.validation diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index b69405239b38..cccf3e85e1bb 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index f90d93c37aec..670c6203b981 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 473358d6cda0..3eb8e9b79a5f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 309978113e37..c9a275522191 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -400,7 +400,6 @@ public int hashCode() { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 29bd12be784b..989b035dcd0e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index f05484cd7cc7..d9402d0413ce 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index fb246cac6598..9b8d857f61e7 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index b7018e370e50..f7de30a64d9b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java index 97cdd70ab0a1..2e99959a12f3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -106,7 +106,6 @@ public int hashCode() { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 593ba71954f3..c7122c5c265a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index eaa207fee166..d8670fadb5da 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java index 3e716295efd3..31c73b77576a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java index 867f51230021..f9693c0cc4b5 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java @@ -111,7 +111,6 @@ public int hashCode() { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java index feb9c4521ca6..73d506f60ed9 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -109,7 +109,6 @@ public int hashCode() { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java index 650d2c7b790b..e952af0fbc98 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java @@ -202,7 +202,6 @@ public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java index ef4f615bfe76..7d65d3acddcc 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java index f66090ad012c..92db279ac2d5 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java index af6055dba4ea..4a5657942d6b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java index ccfe8e27684e..080d861f6d3a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java index 0c87d7030a57..9153a3adf216 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java @@ -72,7 +72,6 @@ public int hashCode() { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java index e126444fd61e..4fa6da6374b4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java index d6c3cffecb6e..597a9cc13459 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index c44a2f70151c..62743132023b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -171,7 +171,6 @@ public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 4beac603f1eb..a9cb994ddaa8 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -307,7 +307,6 @@ public int hashCode() { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 916f9a5b8817..352c2b49fd66 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -109,7 +109,6 @@ public int hashCode() { return Objects.hash(_file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java index ce0919049780..f6d31b81f6bc 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java @@ -425,7 +425,6 @@ public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index bac432e8584b..69ac562dc6a9 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -99,7 +99,6 @@ public int hashCode() { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java index a744c0221d6e..57f86a370c63 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -217,7 +217,6 @@ public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0ed9488b276c..5026c20169cd 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -138,7 +138,6 @@ public int hashCode() { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java index f02117c54aae..ae8f5397738a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java @@ -100,7 +100,6 @@ public int hashCode() { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java index 5c7099e23035..28eb65f67817 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelFile.java index 56241ca33e54..135bad167483 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelFile.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(sourceURI); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelList.java index 9eaf3a486dd3..27e325aba294 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelList.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(_123list); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java index 57eeece83431..8f744e457889 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java index cdcef856cd21..c5c89ffd43d8 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java index 3ec25c75ae59..aceea701ca1e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java index b97b051ebc80..5a60e9121f40 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java @@ -237,7 +237,6 @@ public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java index 577504e1bef2..455f52c5ead2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java index 257ce0ebe176..d1f217671cc2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -257,7 +257,6 @@ public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 05c01064ff67..0827ed6b9fe3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java index f89183eb3270..0d539a83fd98 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java index 5ac82ca92382..ba07edce8ce1 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 6ffa7051dfbf..42df80d492af 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -184,7 +184,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java index 8cea27299078..02e2798441ae 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -210,7 +210,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java index 37ab5453c3d2..26261801d0b2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java @@ -254,7 +254,6 @@ public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java index d4b1da18339e..cd07560ac569 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java @@ -875,7 +875,6 @@ public int hashCode() { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index 58f05f6c3861..13b14d1b08a7 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -168,8 +168,6 @@ 2.3.3 runtime - - jakarta.validation diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index b69405239b38..cccf3e85e1bb 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index f90d93c37aec..670c6203b981 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 473358d6cda0..3eb8e9b79a5f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 309978113e37..c9a275522191 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -400,7 +400,6 @@ public int hashCode() { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 29bd12be784b..989b035dcd0e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index f05484cd7cc7..d9402d0413ce 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -76,7 +76,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index fb246cac6598..9b8d857f61e7 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index b7018e370e50..f7de30a64d9b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java index 97cdd70ab0a1..2e99959a12f3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java @@ -106,7 +106,6 @@ public int hashCode() { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 593ba71954f3..c7122c5c265a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index eaa207fee166..d8670fadb5da 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -83,7 +83,6 @@ public int hashCode() { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java index 3e716295efd3..31c73b77576a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java index 867f51230021..f9693c0cc4b5 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java @@ -111,7 +111,6 @@ public int hashCode() { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java index feb9c4521ca6..73d506f60ed9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -109,7 +109,6 @@ public int hashCode() { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java index 650d2c7b790b..e952af0fbc98 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java @@ -202,7 +202,6 @@ public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java index ef4f615bfe76..7d65d3acddcc 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java index f66090ad012c..92db279ac2d5 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java index af6055dba4ea..4a5657942d6b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java index ccfe8e27684e..080d861f6d3a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java index 0c87d7030a57..9153a3adf216 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java @@ -72,7 +72,6 @@ public int hashCode() { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java index e126444fd61e..4fa6da6374b4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java @@ -75,7 +75,6 @@ public int hashCode() { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java index d6c3cffecb6e..597a9cc13459 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java index c44a2f70151c..62743132023b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java @@ -171,7 +171,6 @@ public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java index 4beac603f1eb..a9cb994ddaa8 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java @@ -307,7 +307,6 @@ public int hashCode() { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 916f9a5b8817..352c2b49fd66 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -109,7 +109,6 @@ public int hashCode() { return Objects.hash(_file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java index ce0919049780..f6d31b81f6bc 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java @@ -425,7 +425,6 @@ public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index bac432e8584b..69ac562dc6a9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -99,7 +99,6 @@ public int hashCode() { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java index a744c0221d6e..57f86a370c63 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java @@ -217,7 +217,6 @@ public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0ed9488b276c..5026c20169cd 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -138,7 +138,6 @@ public int hashCode() { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java index f02117c54aae..ae8f5397738a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java @@ -100,7 +100,6 @@ public int hashCode() { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java index 5c7099e23035..28eb65f67817 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelFile.java index 56241ca33e54..135bad167483 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelFile.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(sourceURI); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelList.java index 9eaf3a486dd3..27e325aba294 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelList.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(_123list); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java index 57eeece83431..8f744e457889 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java @@ -74,7 +74,6 @@ public int hashCode() { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java index cdcef856cd21..c5c89ffd43d8 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java @@ -151,7 +151,6 @@ public int hashCode() { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java index 3ec25c75ae59..aceea701ca1e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java index b97b051ebc80..5a60e9121f40 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java @@ -237,7 +237,6 @@ public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java index 577504e1bef2..455f52c5ead2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java @@ -125,7 +125,6 @@ public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java index 257ce0ebe176..d1f217671cc2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java @@ -257,7 +257,6 @@ public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 05c01064ff67..0827ed6b9fe3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java index f89183eb3270..0d539a83fd98 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -73,7 +73,6 @@ public int hashCode() { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java index 5ac82ca92382..ba07edce8ce1 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java @@ -98,7 +98,6 @@ public int hashCode() { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 6ffa7051dfbf..42df80d492af 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -184,7 +184,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java index 8cea27299078..02e2798441ae 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -210,7 +210,6 @@ public int hashCode() { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java index 37ab5453c3d2..26261801d0b2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java @@ -254,7 +254,6 @@ public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java index d4b1da18339e..cd07560ac569 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java @@ -875,7 +875,6 @@ public int hashCode() { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); From ab482a0e7ffb8eeecd6656fc53887550313ee643 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 10 Feb 2022 12:05:12 +0800 Subject: [PATCH 032/111] remove jdk6, 7 supports in kotlin templates (#11560) --- .../libraries/jvm-volley/build.mustache | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache index 341884176a93..e12ca8c4c739 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache @@ -57,20 +57,8 @@ android { } compileOptions { coreLibraryDesugaringEnabled true - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} - {{/supportJava6}} } lintOptions { abortOnError false From bd4810881896983412ec2a633be869d89ce28f06 Mon Sep 17 00:00:00 2001 From: Ulrich Grave Date: Thu, 10 Feb 2022 07:43:57 +0100 Subject: [PATCH 033/111] Fix for multible tags in @Operation annotation (#11475) * Check size of x-tags list * Remove unused variable assigment * Fix issue number in test method name * Fix typo * Add tag to @ApoOperation only if any tag is given * Rename data provider method * Remove unused import --- .../main/resources/JavaSpring/api.mustache | 6 ++- .../java/spring/SpringCodegenTest.java | 54 +++++++++++++++++++ .../src/test/resources/bugs/issue_11464.yaml | 43 +++++++++++++++ 3 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/bugs/issue_11464.yaml diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index c7ba4bcd0bdf..8de1414103c1 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -132,9 +132,9 @@ public interface {{classname}} { {{#summary}} summary = "{{{.}}}", {{/summary}} - {{#vendorExtensions.x-tags}} + {{#vendorExtensions.x-tags.size}} tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }, - {{/vendorExtensions.x-tags}} + {{/vendorExtensions.x-tags.size}} responses = { {{#responses}} @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = { @@ -153,7 +153,9 @@ public interface {{classname}} { {{/swagger2AnnotationLibrary}} {{#swagger1AnnotationLibrary}} @ApiOperation( + {{#vendorExtensions.x-tags.size}} tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }, + {{/vendorExtensions.x-tags.size}} value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 166ac7bdf314..604a978519a2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -24,10 +24,13 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.core.models.ParseOptions; +import java.util.function.Consumer; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.SpringCodegen; import org.openapitools.codegen.languages.features.CXFServerFeatures; +import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; import org.testng.Assert; +import org.testng.annotations.DataProvider; import org.testng.annotations.Ignore; import org.testng.annotations.Test; @@ -807,4 +810,55 @@ public void testImportMappings() { Assert.assertEquals(codegen.importMapping().get("ParameterObject"), "org.springdoc.api.annotations.ParameterObject"); } + @Test(dataProvider = "issue11464TestCases") + public void shouldGenerateOneTagAttributeForMultipleTags_Regression11464(String documentProvider, Consumer assertFunction) throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_11464.yaml", null, new ParseOptions()).getOpenAPI(); + + SpringCodegen codegen = new SpringCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, documentProvider); + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + assertFunction.accept(outputPath); + } + + @DataProvider + public Object[][] issue11464TestCases() { + return new Object[][] { + { DocumentationProviderFeatures.DocumentationProvider.SPRINGDOC.name(), (Consumer) outputPath -> { + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/NoneApi.java"), + "@Operation( operationId = \"getNone\", summary = \"No Tag\", responses = {"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SingleApi.java"), + "@Operation( operationId = \"getSingleTag\", summary = \"Single Tag\", tags = { \"tag1\" }, responses = {"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/MultipleApi.java"), + "@Operation( operationId = \"getMultipleTags\", summary = \"Multiple Tags\", tags = { \"tag1\", \"tag2\" }, responses = {"); + }}, + { DocumentationProviderFeatures.DocumentationProvider.SPRINGFOX.name(), (Consumer) outputPath -> { + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/NoneApi.java"), + "@ApiOperation( value = \"No Tag\", nickname = \"getNone\", notes = \"\", response = "); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SingleApi.java"), + "@ApiOperation( tags = { \"tag1\" }, value = \"Single Tag\", nickname = \"getSingleTag\", notes = \"\", response = "); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/MultipleApi.java"), + "@ApiOperation( tags = { \"tag1\", \"tag2\" }, value = \"Multiple Tags\", nickname = \"getMultipleTags\", notes = \"\", response = "); + }}, + }; + } + } diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_11464.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_11464.yaml new file mode 100644 index 000000000000..cbee2b3a1c1d --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_11464.yaml @@ -0,0 +1,43 @@ +openapi: '3.0.3' +info: + version: 1.0.0 + title: Example Api +paths: + /none: + get: + summary: No Tag + operationId: get_none + responses: + '200': + description: OK + content: + application/json: + schema: + type: string + /single: + get: + summary: Single Tag + operationId: get_single_tag + tags: + - tag1 + responses: + '200': + description: OK + content: + application/json: + schema: + type: string + /multiple: + get: + summary: Multiple Tags + operationId: get_multiple_tags + tags: + - tag1 + - tag2 + responses: + '200': + description: OK + content: + application/json: + schema: + type: string From 376bf6cd34b8d24e1906e2f874d8f23f04c2535d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 10 Feb 2022 14:46:51 +0800 Subject: [PATCH 034/111] update samples --- .../src/main/java/org/openapitools/api/DefaultApi.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index a5eceee230ad..9fd2e7de5992 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -39,7 +39,6 @@ public interface DefaultApi { * @return OK (status code 200) */ @ApiOperation( - tags = { }, value = "", nickname = "get", notes = "" @@ -68,7 +67,6 @@ ResponseEntity get( * @return Invalid input (status code 405) */ @ApiOperation( - tags = { }, value = "", nickname = "updatePetWithForm", notes = "update with form data" From 15501f10c44e736872bdce13703f4f25c63793c6 Mon Sep 17 00:00:00 2001 From: Juan Treminio Date: Thu, 10 Feb 2022 02:01:16 -0600 Subject: [PATCH 035/111] [PHP] Fix checking value of `Configuration::getAccessToken()` (#11486) * Prevents empty access token from overriding basic auth --- .../src/main/resources/php/api.mustache | 4 ++-- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/api.mustache b/modules/openapi-generator/src/main/resources/php/api.mustache index 60989ca57395..f9c5c041fbb3 100644 --- a/modules/openapi-generator/src/main/resources/php/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/api.mustache @@ -636,14 +636,14 @@ use {{invokerPackage}}\ObjectSerializer; {{/isBasicBasic}} {{#isBasicBearer}} // this endpoint requires Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } {{/isBasicBearer}} {{/isBasic}} {{#isOAuth}} // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } {{/isOAuth}} diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index b9ccd0b51a1b..4aba5d1907ce 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -3867,7 +3867,7 @@ public function testGroupParametersRequest($associative_array) } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index e82200611e6e..dd8b59aed77a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -339,7 +339,7 @@ public function addPetRequest($pet) } // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -584,7 +584,7 @@ public function deletePetRequest($pet_id, $api_key = null) } // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -858,7 +858,7 @@ public function findPetsByStatusRequest($status) } // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1138,7 +1138,7 @@ public function findPetsByTagsRequest($tags) } // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1662,7 +1662,7 @@ public function updatePetRequest($pet) } // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1916,7 +1916,7 @@ public function updatePetWithFormRequest($pet_id, $name = null, $status = null) } // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -2217,7 +2217,7 @@ public function uploadFileRequest($pet_id, $additional_metadata = null, $file = } // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -2524,7 +2524,7 @@ public function uploadFileWithRequiredFileRequest($pet_id, $required_file, $addi } // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } From 01a8572f637c9f14a636fa24e6ca8f4c2d048ef7 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Fri, 11 Feb 2022 10:35:19 +0100 Subject: [PATCH 036/111] Upgrade Kotlin to version 1.6.0 (#11022) --- .../libraries/multiplatform/build.gradle.kts.mustache | 8 ++++---- .../client/petstore/kotlin-multiplatform/build.gradle.kts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache index 4a09e4daf46e..42826ffff641 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache @@ -1,17 +1,17 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { - kotlin("multiplatform"){{^omitGradlePluginVersions}} version "1.5.31" // kotlin_version{{/omitGradlePluginVersions}} - kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "1.5.31" // kotlin_version{{/omitGradlePluginVersions}} + kotlin("multiplatform"){{^omitGradlePluginVersions}} version "1.6.0" // kotlin_version{{/omitGradlePluginVersions}} + kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "1.6.0" // kotlin_version{{/omitGradlePluginVersions}} } group = "{{groupId}}" version = "{{artifactVersion}}" -val kotlin_version = "1.5.31" +val kotlin_version = "1.6.0" val coroutines_version = "1.5.2" val serialization_version = "1.3.0" -val ktor_version = "1.6.3" +val ktor_version = "1.6.4" repositories { mavenCentral() diff --git a/samples/client/petstore/kotlin-multiplatform/build.gradle.kts b/samples/client/petstore/kotlin-multiplatform/build.gradle.kts index eb33cf023bf7..2380844aa924 100644 --- a/samples/client/petstore/kotlin-multiplatform/build.gradle.kts +++ b/samples/client/petstore/kotlin-multiplatform/build.gradle.kts @@ -1,17 +1,17 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { - kotlin("multiplatform") version "1.5.31" // kotlin_version - kotlin("plugin.serialization") version "1.5.31" // kotlin_version + kotlin("multiplatform") version "1.6.0" // kotlin_version + kotlin("plugin.serialization") version "1.6.0" // kotlin_version } group = "org.openapitools" version = "1.0.0" -val kotlin_version = "1.5.31" +val kotlin_version = "1.6.0" val coroutines_version = "1.5.2" val serialization_version = "1.3.0" -val ktor_version = "1.6.3" +val ktor_version = "1.6.4" repositories { mavenCentral() From fbf4e56281e86004234e0b854a24a09a05258282 Mon Sep 17 00:00:00 2001 From: Sergio del Amo Date: Sat, 12 Feb 2022 07:51:20 +0100 Subject: [PATCH 037/111] update micronaut to 3.3.1 (#11569) --- docs/generators/java-micronaut-client.md | 2 +- docs/generators/java-micronaut-server.md | 2 +- .../codegen/languages/JavaMicronautAbstractCodegen.java | 2 +- .../client/petstore/java-micronaut-client/gradle.properties | 2 +- samples/client/petstore/java-micronaut-client/pom.xml | 4 ++-- .../server/petstore/java-micronaut-server/gradle.properties | 2 +- samples/server/petstore/java-micronaut-server/pom.xml | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 4673d0ece18f..e63a9c91ac9e 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -47,7 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| -|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.2.6| +|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.3.1| |modelPackage|package for generated models| |org.openapitools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index de82e7dd3cc3..9f1cc7d305dd 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| -|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.2.6| +|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.3.1| |modelPackage|package for generated models| |org.openapitools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java index b8b8506e8f42..79b478360e26 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java @@ -29,7 +29,7 @@ public abstract class JavaMicronautAbstractCodegen extends AbstractJavaCodegen i protected String buildTool; protected String testTool; protected boolean requiredPropertiesInConstructor = true; - protected String micronautVersion = "3.2.6"; + protected String micronautVersion = "3.3.1"; public static final String CONTENT_TYPE_APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded"; public static final String CONTENT_TYPE_APPLICATION_JSON = "application/json"; diff --git a/samples/client/petstore/java-micronaut-client/gradle.properties b/samples/client/petstore/java-micronaut-client/gradle.properties index 70b9dde78f14..6d5febf85205 100644 --- a/samples/client/petstore/java-micronaut-client/gradle.properties +++ b/samples/client/petstore/java-micronaut-client/gradle.properties @@ -1 +1 @@ -micronautVersion=3.2.6 \ No newline at end of file +micronautVersion=3.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java-micronaut-client/pom.xml b/samples/client/petstore/java-micronaut-client/pom.xml index 89a43adef332..9c20a94c9478 100644 --- a/samples/client/petstore/java-micronaut-client/pom.xml +++ b/samples/client/petstore/java-micronaut-client/pom.xml @@ -10,7 +10,7 @@ io.micronaut micronaut-parent - 3.2.6 + 3.3.1 @@ -18,7 +18,7 @@ 1.8 - 3.2.6 + 3.3.1 org.openapitools.Application netty 1.5.21 diff --git a/samples/server/petstore/java-micronaut-server/gradle.properties b/samples/server/petstore/java-micronaut-server/gradle.properties index 70b9dde78f14..6d5febf85205 100644 --- a/samples/server/petstore/java-micronaut-server/gradle.properties +++ b/samples/server/petstore/java-micronaut-server/gradle.properties @@ -1 +1 @@ -micronautVersion=3.2.6 \ No newline at end of file +micronautVersion=3.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-micronaut-server/pom.xml b/samples/server/petstore/java-micronaut-server/pom.xml index 71aee310caa4..36e2c01d0352 100644 --- a/samples/server/petstore/java-micronaut-server/pom.xml +++ b/samples/server/petstore/java-micronaut-server/pom.xml @@ -10,7 +10,7 @@ io.micronaut micronaut-parent - 3.2.6 + 3.3.1 @@ -18,7 +18,7 @@ 1.8 - 3.2.6 + 3.3.1 org.openapitools.Application netty 1.5.21 From 7bdf04db70aa877931e23c2134010d375dd13ea8 Mon Sep 17 00:00:00 2001 From: Sean Brown <54456539+seanbrown-com@users.noreply.github.com> Date: Fri, 11 Feb 2022 23:02:59 -0800 Subject: [PATCH 038/111] [java][vertx] moved HttpStatusException (vertx internal) to HttpException (public) (#11550) * Update apiImpl.mustache Vertx has moved HttpStatusException (vertx internal) to HttpException (public) https://github.com/vert-x3/wiki/wiki/4.1.0-Deprecations-and-breaking-changes#iovertxextwebhandlerimplhttpstatusexception * Update java vertx server verx version Co-authored-by: Sean Brown --- .../resources/JavaVertXServer/pom.mustache | 2 +- .../JavaVertXWebServer/apiImpl.mustache | 4 ++-- .../vertxweb/server/api/PetApiImpl.java | 20 +++++++++---------- .../vertxweb/server/api/StoreApiImpl.java | 10 +++++----- .../vertxweb/server/api/UserApiImpl.java | 19 +++++++++--------- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache index 3fdedc85a2a7..4c76c2f62060 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache @@ -13,7 +13,7 @@ UTF-8 1.8 4.13.1 - 3.4.1 + 4.2.4 3.8.1 {{vertxSwaggerRouterVersion}} 2.3 diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiImpl.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiImpl.mustache index 341e68eb5771..c84106efecce 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiImpl.mustache @@ -7,7 +7,7 @@ import {{invokerPackage}}.ApiResponse; import io.vertx.core.Future; import io.vertx.core.json.JsonObject; -import io.vertx.ext.web.handler.impl.HttpStatusException; +import io.vertx.ext.web.handler.HttpException; import java.util.List; import java.util.Map; @@ -18,7 +18,7 @@ public class {{classname}}Impl implements {{classname}} { {{#operations}} {{#operation}} public Future> {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } {{/operation}} diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java index f06dfd3ae29f..c3daaf53230e 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java @@ -8,7 +8,7 @@ import io.vertx.core.Future; import io.vertx.core.json.JsonObject; -import io.vertx.ext.web.handler.impl.HttpStatusException; +import io.vertx.ext.web.handler.HttpException; import java.util.List; import java.util.Map; @@ -17,35 +17,35 @@ public class PetApiImpl implements PetApi { public Future> addPet(Pet pet) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> deletePet(Long petId, String apiKey) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future>> findPetsByStatus(List status) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future>> findPetsByTags(List tags) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> getPetById(Long petId) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> updatePet(Pet pet) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> updatePetWithForm(Long petId, JsonObject formBody) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } - public Future> uploadFile(Long petId, FileUpload _file) { - return Future.failedFuture(new HttpStatusException(501)); + public Future> uploadFile(Long petId, FileUpload file) { + return Future.failedFuture(new HttpException(501)); } } diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiImpl.java index d542d3be96c1..1bc8d437a05d 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiImpl.java @@ -6,7 +6,7 @@ import io.vertx.core.Future; import io.vertx.core.json.JsonObject; -import io.vertx.ext.web.handler.impl.HttpStatusException; +import io.vertx.ext.web.handler.HttpException; import java.util.List; import java.util.Map; @@ -15,19 +15,19 @@ public class StoreApiImpl implements StoreApi { public Future> deleteOrder(String orderId) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future>> getInventory() { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> getOrderById(Long orderId) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> placeOrder(Order order) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } } diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java index b2097db1dec0..48324ba8ee08 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java @@ -1,13 +1,12 @@ package org.openapitools.vertxweb.server.api; -import java.time.OffsetDateTime; import org.openapitools.vertxweb.server.model.User; import org.openapitools.vertxweb.server.ApiResponse; import io.vertx.core.Future; import io.vertx.core.json.JsonObject; -import io.vertx.ext.web.handler.impl.HttpStatusException; +import io.vertx.ext.web.handler.HttpException; import java.util.List; import java.util.Map; @@ -16,35 +15,35 @@ public class UserApiImpl implements UserApi { public Future> createUser(User user) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> createUsersWithArrayInput(List user) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> createUsersWithListInput(List user) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> deleteUser(String username) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> getUserByName(String username) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> loginUser(String username, String password) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> logoutUser() { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> updateUser(String username, User user) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } } From 4f0c07ff3c37c18b100c9f8eeced7744e7ad1a26 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 12 Feb 2022 15:08:47 +0800 Subject: [PATCH 039/111] update java-vertx-web version to 4.2.4 --- .../src/main/resources/JavaVertXServer/pom.mustache | 2 +- .../main/resources/JavaVertXWebServer/supportFiles/pom.mustache | 2 +- samples/server/petstore/java-vertx-web/pom.xml | 2 +- .../java/org/openapitools/vertxweb/server/api/PetApiImpl.java | 2 +- .../java/org/openapitools/vertxweb/server/api/UserApiImpl.java | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache index 4c76c2f62060..939494cec7ad 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache @@ -7,7 +7,7 @@ {{artifactVersion}} jar - {{appName}} + {{appName}} UTF-8 diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache index da3bb233cf81..0d7bb4c6f087 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache @@ -17,7 +17,7 @@ 2.22.2 1.5.0 - 4.0.0 + 4.2.4 5.7.0 1.7.30 2.11.2 diff --git a/samples/server/petstore/java-vertx-web/pom.xml b/samples/server/petstore/java-vertx-web/pom.xml index 56eebc06b103..10e3649bd894 100644 --- a/samples/server/petstore/java-vertx-web/pom.xml +++ b/samples/server/petstore/java-vertx-web/pom.xml @@ -17,7 +17,7 @@ 2.22.2 1.5.0 - 4.0.0 + 4.2.4 5.7.0 1.7.30 2.11.2 diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java index c3daaf53230e..8743965e08aa 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java @@ -44,7 +44,7 @@ public Future> updatePetWithForm(Long petId, JsonObject formBo return Future.failedFuture(new HttpException(501)); } - public Future> uploadFile(Long petId, FileUpload file) { + public Future> uploadFile(Long petId, FileUpload _file) { return Future.failedFuture(new HttpException(501)); } diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java index 48324ba8ee08..414f22e0de2a 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java @@ -1,5 +1,6 @@ package org.openapitools.vertxweb.server.api; +import java.time.OffsetDateTime; import org.openapitools.vertxweb.server.model.User; import org.openapitools.vertxweb.server.ApiResponse; From 9dfe8c63eed7c597b6111e6cb9f7e1aac8193800 Mon Sep 17 00:00:00 2001 From: cachescrubber <5127753+cachescrubber@users.noreply.github.com> Date: Sat, 12 Feb 2022 08:14:26 +0100 Subject: [PATCH 040/111] [Bug][Java] defaultValues for date and date-time params (#11536) * Add default value support to cookie and header params * Generate Samples * Replace "OffsetDateTime.parse(..)" with toString(); * Generate Samples * Revert "Replace "OffsetDateTime.parse(..)" with toString();" This reverts commit 2e37411b305343e99542c094a691e1419a67b1b5. * Format java.util.Date to ISO Date in AbstractJavaCodegen.toDefaultParameterValue * Generate Samples * Generate Samples * Use toParameterDefault() * Generate Samples * Implement testDateTimeFormParameterHasDefaultValue unit test * Add more test coverage. * Remove postProcessParameter() since is has no effect after using toDefaultParameterValue() * Use LocalDate.parse() in toDefaultValue() * Generate Samples * Return a defaultValue only if dateTimeLibrary is java8. --- .../openapitools/codegen/DefaultCodegen.java | 2 +- .../languages/AbstractJavaCodegen.java | 44 ++-- .../JavaSpring/cookieParams.mustache | 2 +- .../JavaSpring/headerParams.mustache | 2 +- .../codegen/DefaultCodegenTest.java | 14 ++ .../codegen/java/AbstractJavaCodegenTest.java | 79 ++++++- .../date-time-parameter-types-for-testing.yml | 36 ++- .../petstore/java/okhttp-gson/docs/FakeApi.md | 4 +- .../org/openapitools/client/api/FakeApi.java | 8 +- .../.openapi-generator/FILES | 1 + .../java/org/openapitools/api/DefaultApi.java | 16 +- .../main/java/org/openapitools/model/Pet.java | 210 ++++++++++++++++++ .../java/jersey2-java8/docs/FakeApi.md | 4 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../.openapi-generator/FILES | 1 + .../java/org/openapitools/api/DefaultApi.java | 10 +- .../main/java/org/openapitools/model/Pet.java | 209 +++++++++++++++++ .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/api/FakeApiController.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../org/openapitools/api/TestHeadersApi.java | 12 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/api/FakeApiController.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/api/FakeApiController.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/api/FakeApiController.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/virtualan/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- 44 files changed, 625 insertions(+), 85 deletions(-) create mode 100644 samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java create mode 100644 samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 1ff9e2ddd095..e5b5908f0c94 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -6286,7 +6286,7 @@ public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set codegenParameter.baseType = codegenProperty.baseType; codegenParameter.dataType = codegenProperty.dataType; - codegenParameter.defaultValue = codegenProperty.getDefaultValue(); + codegenParameter.defaultValue = toDefaultParameterValue(propertySchema); codegenParameter.baseName = codegenProperty.baseName; codegenParameter.paramName = toParamName(codegenParameter.baseName); codegenParameter.dataFormat = codegenProperty.dataFormat; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index ef6292a3924a..561a9609ba23 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -946,11 +946,21 @@ public String toDefaultValue(Schema schema) { if (schema.getDefault() != null) { String _default; if (schema.getDefault() instanceof Date) { - Date date = (Date) schema.getDefault(); - LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - return String.format(Locale.ROOT, localDate.toString(), ""); + if ("java8".equals(getDateLibrary())) { + Date date = (Date) schema.getDefault(); + LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + return String.format(Locale.ROOT, "LocalDate.parse(\"%s\")", localDate.toString()); + } else { + return null; + } } else if (schema.getDefault() instanceof java.time.OffsetDateTime) { - return "OffsetDateTime.parse(\"" + String.format(Locale.ROOT, ((java.time.OffsetDateTime) schema.getDefault()).atZoneSameInstant(ZoneId.systemDefault()).toString(), "") + "\", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))"; + if ("java8".equals(getDateLibrary())) { + return String.format(Locale.ROOT, "OffsetDateTime.parse(\"%s\", %s)", + ((java.time.OffsetDateTime) schema.getDefault()).atZoneSameInstant(ZoneId.systemDefault()), + "java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault())"); + } else { + return null; + } } else { _default = (String) schema.getDefault(); } @@ -984,6 +994,11 @@ public String toDefaultParameterValue(final Schema schema) { if (defaultValue == null) { return null; } + if (defaultValue instanceof Date) { + Date date = (Date) schema.getDefault(); + LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + return localDate.toString(); + } // escape quotes return defaultValue.toString().replace("\"", "\\\""); } @@ -1504,27 +1519,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation return op; } - @Override - public void postProcessParameter(CodegenParameter p) { - // we use a custom version of this function to remove the l, d, and f suffixes from Long/Double/Float - // defaultValues - // remove the l because our users will use Long.parseLong(String defaultValue) - // remove the d because our users will use Double.parseDouble(String defaultValue) - // remove the f because our users will use Float.parseFloat(String defaultValue) - // NOTE: for CodegenParameters we DO need these suffixes because those defaultValues are used as java value - // literals assigned to Long/Double/Float - if (p.defaultValue == null) { - return; - } - - Boolean fixLong = (p.isLong && "l".equals(p.defaultValue.substring(p.defaultValue.length()-1))); - Boolean fixDouble = (p.isDouble && "d".equals(p.defaultValue.substring(p.defaultValue.length()-1))); - Boolean fixFloat = (p.isFloat && "f".equals(p.defaultValue.substring(p.defaultValue.length()-1))); - if (fixLong || fixDouble || fixFloat) { - p.defaultValue = p.defaultValue.substring(0, p.defaultValue.length()-1); - } - } - private static CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) { // This generator uses inline classes to define enums, which breaks when // dealing with models that have subTypes. To clean this up, we will analyze diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache index a4fe15cb9c2a..aac48b887c81 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue("{{baseName}}"){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue(name="{{baseName}}"{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache index 54891a27d570..c0e8053a7256 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 4e9fcd6397b4..7aec2aad6b0d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -235,6 +235,20 @@ public void testFormParameterHasDefaultValue() { Assert.assertEquals(codegenParameter.getSchema(), null); } + @Test + public void testDateTimeFormParameterHasDefaultValue() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Schema requestBodySchema = ModelUtils.getSchemaFromRequestBody(openAPI.getPaths().get("/thingy/{date}").getPost().getRequestBody()); + CodegenParameter codegenParameter = codegen.fromFormProperty("visitDate", (Schema) requestBodySchema.getProperties().get("visitDate"), + new HashSet<>()); + + Assert.assertEquals(codegenParameter.defaultValue, "1971-12-19T03:39:57-08:00"); + Assert.assertEquals(codegenParameter.getSchema(), null); + } + @Test public void testOriginalOpenApiDocumentVersion() { // Test with OAS 2.0 document. diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java index 287a730518b9..38a46722e506 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java @@ -20,8 +20,13 @@ import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.*; +import java.time.OffsetDateTime; +import java.time.ZonedDateTime; +import java.util.HashSet; +import java.util.Set; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.AbstractJavaCodegen; @@ -538,10 +543,37 @@ public void snapshotVersionAlreadySnapshotTest() { Assert.assertEquals(codegen.getArtifactVersion(), "4.1.2-SNAPSHOT"); } + @Test + public void toDefaultValueDateTimeLegacyTest() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + codegen.setDateLibrary("legacy"); + String defaultValue; + + // Test default value for date format + DateSchema dateSchema = new DateSchema(); + LocalDate defaultLocalDate = LocalDate.of(2019,2,15); + Date date = Date.from(defaultLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); + dateSchema.setDefault(date); + defaultValue = codegen.toDefaultValue(dateSchema); + + // dateLibrary <> java8 + Assert.assertNull(defaultValue); + + DateTimeSchema dateTimeSchema = new DateTimeSchema(); + OffsetDateTime defaultDateTime = OffsetDateTime.parse("1984-12-19T03:39:57-08:00"); + ZonedDateTime expectedDateTime = defaultDateTime.atZoneSameInstant(ZoneId.systemDefault()); + dateTimeSchema.setDefault(defaultDateTime); + defaultValue = codegen.toDefaultValue(dateTimeSchema); + + // dateLibrary <> java8 + Assert.assertNull(defaultValue); + } @Test public void toDefaultValueTest() { final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + codegen.setDateLibrary("java8"); + Schema schema = createObjectSchemaWithMinItems(); String defaultValue = codegen.toDefaultValue(schema); @@ -579,7 +611,14 @@ public void toDefaultValueTest() { Date date = Date.from(defaultLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); dateSchema.setDefault(date); defaultValue = codegen.toDefaultValue(dateSchema); - Assert.assertEquals(defaultLocalDate, LocalDate.parse(defaultValue)); + Assert.assertEquals(defaultValue, "LocalDate.parse(\"" + defaultLocalDate.toString() + "\")"); + + DateTimeSchema dateTimeSchema = new DateTimeSchema(); + OffsetDateTime defaultDateTime = OffsetDateTime.parse("1984-12-19T03:39:57-08:00"); + ZonedDateTime expectedDateTime = defaultDateTime.atZoneSameInstant(ZoneId.systemDefault()); + dateTimeSchema.setDefault(defaultDateTime); + defaultValue = codegen.toDefaultValue(dateTimeSchema); + Assert.assertTrue(defaultValue.startsWith("OffsetDateTime.parse(\"" + expectedDateTime.toString())); // Test default value for number without format NumberSchema numberSchema = new NumberSchema(); @@ -594,6 +633,44 @@ public void toDefaultValueTest() { Assert.assertEquals(defaultValue, doubleValue + "d"); } + @Test + public void dateDefaultValueIsIsoDate() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml"); + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + codegen.setOpenAPI(openAPI); + + Set imports = new HashSet<>(); + CodegenParameter parameter = codegen.fromParameter(openAPI.getPaths().get("/thingy/{date}").getGet().getParameters().get(2), imports); + + Assert.assertEquals(parameter.dataType, "Date"); + Assert.assertEquals(parameter.isDate, true); + Assert.assertEquals(parameter.defaultValue, "1974-01-01"); + Assert.assertEquals(imports.size(), 1); + Assert.assertEquals(imports.iterator().next(), "Date"); + + Assert.assertNotNull(parameter.getSchema()); + Assert.assertEquals(parameter.getSchema().baseType, "Date"); + } + + @Test + public void dateDefaultValueIsIsoDateTime() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml"); + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + codegen.setOpenAPI(openAPI); + + Set imports = new HashSet<>(); + CodegenParameter parameter = codegen.fromParameter(openAPI.getPaths().get("/thingy/{date}").getGet().getParameters().get(1), imports); + + Assert.assertEquals(parameter.dataType, "Date"); + Assert.assertEquals(parameter.isDateTime, true); + Assert.assertEquals(parameter.defaultValue, "1973-12-19T03:39:57-08:00"); + Assert.assertEquals(imports.size(), 1); + Assert.assertEquals(imports.iterator().next(), "Date"); + + Assert.assertNotNull(parameter.getSchema()); + Assert.assertEquals(parameter.getSchema().baseType, "Date"); + } + @Test public void getTypeDeclarationGivenImportMappingTest() { final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml b/modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml index f32cd9142666..f3568d0c3ee4 100644 --- a/modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml +++ b/modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml @@ -16,6 +16,7 @@ paths: schema: type: string format: date + default: '1970-01-01' example: '2021-01-01' responses: '405': @@ -29,6 +30,7 @@ paths: visitDate: description: Updated last vist timestamp type: string + default: '1971-12-19T03:39:57-08:00' format: date-time get: operationId: get @@ -40,6 +42,7 @@ paths: schema: type: string format: date + default: '1972-01-01' example: '2021-01-01' - name: dateTime description: 'A date-time query parameter' @@ -48,6 +51,7 @@ paths: schema: type: string format: date-time + default: '1973-12-19T03:39:57-08:00' example: '1996-12-19T16:39:57-08:00' - name: X-Order-Date in: header @@ -56,6 +60,7 @@ paths: schema: type: string format: date + default: '1974-01-01' example: '2021-01-01' - name: loginDate in: cookie @@ -64,7 +69,36 @@ paths: schema: type: string format: date + default: '1975-01-01' example: '2021-01-01' responses: '200': - description: OK \ No newline at end of file + description: OK + +components: + schemas: + 'Pet': + type: object + required: + - '@type' + properties: + '@type': + type: string + default: 'Pet' + age: + type: integer + default: 4 + happy: + type: boolean + default: true + price: + type: number + default: 32000000000 + lastFeed: + type: string + format: date-time + default: '1973-12-19T03:39:57-08:00' + dateOfBirth: + type: string + format: date + default: '2021-01-01' diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 3401bb6eeb03..fb4949cca705 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -605,7 +605,7 @@ public class Example { String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None LocalDate date = LocalDate.now(); // LocalDate | None - OffsetDateTime dateTime = OffsetDateTime.parse("OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))"); // OffsetDateTime | None + OffsetDateTime dateTime = OffsetDateTime.parse("2010-02-01T10:20:10.111110+01:00"); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None try { @@ -636,7 +636,7 @@ Name | Type | Description | Notes **string** | **String**| None | [optional] **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] [default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))] + **dateTime** | **OffsetDateTime**| None | [optional] [default to 2010-02-01T10:20:10.111110+01:00] **password** | **String**| None | [optional] **paramCallback** | **String**| None | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index bb8297664059..ff6e379842e0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1238,7 +1238,7 @@ public okhttp3.Call testClientModelAsync(Client client, final ApiCallback testEndpointParametersWithHttpInfo(BigDecimal number, D * @param string None (optional) * @param binary None (optional) * @param date None (optional) - * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) + * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) * @param password None (optional) * @param paramCallback None (optional) * @param _callback The callback to be executed when the API call finishes diff --git a/samples/client/petstore/spring-cloud-date-time/.openapi-generator/FILES b/samples/client/petstore/spring-cloud-date-time/.openapi-generator/FILES index 0849e5aac50a..10fe69f96483 100644 --- a/samples/client/petstore/spring-cloud-date-time/.openapi-generator/FILES +++ b/samples/client/petstore/spring-cloud-date-time/.openapi-generator/FILES @@ -1,3 +1,4 @@ README.md pom.xml src/main/java/org/openapitools/api/DefaultApi.java +src/main/java/org/openapitools/model/Pet.java diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index 9fd2e7de5992..bbae8c5614a5 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -35,7 +35,7 @@ public interface DefaultApi { * @param date A date path parameter (required) * @param dateTime A date-time query parameter (required) * @param xOrderDate A date header parameter (required) - * @param loginDate A date cookie parameter (optional) + * @param loginDate A date cookie parameter (optional, default to 1975-01-01) * @return OK (status code 200) */ @ApiOperation( @@ -51,10 +51,10 @@ public interface DefaultApi { value = "/thingy/{date}" ) ResponseEntity get( - @ApiParam(value = "A date path parameter", required = true) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @NotNull @ApiParam(value = "A date-time query parameter", required = true) @Valid @RequestParam(value = "dateTime", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "A date header parameter", required = true) @RequestHeader(value = "X-Order-Date", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate, - @ApiParam(value = "A date cookie parameter") @CookieValue("loginDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate + @ApiParam(value = "A date path parameter", required = true, defaultValue = "1972-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @NotNull @ApiParam(value = "A date-time query parameter", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @Valid @RequestParam(value = "dateTime", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "A date header parameter", required = true, defaultValue = "1974-01-01") @RequestHeader(value = "X-Order-Date", required = true, defaultValue = "1974-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate, + @ApiParam(value = "A date cookie parameter", defaultValue = "1975-01-01") @CookieValue(name="loginDate", defaultValue = "1975-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate ); @@ -63,7 +63,7 @@ ResponseEntity get( * update with form data * * @param date A date path parameter (required) - * @param visitDate Updated last vist timestamp (optional) + * @param visitDate Updated last vist timestamp (optional, default to 1971-12-19T03:39:57-08:00) * @return Invalid input (status code 405) */ @ApiOperation( @@ -80,8 +80,8 @@ ResponseEntity get( consumes = "application/x-www-form-urlencoded" ) ResponseEntity updatePetWithForm( - @ApiParam(value = "A date path parameter", required = true) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "Updated last vist timestamp") @RequestParam(value="visitDate", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate + @ApiParam(value = "A date path parameter", required = true, defaultValue = "1970-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "Updated last vist timestamp", defaultValue = "1971-12-19T03:39:57-08:00") @RequestParam(value="visitDate", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate ); } diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 000000000000..545876e8643f --- /dev/null +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,210 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Pet + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Pet { + + @JsonProperty("@type") + private String atType = "Pet"; + + @JsonProperty("age") + private Integer age = 4; + + @JsonProperty("happy") + private Boolean happy = true; + + @JsonProperty("price") + private BigDecimal price = new BigDecimal("32000000000"); + + @JsonProperty("lastFeed") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime lastFeed = OffsetDateTime.parse("1973-12-19T11:39:57Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault())); + + @JsonProperty("dateOfBirth") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate dateOfBirth = LocalDate.parse("2021-01-01"); + + public Pet atType(String atType) { + this.atType = atType; + return this; + } + + /** + * Get atType + * @return atType + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public String getAtType() { + return atType; + } + + public void setAtType(String atType) { + this.atType = atType; + } + + public Pet age(Integer age) { + this.age = age; + return this; + } + + /** + * Get age + * @return age + */ + + @ApiModelProperty(value = "") + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public Pet happy(Boolean happy) { + this.happy = happy; + return this; + } + + /** + * Get happy + * @return happy + */ + + @ApiModelProperty(value = "") + public Boolean getHappy() { + return happy; + } + + public void setHappy(Boolean happy) { + this.happy = happy; + } + + public Pet price(BigDecimal price) { + this.price = price; + return this; + } + + /** + * Get price + * @return price + */ + @Valid + @ApiModelProperty(value = "") + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Pet lastFeed(OffsetDateTime lastFeed) { + this.lastFeed = lastFeed; + return this; + } + + /** + * Get lastFeed + * @return lastFeed + */ + @Valid + @ApiModelProperty(value = "") + public OffsetDateTime getLastFeed() { + return lastFeed; + } + + public void setLastFeed(OffsetDateTime lastFeed) { + this.lastFeed = lastFeed; + } + + public Pet dateOfBirth(LocalDate dateOfBirth) { + this.dateOfBirth = dateOfBirth; + return this; + } + + /** + * Get dateOfBirth + * @return dateOfBirth + */ + @Valid + @ApiModelProperty(value = "") + public LocalDate getDateOfBirth() { + return dateOfBirth; + } + + public void setDateOfBirth(LocalDate dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.atType, pet.atType) && + Objects.equals(this.age, pet.age) && + Objects.equals(this.happy, pet.happy) && + Objects.equals(this.price, pet.price) && + Objects.equals(this.lastFeed, pet.lastFeed) && + Objects.equals(this.dateOfBirth, pet.dateOfBirth); + } + + @Override + public int hashCode() { + return Objects.hash(atType, age, happy, price, lastFeed, dateOfBirth); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" atType: ").append(toIndentedString(atType)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" happy: ").append(toIndentedString(happy)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" lastFeed: ").append(toIndentedString(lastFeed)).append("\n"); + sb.append(" dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md index def65c4c88eb..ababec062295 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -643,7 +643,7 @@ public class Example { String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None LocalDate date = LocalDate.now(); // LocalDate | None - OffsetDateTime dateTime = OffsetDateTime.parse("OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))"); // OffsetDateTime | None + OffsetDateTime dateTime = OffsetDateTime.parse("2010-02-01T10:20:10.111110+01:00"); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None try { @@ -675,7 +675,7 @@ Name | Type | Description | Notes **string** | **String**| None | [optional] **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] [default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))] + **dateTime** | **OffsetDateTime**| None | [optional] [default to 2010-02-01T10:20:10.111110+01:00] **password** | **String**| None | [optional] **paramCallback** | **String**| None | [optional] diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java index 0b9970cb6b1c..129e896a7a3e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java @@ -639,7 +639,7 @@ public ApiResponse testClientModelWithHttpInfo(Client client) throws Api * @param string None (optional) * @param binary None (optional) * @param date None (optional) - * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) + * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) * @param password None (optional) * @param paramCallback None (optional) * @throws ApiException if fails to make API call @@ -668,7 +668,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @param string None (optional) * @param binary None (optional) * @param date None (optional) - * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) + * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) * @param password None (optional) * @param paramCallback None (optional) * @return ApiResponse<Void> diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/.openapi-generator/FILES b/samples/openapi3/client/petstore/spring-cloud-date-time/.openapi-generator/FILES index 0849e5aac50a..10fe69f96483 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/.openapi-generator/FILES @@ -1,3 +1,4 @@ README.md pom.xml src/main/java/org/openapitools/api/DefaultApi.java +src/main/java/org/openapitools/model/Pet.java diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index e849c4697f96..ed5b8f7d7843 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -42,7 +42,7 @@ public interface DefaultApi { * @param date A date path parameter (required) * @param dateTime A date-time query parameter (required) * @param xOrderDate A date header parameter (required) - * @param loginDate A date cookie parameter (optional) + * @param loginDate A date cookie parameter (optional, default to 1975-01-01) * @return OK (status code 200) */ @Operation( @@ -57,9 +57,9 @@ public interface DefaultApi { ) ResponseEntity get( @Parameter(name = "date", description = "A date path parameter", required = true) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @NotNull @Parameter(name = "dateTime", description = "A date-time query parameter", required = true) @Valid @RequestParam(value = "dateTime", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "X-Order-Date", description = "A date header parameter", required = true) @RequestHeader(value = "X-Order-Date", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate, - @Parameter(name = "loginDate", description = "A date cookie parameter") @CookieValue("loginDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate + @NotNull @Parameter(name = "dateTime", description = "A date-time query parameter", required = true) @Valid @RequestParam(value = "dateTime", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "X-Order-Date", description = "A date header parameter", required = true) @RequestHeader(value = "X-Order-Date", required = true, defaultValue = "1974-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate, + @Parameter(name = "loginDate", description = "A date cookie parameter") @CookieValue(name="loginDate", defaultValue = "1975-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate ); @@ -68,7 +68,7 @@ ResponseEntity get( * update with form data * * @param date A date path parameter (required) - * @param visitDate Updated last vist timestamp (optional) + * @param visitDate Updated last vist timestamp (optional, default to 1971-12-19T03:39:57-08:00) * @return Invalid input (status code 405) */ @Operation( diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 000000000000..ea6a030db272 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,209 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Pet + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Pet { + + @JsonProperty("@type") + private String atType = "Pet"; + + @JsonProperty("age") + private Integer age = 4; + + @JsonProperty("happy") + private Boolean happy = true; + + @JsonProperty("price") + private BigDecimal price = new BigDecimal("32000000000"); + + @JsonProperty("lastFeed") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime lastFeed = OffsetDateTime.parse("1973-12-19T11:39:57Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault())); + + @JsonProperty("dateOfBirth") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate dateOfBirth = LocalDate.parse("2021-01-01"); + + public Pet atType(String atType) { + this.atType = atType; + return this; + } + + /** + * Get atType + * @return atType + */ + @NotNull + @Schema(name = "@type", required = true) + public String getAtType() { + return atType; + } + + public void setAtType(String atType) { + this.atType = atType; + } + + public Pet age(Integer age) { + this.age = age; + return this; + } + + /** + * Get age + * @return age + */ + + @Schema(name = "age", required = false) + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public Pet happy(Boolean happy) { + this.happy = happy; + return this; + } + + /** + * Get happy + * @return happy + */ + + @Schema(name = "happy", required = false) + public Boolean getHappy() { + return happy; + } + + public void setHappy(Boolean happy) { + this.happy = happy; + } + + public Pet price(BigDecimal price) { + this.price = price; + return this; + } + + /** + * Get price + * @return price + */ + @Valid + @Schema(name = "price", required = false) + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Pet lastFeed(OffsetDateTime lastFeed) { + this.lastFeed = lastFeed; + return this; + } + + /** + * Get lastFeed + * @return lastFeed + */ + @Valid + @Schema(name = "lastFeed", required = false) + public OffsetDateTime getLastFeed() { + return lastFeed; + } + + public void setLastFeed(OffsetDateTime lastFeed) { + this.lastFeed = lastFeed; + } + + public Pet dateOfBirth(LocalDate dateOfBirth) { + this.dateOfBirth = dateOfBirth; + return this; + } + + /** + * Get dateOfBirth + * @return dateOfBirth + */ + @Valid + @Schema(name = "dateOfBirth", required = false) + public LocalDate getDateOfBirth() { + return dateOfBirth; + } + + public void setDateOfBirth(LocalDate dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.atType, pet.atType) && + Objects.equals(this.age, pet.age) && + Objects.equals(this.happy, pet.happy) && + Objects.equals(this.price, pet.price) && + Objects.equals(this.lastFeed, pet.lastFeed) && + Objects.equals(this.dateOfBirth, pet.dateOfBirth); + } + + @Override + public int hashCode() { + return Objects.hash(atType, age, happy, price, lastFeed, dateOfBirth); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" atType: ").append(toIndentedString(atType)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" happy: ").append(toIndentedString(happy)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" lastFeed: ").append(toIndentedString(lastFeed)).append("\n"); + sb.append(" dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index 72370cfbf04e..0b9d5abc30c9 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -336,7 +336,7 @@ ResponseEntity testEndpointParameters( ) ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 2e2c7056c5be..bd45a15847b7 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -333,7 +333,7 @@ ResponseEntity testEndpointParameters( ) ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index ae87691bfb1f..c48b968ffdd7 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -247,7 +247,7 @@ public ResponseEntity testEndpointParameters( */ public ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index edf8d40bf875..1d9618ba3402 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -355,7 +355,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index f56335a4cc60..1f7146f4ccf9 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -368,7 +368,7 @@ default Mono> testEndpointParameters( ) default Mono> testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 913d949c27c6..667afd829c1f 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -386,7 +386,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false) Optional enumHeaderString, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java index c5c8cb9db6b6..c05f7a3be323 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java @@ -60,12 +60,12 @@ default Optional getRequest() { produces = { "application/json" } ) default ResponseEntity headersTest( - @ApiParam(value = "", defaultValue = "11.2") @RequestHeader(value = "headerNumber", required = false) BigDecimal headerNumber, - @ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerString", required = false) String headerString, - @ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerStringWrapped", required = false) String headerStringWrapped, - @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotes", required = false) String headerStringQuotes, - @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotesWrapped", required = false) String headerStringQuotesWrapped, - @ApiParam(value = "", defaultValue = "true") @RequestHeader(value = "headerBoolean", required = false) Boolean headerBoolean + @ApiParam(value = "", defaultValue = "11.2") @RequestHeader(value = "headerNumber", required = false, defaultValue = "11.2") BigDecimal headerNumber, + @ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerString", required = false, defaultValue = "qwerty") String headerString, + @ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerStringWrapped", required = false, defaultValue = "qwerty") String headerStringWrapped, + @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotes", required = false, defaultValue = "qwerty\"with quotes\" test") String headerStringQuotes, + @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotesWrapped", required = false, defaultValue = "qwerty\"with quotes\" test") String headerStringQuotesWrapped, + @ApiParam(value = "", defaultValue = "true") @RequestHeader(value = "headerBoolean", required = false, defaultValue = "true") Boolean headerBoolean ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 7ba8b909b75c..792e526a2bcf 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -395,7 +395,7 @@ default CompletableFuture> testEndpointParameters( ) default CompletableFuture> testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 120768241aab..32e0a657f508 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -390,7 +390,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 931b578b1bb2..27ddf876c5ec 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -390,7 +390,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index cc5153750810..a1e3a9409b88 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -390,7 +390,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 931b578b1bb2..27ddf876c5ec 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -390,7 +390,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index e6e5a8971c0b..beb3bc5545be 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -337,7 +337,7 @@ ResponseEntity testEndpointParameters( ) ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index 9109f8073e97..679d98f5a4ef 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -239,7 +239,7 @@ public ResponseEntity testEndpointParameters( */ public ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 931b578b1bb2..27ddf876c5ec 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -390,7 +390,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 533c7a2f5e5d..a5333fbd9406 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -359,7 +359,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 533c7a2f5e5d..a5333fbd9406 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -359,7 +359,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 07bfb0f09ef1..e2d96056fc10 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -373,7 +373,7 @@ default Mono> testEndpointParameters( ) default Mono> testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index db66a3da6658..6d87fc1b30c5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -337,7 +337,7 @@ ResponseEntity testEndpointParameters( ) ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index a13697822953..c121c7b8e2da 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -214,7 +214,7 @@ public ResponseEntity testEndpointParameters( */ public ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 981e48b19f9e..c6cc95368d85 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -359,7 +359,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index db66a3da6658..6d87fc1b30c5 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -337,7 +337,7 @@ ResponseEntity testEndpointParameters( ) ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index f564f7010388..de3ce15a983d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -239,7 +239,7 @@ public ResponseEntity testEndpointParameters( */ public ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index cc5153750810..a1e3a9409b88 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -390,7 +390,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 2c10b623a186..4b806b0e2a7b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -390,7 +390,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) Optional enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 2debe4a30e31..b5c1ccf740ac 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -403,7 +403,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 931b578b1bb2..27ddf876c5ec 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -390,7 +390,7 @@ default ResponseEntity testEndpointParameters( ) default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, From 703c9630c28da8d4f29ade8265bb41053afe634a Mon Sep 17 00:00:00 2001 From: cachescrubber <5127753+cachescrubber@users.noreply.github.com> Date: Sat, 12 Feb 2022 08:17:58 +0100 Subject: [PATCH 041/111] [spring] various bug fixes and enhancements (#11580) * Bugfix: delay clearing *TemplateFiles with apiFirst #2407 * Bugfix: delay clearing *TemplateFiles with apiFirst #2407 (add test case) * spring api.mustache: fix unhandledException #10860 * Generate samples * add sample * Generate samples * Fixed mustache template for FormParams. Use paramName instead of baseName for variable name. This will fix an issue when parameter name is one of the reserved keywords (#7506) # Conflicts: # modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache # modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java * Move and comment apiFrst Co-authored-by: Andrii Hrytsiuk --- .github/workflows/samples-spring.yaml | 1 + .../spring-stubs-skip-default-interface.yaml | 13 + .../codegen/languages/SpringCodegen.java | 11 +- .../main/resources/JavaSpring/api.mustache | 2 +- .../resources/JavaSpring/formParams.mustache | 2 +- .../java/spring/SpringCodegenTest.java | 65 +++- .../src/test/resources/3_0/issue7506.yaml | 26 ++ .../.openapi-generator-ignore | 23 ++ .../.openapi-generator/FILES | 12 + .../.openapi-generator/VERSION | 1 + .../README.md | 27 ++ .../pom.xml | 66 ++++ .../java/org/openapitools/api/ApiUtil.java | 19 ++ .../java/org/openapitools/api/PetApi.java | 290 ++++++++++++++++++ .../java/org/openapitools/api/StoreApi.java | 153 +++++++++ .../java/org/openapitools/api/UserApi.java | 246 +++++++++++++++ .../java/org/openapitools/model/Category.java | 108 +++++++ .../openapitools/model/ModelApiResponse.java | 134 ++++++++ .../java/org/openapitools/model/Order.java | 245 +++++++++++++++ .../main/java/org/openapitools/model/Pet.java | 261 ++++++++++++++++ .../main/java/org/openapitools/model/Tag.java | 108 +++++++ .../java/org/openapitools/model/User.java | 252 +++++++++++++++ 22 files changed, 2041 insertions(+), 24 deletions(-) create mode 100644 bin/configs/spring-stubs-skip-default-interface.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/issue7506.yaml create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/README.md create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/ApiUtil.java create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java create mode 100644 samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index d266c3584821..1ef4290138e5 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -24,6 +24,7 @@ jobs: - samples/openapi3/client/petstore/spring-cloud-date-time - samples/client/petstore/spring-stubs - samples/openapi3/client/petstore/spring-stubs + - samples/openapi3/client/petstore/spring-stubs-skip-default-interface # servers - samples/server/petstore/spring-mvc - samples/server/petstore/spring-mvc-default-value diff --git a/bin/configs/spring-stubs-skip-default-interface.yaml b/bin/configs/spring-stubs-skip-default-interface.yaml new file mode 100644 index 000000000000..bb107e0bd2af --- /dev/null +++ b/bin/configs/spring-stubs-skip-default-interface.yaml @@ -0,0 +1,13 @@ +generatorName: spring +outputDir: samples/openapi3/client/petstore/spring-stubs-skip-default-interface +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + groupId: org.openapitools.openapi3 + documentationProvider: springdoc + artifactId: spring-stubs + interfaceOnly: "true" + unhandledException: true + skipDefaultInterface: true + singleContentTypes: "true" + hideGenerationTimestamp: "true" diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 5cf1b2b6dcf7..336f9ed05887 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -482,11 +482,6 @@ public void processOpts() { (sourceFolder + File.separator + apiPackage).replace(".", java.io.File.separator), "ApiUtil.java")); } - if (apiFirst) { - apiTemplateFiles.clear(); - modelTemplateFiles.clear(); - } - if ("threetenbp".equals(dateLibrary)) { supportingFiles.add(new SupportingFile("customInstantDeserializer.mustache", (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), @@ -564,6 +559,12 @@ public void processOpts() { additionalProperties.put("lambdaTrimWhitespace", new TrimWhitespaceLambda()); additionalProperties.put("lambdaSplitString", new SplitStringLambda()); + + // HEADS-UP: Do not add more template file after this block + if (apiFirst) { + apiTemplateFiles.clear(); + modelTemplateFiles.clear(); + } } @Override diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index 8de1414103c1..284c23118ed8 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -209,7 +209,7 @@ public interface {{classname}} { {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore {{/springFoxDocumentationProvider}}{{#springDocDocumentationProvider}}@ParameterObject {{/springDocDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}} - ){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} { + ){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} { {{#delegate-method}} return {{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}}); } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache index ec6cac87c51d..20d9b0c9ce76 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 604a978519a2..5868af8466da 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -17,6 +17,14 @@ package org.openapitools.codegen.java.spring; +import static java.util.stream.Collectors.groupingBy; +import static org.openapitools.codegen.TestUtils.assertFileContains; +import static org.openapitools.codegen.TestUtils.assertFileNotContains; +import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER; +import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; + import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; @@ -24,8 +32,24 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.core.models.ParseOptions; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.Map; import java.util.function.Consumer; -import org.openapitools.codegen.*; +import java.util.stream.Collectors; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.SpringCodegen; import org.openapitools.codegen.languages.features.CXFServerFeatures; import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; @@ -34,22 +58,6 @@ import org.testng.annotations.Ignore; import org.testng.annotations.Test; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import static java.util.stream.Collectors.groupingBy; -import static org.openapitools.codegen.TestUtils.assertFileContains; -import static org.openapitools.codegen.TestUtils.assertFileNotContains; -import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER; -import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; - public class SpringCodegenTest { @Test @@ -681,6 +689,19 @@ public void reactiveMapTypeRequestMonoTest() throws IOException { assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApiDelegate.java"), "Mono"); } + @Test + public void shouldEscapeReservedKeyWordsForRequestParameters_7506_Regression() throws Exception { + final SpringCodegen codegen = new SpringCodegen(); + codegen.setLibrary("spring-boot"); + codegen.setDelegatePattern(true); + + final Map files = generateFiles(codegen, "src/test/resources/3_0/issue7506.yaml"); + + final File multipartArrayApiDelegate = files.get("ExampleApi.java"); + assertFileContains(multipartArrayApiDelegate.toPath(), "@RequestPart(value = \"super\", required = false) MultipartFile _super"); + assertFileContains(multipartArrayApiDelegate.toPath(), "@RequestPart(value = \"package\", required = false) MultipartFile _package"); + } + @Test public void doGeneratePathVariableForSimpleParam() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -861,4 +882,14 @@ public Object[][] issue11464TestCases() { }; } + @Test + public void apiFirstShouldNotGenerateApiOrModel() { + final SpringCodegen codegen = new SpringCodegen(); + codegen.additionalProperties().put(SpringCodegen.API_FIRST, true); + codegen.processOpts(); + Assert.assertTrue(codegen.modelTemplateFiles().isEmpty()); + Assert.assertTrue(codegen.apiTemplateFiles().isEmpty()); + } + + } diff --git a/modules/openapi-generator/src/test/resources/3_0/issue7506.yaml b/modules/openapi-generator/src/test/resources/3_0/issue7506.yaml new file mode 100644 index 000000000000..14aeb7926b73 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue7506.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.2 +info: + title: Example + description: Example + version: 1.0.0 + +paths: + /example/api: + post: + summary: summary + operationId: description + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + super: + type: string + format: binary + package: + type: string + format: binary + responses: + 200: + description: response diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator-ignore b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.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/spring-stubs-skip-default-interface/.openapi-generator/FILES b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator/FILES new file mode 100644 index 000000000000..87837793235c --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator/FILES @@ -0,0 +1,12 @@ +README.md +pom.xml +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator/VERSION b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator/VERSION new file mode 100644 index 000000000000..5f68295fc196 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/README.md b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/README.md new file mode 100644 index 000000000000..d43a1de307df --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/README.md @@ -0,0 +1,27 @@ + +# OpenAPI generated API stub + +Spring Framework stub + + +## Overview +This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub. +This is an example of building API stub interfaces in Java using the Spring framework. + +The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints +by adding ```@Controller``` classes that implement the interface. Eg: +```java +@Controller +public class PetController implements PetApi { +// implement all PetApi methods +} +``` + +You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg: +```java +@FeignClient(name="pet", url="http://petstore.swagger.io/v2") +public interface PetClient extends PetApi { + +} +``` diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml new file mode 100644 index 000000000000..b2890ab9d519 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml @@ -0,0 +1,66 @@ + + 4.0.0 + org.openapitools.openapi3 + spring-stubs + jar + spring-stubs + 1.0.0 + + 1.8 + ${java.version} + ${java.version} + 1.6.4 + + + org.springframework.boot + spring-boot-starter-parent + 2.6.2 + + + src/main/java + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.data + spring-data-commons + + + + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.2 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/ApiUtil.java new file mode 100644 index 000000000000..1245b1dd0ccf --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/ApiUtil.java @@ -0,0 +1,19 @@ +package org.openapitools.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 000000000000..da4c50eba0ed --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,290 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "pet", description = "the pet API") +public interface PetApi { + + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid input (status code 405) + */ + @Operation( + operationId = "addPet", + summary = "Add a new pet to the store", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet", + consumes = "application/json" + ) + ResponseEntity addPet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) throws Exception; + + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + */ + @Operation( + operationId = "deletePet", + summary = "Deletes a pet", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid pet value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/pet/{petId}" + ) + ResponseEntity deletePet( + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) throws Exception; + + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + */ + @Operation( + operationId = "findPetsByStatus", + summary = "Finds Pets by status", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid status value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByStatus", + produces = "application/json" + ) + ResponseEntity> findPetsByStatus( + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status + ) throws Exception; + + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + */ + @Operation( + operationId = "findPetsByTags", + summary = "Finds Pets by tags", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid tag value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByTags", + produces = "application/json" + ) + ResponseEntity> findPetsByTags( + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + ) throws Exception; + + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + */ + @Operation( + operationId = "getPetById", + summary = "Find pet by ID", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/{petId}", + produces = "application/json" + ) + ResponseEntity getPetById( + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) throws Exception; + + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + */ + @Operation( + operationId = "updatePet", + summary = "Update an existing pet", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/pet", + consumes = "application/json" + ) + ResponseEntity updatePet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) throws Exception; + + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + */ + @Operation( + operationId = "updatePetWithForm", + summary = "Updates a pet in the store with form data", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}", + consumes = "application/x-www-form-urlencoded" + ) + ResponseEntity updatePetWithForm( + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) throws Exception; + + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "uploadFile", + summary = "uploads an image", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}/uploadImage", + produces = "application/json", + consumes = "multipart/form-data" + ) + ResponseEntity uploadFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) throws Exception; + +} diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 000000000000..0c89c7d14dd0 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,153 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.Order; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @Operation( + operationId = "deleteOrder", + summary = "Delete purchase order by ID", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/store/order/{orderId}" + ) + ResponseEntity deleteOrder( + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId + ) throws Exception; + + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "getInventory", + summary = "Returns pet inventories by status", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/inventory", + produces = "application/json" + ) + ResponseEntity> getInventory( + + ) throws Exception; + + + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @Operation( + operationId = "getOrderById", + summary = "Find purchase order by ID", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/order/{orderId}", + produces = "application/json" + ) + ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId + ) throws Exception; + + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + */ + @Operation( + operationId = "placeOrder", + summary = "Place an order for a pet", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid Order") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/store/order", + produces = "application/json" + ) + ResponseEntity placeOrder( + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) throws Exception; + +} diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 000000000000..4bcf2d7074ea --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,246 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "user", description = "the user API") +public interface UserApi { + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUser", + summary = "Create user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user" + ) + ResponseEntity createUser( + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + ) throws Exception; + + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUsersWithArrayInput", + summary = "Creates list of users with given input array", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithArray" + ) + ResponseEntity createUsersWithArrayInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) throws Exception; + + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUsersWithListInput", + summary = "Creates list of users with given input array", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithList" + ) + ResponseEntity createUsersWithListInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) throws Exception; + + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "deleteUser", + summary = "Delete user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/user/{username}" + ) + ResponseEntity deleteUser( + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) throws Exception; + + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "getUserByName", + summary = "Get user by user name", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/{username}", + produces = "application/json" + ) + ResponseEntity getUserByName( + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) throws Exception; + + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + */ + @Operation( + operationId = "loginUser", + summary = "Logs user into the system", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/login", + produces = "application/json" + ) + ResponseEntity loginUser( + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) throws Exception; + + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "logoutUser", + summary = "Logs out current logged in user session", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/logout" + ) + ResponseEntity logoutUser( + + ) throws Exception; + + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "updateUser", + summary = "Updated user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/user/{username}" + ) + ResponseEntity updateUser( + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + ) throws Exception; + +} diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 000000000000..03e4a4ce0b51 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,108 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A category for a pet + */ + +@Schema(name = "Category", description = "A category for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Category { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 000000000000..a235a99f9035 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,134 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Describes the result of uploading an image resource + */ + +@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@JsonTypeName("ApiResponse") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ModelApiResponse { + + @JsonProperty("code") + private Integer code; + + @JsonProperty("type") + private String type; + + @JsonProperty("message") + private String message; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + + @Schema(name = "code", required = false) + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @Schema(name = "type", required = false) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + + @Schema(name = "message", required = false) + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 000000000000..e624a0d7c1fe --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,245 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * An order for a pets from the pet store + */ + +@Schema(name = "Order", description = "An order for a pets from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Order { + + @JsonProperty("id") + private Long id; + + @JsonProperty("petId") + private Long petId; + + @JsonProperty("quantity") + private Integer quantity; + + @JsonProperty("shipDate") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + */ + + @Schema(name = "petId", required = false) + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + */ + + @Schema(name = "quantity", required = false) + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + */ + @Valid + @Schema(name = "shipDate", required = false) + public OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + */ + + @Schema(name = "status", description = "Order Status", required = false) + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + + @Schema(name = "complete", required = false) + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 000000000000..ddff66759bac --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,261 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A pet for sale in the pet store + */ + +@Schema(name = "Pet", description = "A pet for sale in the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Pet { + + @JsonProperty("id") + private Long id; + + @JsonProperty("category") + private Category category; + + @JsonProperty("name") + private String name; + + @JsonProperty("photoUrls") + @Valid + private List photoUrls = new ArrayList<>(); + + @JsonProperty("tags") + @Valid + private List tags = null; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @Valid + @Schema(name = "category", required = false) + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", example = "doggie", required = true) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + */ + @NotNull + @Schema(name = "photoUrls", required = true) + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @Valid + @Schema(name = "tags", required = false) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + */ + + @Schema(name = "status", description = "pet status in the store", required = false) + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 000000000000..5c3ac82ba6e8 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,108 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A tag for a pet + */ + +@Schema(name = "Tag", description = "A tag for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Tag { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java new file mode 100644 index 000000000000..328569672eb4 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,252 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A User who is purchasing from the pet store + */ + +@Schema(name = "User", description = "A User who is purchasing from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class User { + + @JsonProperty("id") + private Long id; + + @JsonProperty("username") + private String username; + + @JsonProperty("firstName") + private String firstName; + + @JsonProperty("lastName") + private String lastName; + + @JsonProperty("email") + private String email; + + @JsonProperty("password") + private String password; + + @JsonProperty("phone") + private String phone; + + @JsonProperty("userStatus") + private Integer userStatus; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + + @Schema(name = "username", required = false) + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + + @Schema(name = "firstName", required = false) + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + + @Schema(name = "lastName", required = false) + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + + @Schema(name = "email", required = false) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + + @Schema(name = "password", required = false) + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + */ + + @Schema(name = "phone", required = false) + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + */ + + @Schema(name = "userStatus", description = "User Status", required = false) + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + From 25270a038907a400ee2590a74e77223533d740e0 Mon Sep 17 00:00:00 2001 From: Oleh Kurpiak Date: Sat, 12 Feb 2022 09:23:29 +0200 Subject: [PATCH 042/111] [Java] fix deserialization of readonly properties (#11495) --- bin/configs/spring-nullable-set.yaml | 10 + .../languages/AbstractJavaCodegen.java | 7 +- .../3_0/spring/10167-nullable-set.yml | 51 ++++ pom.xml | 1 + .../.openapi-generator-ignore | 23 ++ .../.openapi-generator/FILES | 6 + .../.openapi-generator/VERSION | 1 + .../spring-boot-nullable-set/README.md | 27 ++ .../petstore/spring-boot-nullable-set/pom.xml | 66 +++++ .../java/org/openapitools/api/ApiUtil.java | 19 ++ .../org/openapitools/api/NullableApi.java | 68 +++++ .../model/ObjectWithUniqueItems.java | 262 ++++++++++++++++++ 12 files changed, 539 insertions(+), 2 deletions(-) create mode 100644 bin/configs/spring-nullable-set.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/10167-nullable-set.yml create mode 100644 samples/server/petstore/spring-boot-nullable-set/.openapi-generator-ignore create mode 100644 samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES create mode 100644 samples/server/petstore/spring-boot-nullable-set/.openapi-generator/VERSION create mode 100644 samples/server/petstore/spring-boot-nullable-set/README.md create mode 100644 samples/server/petstore/spring-boot-nullable-set/pom.xml create mode 100644 samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/ApiUtil.java create mode 100644 samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java create mode 100644 samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java diff --git a/bin/configs/spring-nullable-set.yaml b/bin/configs/spring-nullable-set.yaml new file mode 100644 index 000000000000..64122c7cf3c8 --- /dev/null +++ b/bin/configs/spring-nullable-set.yaml @@ -0,0 +1,10 @@ +generatorName: spring +library: spring-boot +outputDir: samples/server/petstore/spring-boot-nullable-set +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/10167-nullable-set.yml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: spring-boot-nullable-set + interfaceOnly: "true" + singleContentTypes: "true" + hideGenerationTimestamp: "true" \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 561a9609ba23..350e8c765fe2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -1279,8 +1279,11 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert model.imports.add("ArrayList"); } else if ("set".equals(property.containerType)) { model.imports.add("LinkedHashSet"); - model.imports.add("JsonDeserialize"); - property.vendorExtensions.put("x-setter-extra-annotation", "@JsonDeserialize(as = LinkedHashSet.class)"); + boolean canNotBeWrappedToNullable = !openApiNullable || !property.isNullable; + if (canNotBeWrappedToNullable) { + model.imports.add("JsonDeserialize"); + property.vendorExtensions.put("x-setter-extra-annotation", "@JsonDeserialize(as = LinkedHashSet.class)"); + } } else if ("map".equals(property.containerType)) { model.imports.add("HashMap"); } diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/10167-nullable-set.yml b/modules/openapi-generator/src/test/resources/3_0/spring/10167-nullable-set.yml new file mode 100644 index 000000000000..379065017e6f --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/10167-nullable-set.yml @@ -0,0 +1,51 @@ +openapi: 3.0.3 +info: + title: Api Documentation + description: 'Demo Spring Mvc @DateTimeFormat across the different openapi parameter types' + version: '1.0' +paths: + /nullable: + post: + description: nullable test + operationId: nullableTest + responses: + 204: + description: processed + 405: + description: Invalid input + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectWithUniqueItems' + +components: + schemas: + ObjectWithUniqueItems: + properties: + nullSet: + type: array + uniqueItems: true + items: + type: string + nullable: true + notNullSet: + type: array + uniqueItems: true + items: + type: string + nullList: + type: array + items: + type: string + nullable: true + notNullList: + type: array + items: + type: string + notNullDateField: + type: string + format: date-time + nullDateField: + type: string + format: date-time diff --git a/pom.xml b/pom.xml index 1e131706b47a..643d5b98329e 100644 --- a/pom.xml +++ b/pom.xml @@ -1227,6 +1227,7 @@ samples/client/petstore/spring-cloud-date-time samples/openapi3/client/petstore/spring-cloud-date-time samples/server/petstore/springboot + samples/server/petstore/spring-boot-nullable-set samples/openapi3/server/petstore/springboot samples/server/petstore/springboot-beanvalidation samples/server/petstore/springboot-useoptional diff --git a/samples/server/petstore/spring-boot-nullable-set/.openapi-generator-ignore b/samples/server/petstore/spring-boot-nullable-set/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/spring-boot-nullable-set/.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/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES b/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES new file mode 100644 index 000000000000..476018140121 --- /dev/null +++ b/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES @@ -0,0 +1,6 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/NullableApi.java +src/main/java/org/openapitools/model/ObjectWithUniqueItems.java diff --git a/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/VERSION b/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/VERSION new file mode 100644 index 000000000000..5f68295fc196 --- /dev/null +++ b/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-boot-nullable-set/README.md b/samples/server/petstore/spring-boot-nullable-set/README.md new file mode 100644 index 000000000000..d43a1de307df --- /dev/null +++ b/samples/server/petstore/spring-boot-nullable-set/README.md @@ -0,0 +1,27 @@ + +# OpenAPI generated API stub + +Spring Framework stub + + +## Overview +This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub. +This is an example of building API stub interfaces in Java using the Spring framework. + +The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints +by adding ```@Controller``` classes that implement the interface. Eg: +```java +@Controller +public class PetController implements PetApi { +// implement all PetApi methods +} +``` + +You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg: +```java +@FeignClient(name="pet", url="http://petstore.swagger.io/v2") +public interface PetClient extends PetApi { + +} +``` diff --git a/samples/server/petstore/spring-boot-nullable-set/pom.xml b/samples/server/petstore/spring-boot-nullable-set/pom.xml new file mode 100644 index 000000000000..616991b3db3d --- /dev/null +++ b/samples/server/petstore/spring-boot-nullable-set/pom.xml @@ -0,0 +1,66 @@ + + 4.0.0 + org.openapitools + spring-boot-nullable-set + jar + spring-boot-nullable-set + 1.0 + + 1.8 + ${java.version} + ${java.version} + 1.6.4 + + + org.springframework.boot + spring-boot-starter-parent + 2.6.2 + + + src/main/java + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.data + spring-data-commons + + + + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.2 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/ApiUtil.java new file mode 100644 index 000000000000..1245b1dd0ccf --- /dev/null +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/ApiUtil.java @@ -0,0 +1,19 @@ +package org.openapitools.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java new file mode 100644 index 000000000000..7406be7426c1 --- /dev/null +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java @@ -0,0 +1,68 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ObjectWithUniqueItems; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "nullable", description = "the nullable API") +public interface NullableApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /nullable + * nullable test + * + * @param objectWithUniqueItems (optional) + * @return processed (status code 204) + * or Invalid input (status code 405) + */ + @Operation( + operationId = "nullableTest", + responses = { + @ApiResponse(responseCode = "204", description = "processed"), + @ApiResponse(responseCode = "405", description = "Invalid input") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/nullable", + consumes = "application/json" + ) + default ResponseEntity nullableTest( + @Parameter(name = "ObjectWithUniqueItems", description = "", schema = @Schema(description = "")) @Valid @RequestBody(required = false) ObjectWithUniqueItems objectWithUniqueItems + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java new file mode 100644 index 000000000000..505bcb3f327e --- /dev/null +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java @@ -0,0 +1,262 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ObjectWithUniqueItems + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ObjectWithUniqueItems { + + @JsonProperty("nullSet") + @Valid + private JsonNullable> nullSet = JsonNullable.undefined(); + + @JsonProperty("notNullSet") + @Valid + private Set notNullSet = null; + + @JsonProperty("nullList") + @Valid + private JsonNullable> nullList = JsonNullable.undefined(); + + @JsonProperty("notNullList") + @Valid + private List notNullList = null; + + @JsonProperty("notNullDateField") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime notNullDateField; + + @JsonProperty("nullDateField") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime nullDateField; + + public ObjectWithUniqueItems nullSet(Set nullSet) { + this.nullSet = JsonNullable.of(nullSet); + return this; + } + + public ObjectWithUniqueItems addNullSetItem(String nullSetItem) { + if (this.nullSet == null || !this.nullSet.isPresent()) { + this.nullSet = JsonNullable.of(new LinkedHashSet<>()); + } + this.nullSet.get().add(nullSetItem); + return this; + } + + /** + * Get nullSet + * @return nullSet + */ + + @Schema(name = "nullSet", required = false) + public JsonNullable> getNullSet() { + return nullSet; + } + + public void setNullSet(JsonNullable> nullSet) { + this.nullSet = nullSet; + } + + public ObjectWithUniqueItems notNullSet(Set notNullSet) { + this.notNullSet = notNullSet; + return this; + } + + public ObjectWithUniqueItems addNotNullSetItem(String notNullSetItem) { + if (this.notNullSet == null) { + this.notNullSet = new LinkedHashSet<>(); + } + this.notNullSet.add(notNullSetItem); + return this; + } + + /** + * Get notNullSet + * @return notNullSet + */ + + @Schema(name = "notNullSet", required = false) + public Set getNotNullSet() { + return notNullSet; + } + + @JsonDeserialize(as = LinkedHashSet.class) + public void setNotNullSet(Set notNullSet) { + this.notNullSet = notNullSet; + } + + public ObjectWithUniqueItems nullList(List nullList) { + this.nullList = JsonNullable.of(nullList); + return this; + } + + public ObjectWithUniqueItems addNullListItem(String nullListItem) { + if (this.nullList == null || !this.nullList.isPresent()) { + this.nullList = JsonNullable.of(new ArrayList<>()); + } + this.nullList.get().add(nullListItem); + return this; + } + + /** + * Get nullList + * @return nullList + */ + + @Schema(name = "nullList", required = false) + public JsonNullable> getNullList() { + return nullList; + } + + public void setNullList(JsonNullable> nullList) { + this.nullList = nullList; + } + + public ObjectWithUniqueItems notNullList(List notNullList) { + this.notNullList = notNullList; + return this; + } + + public ObjectWithUniqueItems addNotNullListItem(String notNullListItem) { + if (this.notNullList == null) { + this.notNullList = new ArrayList<>(); + } + this.notNullList.add(notNullListItem); + return this; + } + + /** + * Get notNullList + * @return notNullList + */ + + @Schema(name = "notNullList", required = false) + public List getNotNullList() { + return notNullList; + } + + public void setNotNullList(List notNullList) { + this.notNullList = notNullList; + } + + public ObjectWithUniqueItems notNullDateField(OffsetDateTime notNullDateField) { + this.notNullDateField = notNullDateField; + return this; + } + + /** + * Get notNullDateField + * @return notNullDateField + */ + @Valid + @Schema(name = "notNullDateField", required = false) + public OffsetDateTime getNotNullDateField() { + return notNullDateField; + } + + public void setNotNullDateField(OffsetDateTime notNullDateField) { + this.notNullDateField = notNullDateField; + } + + public ObjectWithUniqueItems nullDateField(OffsetDateTime nullDateField) { + this.nullDateField = nullDateField; + return this; + } + + /** + * Get nullDateField + * @return nullDateField + */ + @Valid + @Schema(name = "nullDateField", required = false) + public OffsetDateTime getNullDateField() { + return nullDateField; + } + + public void setNullDateField(OffsetDateTime nullDateField) { + this.nullDateField = nullDateField; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithUniqueItems objectWithUniqueItems = (ObjectWithUniqueItems) o; + return Objects.equals(this.nullSet, objectWithUniqueItems.nullSet) && + Objects.equals(this.notNullSet, objectWithUniqueItems.notNullSet) && + Objects.equals(this.nullList, objectWithUniqueItems.nullList) && + Objects.equals(this.notNullList, objectWithUniqueItems.notNullList) && + Objects.equals(this.notNullDateField, objectWithUniqueItems.notNullDateField) && + Objects.equals(this.nullDateField, objectWithUniqueItems.nullDateField); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(nullSet, notNullSet, nullList, notNullList, notNullDateField, nullDateField); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithUniqueItems {\n"); + sb.append(" nullSet: ").append(toIndentedString(nullSet)).append("\n"); + sb.append(" notNullSet: ").append(toIndentedString(notNullSet)).append("\n"); + sb.append(" nullList: ").append(toIndentedString(nullList)).append("\n"); + sb.append(" notNullList: ").append(toIndentedString(notNullList)).append("\n"); + sb.append(" notNullDateField: ").append(toIndentedString(notNullDateField)).append("\n"); + sb.append(" nullDateField: ").append(toIndentedString(nullDateField)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + From 4c330f4ca0abf7cc1cd7909d5d20f2e1ee18d287 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 12 Feb 2022 15:24:38 +0800 Subject: [PATCH 043/111] add samples/server/petstore/spring-boot-nullable-set to github workflow --- .github/workflows/samples-spring.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index 1ef4290138e5..6f8ac8537980 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -41,6 +41,7 @@ jobs: - samples/openapi3/server/petstore/springboot-implicitHeaders - samples/server/petstore/springboot-delegate - samples/openapi3/server/petstore/springboot-delegate + - samples/server/petstore/spring-boot-nullable-set steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 From b01bcfecded12ef7372e8c5404312f3bcddd26f2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 12 Feb 2022 16:52:54 +0800 Subject: [PATCH 044/111] [Groovy] add Groovy client tests to Github workflow (#11593) * add samples/server/petstore/spring-boot-nullable-set to github workflow * test groovy client in github workflow * rename --- .github/workflows/samples-groovy.yaml | 45 +++++++++++++++++++++++++++ .github/workflows/samples-spring.yaml | 1 + 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/samples-groovy.yaml diff --git a/.github/workflows/samples-groovy.yaml b/.github/workflows/samples-groovy.yaml new file mode 100644 index 000000000000..06fe5cc117f7 --- /dev/null +++ b/.github/workflows/samples-groovy.yaml @@ -0,0 +1,45 @@ +name: Samples Groovy + +on: + push: + paths: + - 'samples/client/petstore/groovy**' + pull_request: + paths: + - 'samples/client/petstore/groovy**' + +env: + GRADLE_VERSION: 6.9 + +jobs: + build: + name: Build Groovy + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + - samples/client/petstore/groovy + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 8 + - name: Cache maven dependencies + uses: actions/cache@v2.1.7 + env: + cache-name: maven-repository + with: + path: | + ~/.gradle + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Install Gradle wrapper + uses: eskatos/gradle-command-action@v2 + with: + gradle-version: ${{ env.GRADLE_VERSION }} + build-root-directory: ${{ matrix.sample }} + arguments: wrapper + - name: Build + working-directory: ${{ matrix.sample }} + run: ./gradlew build -x test diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index 1ef4290138e5..6f8ac8537980 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -41,6 +41,7 @@ jobs: - samples/openapi3/server/petstore/springboot-implicitHeaders - samples/server/petstore/springboot-delegate - samples/openapi3/server/petstore/springboot-delegate + - samples/server/petstore/spring-boot-nullable-set steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 From 0ed147e7a453c33f505d800a83452730047edac9 Mon Sep 17 00:00:00 2001 From: cachescrubber <5127753+cachescrubber@users.noreply.github.com> Date: Sat, 12 Feb 2022 10:25:21 +0100 Subject: [PATCH 045/111] Implement Source DocumentationProvider, `spring-mvc` decommission (#11531) * - Upgrade swagger-ui to 4.4.1 - Bring homeController.mustache up-to-date - Main class is now OpenApiGeneratorApplication - Introduce SpringBootTest.mustache - Remove option swaggerDocketConfig/openapiDocketConfig in favor of documentationProvider. * Generate Samples * Restore generator-online classes Fix spring-mvc builds * Generate Samples * Do not generate SpringFoxConfiguration.java when reactive ist set. * Fix generation of SpringFoxConfiguration * Generate Documentation * Reactive support: add dependency management for springdoc-openapi-webflux-ui * Generate Samples * Change SpringBootApplication to OpenApiGeneratorApplication * Generate Samples * Implement SwaggerUIFeatures in SpringCodegen * Generate Samples * Add useSwaggerUI: true to some test configs * Generate Samples * Update Documentation * Update Documentation * Update README.mustache * Generate Samples * useSwaggerUI is true by default * Generate Samples * Update Documentation * Add deprecation warnings to cli opts; Log a deprecation warning * Update Documentation * Generate Samples * Remove spring-mvc library * Remove spring-mvc from project and CI configs * Check whether the selected documentation provider requires us to boostrap swagger-ui. * Generate Samples * Generate samples * Generate samples * Generate samples --- .github/.test/samples.json | 18 - .github/workflows/samples-spring.yaml | 4 - bin/configs/spring-boot-beanvalidation.yaml | 1 + bin/configs/spring-boot-source.yaml | 10 + bin/configs/spring-boot-springdoc.yaml | 1 + bin/configs/spring-mvc-default-values.yaml | 8 - bin/configs/spring-mvc-j8-async.yaml | 12 - bin/configs/spring-mvc-j8-localdatetime.yaml | 12 - bin/configs/spring-mvc-no-nullable.yaml | 11 - ...g-mvc-petstore-server-spring-pageable.yaml | 9 - bin/configs/spring-mvc.yaml | 14 - docs/generators/java-camel.md | 6 +- docs/generators/spring.md | 6 +- .../languages/JavaCamelServerCodegen.java | 2 +- .../codegen/languages/SpringCodegen.java | 109 +- .../BeanValidationExtendedFeatures.java | 4 +- .../features/BeanValidationFeatures.java | 4 +- .../languages/features/CXFServerFeatures.java | 22 +- .../DocumentationProviderFeatures.java | 2 +- .../languages/features/GzipFeatures.java | 4 +- .../languages/features/GzipTestFeatures.java | 4 +- .../languages/features/JbossFeature.java | 4 +- .../languages/features/LoggingFeatures.java | 4 +- .../features/LoggingTestFeatures.java | 5 +- .../PerformBeanValidationFeatures.java | 4 +- .../languages/features/SpringFeatures.java | 13 +- .../languages/features/SwaggerFeatures.java | 4 +- .../languages/features/SwaggerUIFeatures.java | 6 +- .../features/UseGenericResponseFeatures.java | 4 +- .../JavaSpring/homeController.mustache | 53 +- .../libraries/spring-boot/README.mustache | 33 +- .../spring-boot/SpringBootTest.mustache | 13 + .../spring-boot/application.mustache | 3 - .../spring-boot/openapi2SpringBoot.mustache | 63 +- .../libraries/spring-boot/pom.mustache | 34 +- .../libraries/spring-boot/swagger-ui.mustache | 60 + .../libraries/spring-mvc/README.mustache | 14 - .../spring-mvc/RFC3339DateFormat.mustache | 38 - .../libraries/spring-mvc/application.mustache | 3 - .../spring-mvc/defaultBasePath.mustache | 1 - .../openapiUiConfiguration.mustache | 126 - .../libraries/spring-mvc/pom.mustache | 303 --- .../spring-mvc/webApplication.mustache | 23 - .../spring-mvc/webMvcConfiguration.mustache | 13 - .../openapiDocumentationConfig.mustache | 2 +- .../java/spring/SpringCodegenTest.java | 6 +- pom.xml | 16 - samples/client/petstore/spring-stubs/pom.xml | 15 + .../pom.xml | 8 +- .../client/petstore/spring-stubs/pom.xml | 8 +- .../.openapi-generator/FILES | 3 +- .../petstore/spring-boot-springdoc/README.md | 9 +- .../petstore/spring-boot-springdoc/pom.xml | 9 +- .../org/openapitools/OpenAPI2SpringBoot.java | 63 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 42 +- .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 3 +- .../README.md | 9 +- .../pom.xml | 8 +- .../org/openapitools/OpenAPI2SpringBoot.java | 58 - .../OpenApiGeneratorApplication.java | 17 + .../configuration/HomeController.java | 39 +- .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 3 +- .../petstore/springboot-delegate/README.md | 9 +- .../petstore/springboot-delegate/pom.xml | 8 +- .../org/openapitools/OpenAPI2SpringBoot.java | 63 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 39 +- .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 3 +- .../springboot-implicitHeaders/README.md | 9 +- .../springboot-implicitHeaders/pom.xml | 8 +- .../org/openapitools/OpenAPI2SpringBoot.java | 63 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 39 +- .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 3 +- .../petstore/springboot-reactive/README.md | 10 +- .../petstore/springboot-reactive/pom.xml | 10 +- .../org/openapitools/OpenAPI2SpringBoot.java | 63 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 40 +- .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator-ignore | 0 .../.openapi-generator/FILES | 22 + .../.openapi-generator/VERSION | 0 .../petstore/springboot-source}/README.md | 7 +- .../petstore/springboot-source}/pom.xml | 28 +- .../OpenApiGeneratorApplication.java | 23 + .../org/openapitools/RFC3339DateFormat.java | 0 .../java/org/openapitools/api/ApiUtil.java | 0 .../java/org/openapitools/api/PetApi.java | 210 +- .../openapitools/api/PetApiController.java | 2 +- .../java/org/openapitools/api/StoreApi.java | 68 +- .../openapitools/api/StoreApiController.java | 2 +- .../java/org/openapitools/api/UserApi.java | 119 +- .../openapitools/api/UserApiController.java | 2 +- .../configuration/HomeController.java | 61 + .../java/org/openapitools/model/Category.java | 10 +- .../openapitools/model/ModelApiResponse.java | 7 +- .../java/org/openapitools/model/Order.java | 10 +- .../main/java/org/openapitools/model/Pet.java | 10 +- .../main/java/org/openapitools/model/Tag.java | 6 +- .../java/org/openapitools/model/User.java | 12 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/openapi.yaml | 893 +++++++ .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 3 +- .../petstore/springboot-useoptional/README.md | 9 +- .../petstore/springboot-useoptional/pom.xml | 8 +- .../org/openapitools/OpenAPI2SpringBoot.java | 63 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 39 +- .../OpenApiGeneratorApplicationTests.java | 13 + .../springboot/.openapi-generator/FILES | 3 +- .../server/petstore/springboot/README.md | 9 +- .../server/petstore/springboot/pom.xml | 8 +- .../org/openapitools/OpenAPI2SpringBoot.java | 63 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 39 +- .../OpenApiGeneratorApplicationTests.java | 13 + .../java-camel/.openapi-generator/FILES | 2 +- .../org/openapitools/OpenAPI2SpringBoot.java | 63 - .../OpenApiGeneratorApplication.java | 23 + .../swagger/OpenAPIDocumentationConfig.java | 61 - .../.openapi-generator/FILES | 1 - .../petstore/spring-boot-nullable-set/pom.xml | 8 +- .../org/openapitools/api/NullableApi.java | 2 +- .../.openapi-generator/FILES | 13 - .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../org/openapitools/api/TestHeadersApi.java | 83 - .../api/TestHeadersApiController.java | 27 - .../openapitools/api/TestQueryParamsApi.java | 83 - .../api/TestQueryParamsApiController.java | 27 - .../configuration/HomeController.java | 19 - .../OpenAPIDocumentationConfig.java | 70 - .../org/openapitools/model/TestResponse.java | 157 -- .../src/main/resources/openapi.yaml | 170 -- .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 70 - .../.openapi-generator/VERSION | 1 - .../petstore/spring-mvc-j8-async/README.md | 12 - .../petstore/spring-mvc-j8-async/pom.xml | 178 -- .../org/openapitools/api/AnotherFakeApi.java | 76 - .../api/AnotherFakeApiController.java | 27 - .../org/openapitools/api/ApiException.java | 10 - .../org/openapitools/api/ApiOriginFilter.java | 27 - .../openapitools/api/ApiResponseMessage.java | 69 - .../java/org/openapitools/api/ApiUtil.java | 19 - .../java/org/openapitools/api/FakeApi.java | 593 ----- .../openapitools/api/FakeApiController.java | 27 - .../api/FakeClassnameTestApi.java | 79 - .../api/FakeClassnameTestApiController.java | 27 - .../openapitools/api/NotFoundException.java | 10 - .../java/org/openapitools/api/PetApi.java | 402 --- .../java/org/openapitools/api/StoreApi.java | 195 -- .../openapitools/api/StoreApiController.java | 27 - .../java/org/openapitools/api/UserApi.java | 288 --- .../openapitools/api/UserApiController.java | 27 - .../configuration/HomeController.java | 19 - .../OpenAPIDocumentationConfig.java | 70 - .../configuration/OpenAPIUiConfiguration.java | 101 - .../configuration/RFC3339DateFormat.java | 38 - .../SwaggerDocumentationConfig.java | 42 - .../configuration/SwaggerUiConfiguration.java | 79 - .../configuration/WebApplication.java | 23 - .../configuration/WebMvcConfiguration.java | 13 - .../model/AdditionalPropertiesAnyType.java | 88 - .../model/AdditionalPropertiesArray.java | 89 - .../model/AdditionalPropertiesBoolean.java | 88 - .../model/AdditionalPropertiesClass.java | 400 --- .../model/AdditionalPropertiesInteger.java | 88 - .../model/AdditionalPropertiesNumber.java | 89 - .../model/AdditionalPropertiesObject.java | 88 - .../model/AdditionalPropertiesString.java | 88 - .../java/org/openapitools/model/Animal.java | 116 - .../org/openapitools/model/AnimalFarm.java | 52 - .../model/ArrayOfArrayOfNumberOnly.java | 96 - .../openapitools/model/ArrayOfNumberOnly.java | 96 - .../org/openapitools/model/ArrayTest.java | 162 -- .../java/org/openapitools/model/BigCat.java | 128 - .../org/openapitools/model/BigCatAllOf.java | 126 - .../openapitools/model/Capitalization.java | 204 -- .../main/java/org/openapitools/model/Cat.java | 88 - .../java/org/openapitools/model/CatAllOf.java | 86 - .../java/org/openapitools/model/Category.java | 108 - .../org/openapitools/model/ClassModel.java | 85 - .../java/org/openapitools/model/Client.java | 84 - .../main/java/org/openapitools/model/Dog.java | 88 - .../java/org/openapitools/model/DogAllOf.java | 86 - .../org/openapitools/model/EnumArrays.java | 190 -- .../org/openapitools/model/EnumClass.java | 57 - .../java/org/openapitools/model/EnumTest.java | 328 --- .../java/org/openapitools/model/File.java | 85 - .../model/FileSchemaTestClass.java | 120 - .../org/openapitools/model/FormatTest.java | 416 --- .../openapitools/model/HasOnlyReadOnly.java | 110 - .../java/org/openapitools/model/MapTest.java | 231 -- ...ropertiesAndAdditionalPropertiesClass.java | 149 -- .../openapitools/model/Model200Response.java | 111 - .../org/openapitools/model/ModelFile.java | 85 - .../org/openapitools/model/ModelList.java | 86 - .../org/openapitools/model/ModelReturn.java | 87 - .../java/org/openapitools/model/Name.java | 157 -- .../org/openapitools/model/NumberOnly.java | 85 - .../openapitools/model/OuterComposite.java | 133 - .../org/openapitools/model/OuterEnum.java | 57 - .../main/java/org/openapitools/model/Pet.java | 265 -- .../org/openapitools/model/ReadOnlyFirst.java | 108 - .../openapitools/model/SpecialModelName.java | 86 - .../openapitools/model/StringBooleanMap.java | 51 - .../main/java/org/openapitools/model/Tag.java | 108 - .../openapitools/model/TypeHolderDefault.java | 189 -- .../openapitools/model/TypeHolderExample.java | 213 -- .../java/org/openapitools/model/User.java | 252 -- .../java/org/openapitools/model/XmlItem.java | 840 ------ .../src/main/resources/application.properties | 1 - .../src/main/resources/openapi.properties | 2 - .../src/main/resources/openapi.yaml | 2264 ----------------- .../src/main/resources/swagger.properties | 2 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 70 - .../.openapi-generator/VERSION | 1 - .../spring-mvc-j8-localdatetime/README.md | 12 - .../spring-mvc-j8-localdatetime/pom.xml | 178 -- .../org/openapitools/api/AnotherFakeApi.java | 73 - .../api/AnotherFakeApiController.java | 27 - .../org/openapitools/api/ApiException.java | 10 - .../org/openapitools/api/ApiOriginFilter.java | 27 - .../openapitools/api/ApiResponseMessage.java | 69 - .../java/org/openapitools/api/ApiUtil.java | 19 - .../java/org/openapitools/api/FakeApi.java | 586 ----- .../openapitools/api/FakeApiController.java | 27 - .../api/FakeClassnameTestApi.java | 76 - .../api/FakeClassnameTestApiController.java | 27 - .../openapitools/api/NotFoundException.java | 10 - .../java/org/openapitools/api/PetApi.java | 393 --- .../openapitools/api/PetApiController.java | 27 - .../java/org/openapitools/api/UserApi.java | 285 --- .../configuration/HomeController.java | 19 - .../OpenAPIDocumentationConfig.java | 70 - .../configuration/OpenAPIUiConfiguration.java | 101 - .../configuration/RFC3339DateFormat.java | 38 - .../SwaggerDocumentationConfig.java | 42 - .../configuration/SwaggerUiConfiguration.java | 79 - .../configuration/WebApplication.java | 23 - .../configuration/WebMvcConfiguration.java | 13 - .../model/AdditionalPropertiesAnyType.java | 88 - .../model/AdditionalPropertiesArray.java | 89 - .../model/AdditionalPropertiesBoolean.java | 88 - .../model/AdditionalPropertiesClass.java | 400 --- .../model/AdditionalPropertiesInteger.java | 88 - .../model/AdditionalPropertiesNumber.java | 89 - .../model/AdditionalPropertiesObject.java | 88 - .../model/AdditionalPropertiesString.java | 88 - .../java/org/openapitools/model/Animal.java | 116 - .../org/openapitools/model/AnimalFarm.java | 52 - .../model/ArrayOfArrayOfNumberOnly.java | 96 - .../openapitools/model/ArrayOfNumberOnly.java | 96 - .../org/openapitools/model/ArrayTest.java | 162 -- .../java/org/openapitools/model/BigCat.java | 128 - .../org/openapitools/model/BigCatAllOf.java | 126 - .../openapitools/model/Capitalization.java | 204 -- .../main/java/org/openapitools/model/Cat.java | 88 - .../java/org/openapitools/model/CatAllOf.java | 86 - .../org/openapitools/model/ClassModel.java | 85 - .../java/org/openapitools/model/Client.java | 84 - .../main/java/org/openapitools/model/Dog.java | 88 - .../java/org/openapitools/model/DogAllOf.java | 86 - .../org/openapitools/model/EnumArrays.java | 190 -- .../org/openapitools/model/EnumClass.java | 57 - .../java/org/openapitools/model/EnumTest.java | 328 --- .../java/org/openapitools/model/File.java | 85 - .../model/FileSchemaTestClass.java | 120 - .../org/openapitools/model/FormatTest.java | 416 --- .../openapitools/model/HasOnlyReadOnly.java | 110 - .../java/org/openapitools/model/MapTest.java | 231 -- ...ropertiesAndAdditionalPropertiesClass.java | 149 -- .../openapitools/model/Model200Response.java | 111 - .../openapitools/model/ModelApiResponse.java | 134 - .../org/openapitools/model/ModelFile.java | 85 - .../org/openapitools/model/ModelList.java | 86 - .../org/openapitools/model/ModelReturn.java | 87 - .../java/org/openapitools/model/Name.java | 157 -- .../org/openapitools/model/NumberOnly.java | 85 - .../java/org/openapitools/model/Order.java | 245 -- .../openapitools/model/OuterComposite.java | 133 - .../org/openapitools/model/OuterEnum.java | 57 - .../main/java/org/openapitools/model/Pet.java | 265 -- .../org/openapitools/model/ReadOnlyFirst.java | 108 - .../openapitools/model/SpecialModelName.java | 86 - .../openapitools/model/StringBooleanMap.java | 51 - .../openapitools/model/TypeHolderDefault.java | 189 -- .../openapitools/model/TypeHolderExample.java | 213 -- .../java/org/openapitools/model/XmlItem.java | 840 ------ .../src/main/resources/application.properties | 1 - .../src/main/resources/openapi.properties | 2 - .../src/main/resources/openapi.yaml | 2264 ----------------- .../src/main/resources/swagger.properties | 2 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 70 - .../.openapi-generator/VERSION | 1 - .../petstore/spring-mvc-no-nullable/README.md | 12 - .../petstore/spring-mvc-no-nullable/pom.xml | 172 -- .../org/openapitools/api/AnotherFakeApi.java | 73 - .../api/AnotherFakeApiController.java | 27 - .../java/org/openapitools/api/ApiUtil.java | 19 - .../java/org/openapitools/api/FakeApi.java | 586 ----- .../openapitools/api/FakeApiController.java | 27 - .../api/FakeClassnameTestApi.java | 76 - .../api/FakeClassnameTestApiController.java | 27 - .../openapitools/api/PetApiController.java | 27 - .../java/org/openapitools/api/StoreApi.java | 190 -- .../openapitools/api/StoreApiController.java | 27 - .../openapitools/api/UserApiController.java | 27 - .../configuration/HomeController.java | 19 - .../OpenAPIDocumentationConfig.java | 70 - .../configuration/OpenAPIUiConfiguration.java | 100 - .../configuration/RFC3339DateFormat.java | 38 - .../configuration/WebApplication.java | 23 - .../configuration/WebMvcConfiguration.java | 13 - .../model/AdditionalPropertiesAnyType.java | 87 - .../model/AdditionalPropertiesArray.java | 88 - .../model/AdditionalPropertiesBoolean.java | 87 - .../model/AdditionalPropertiesClass.java | 399 --- .../model/AdditionalPropertiesInteger.java | 87 - .../model/AdditionalPropertiesNumber.java | 88 - .../model/AdditionalPropertiesObject.java | 87 - .../model/AdditionalPropertiesString.java | 87 - .../java/org/openapitools/model/Animal.java | 115 - .../model/ArrayOfArrayOfNumberOnly.java | 95 - .../openapitools/model/ArrayOfNumberOnly.java | 95 - .../org/openapitools/model/ArrayTest.java | 161 -- .../java/org/openapitools/model/BigCat.java | 127 - .../org/openapitools/model/BigCatAllOf.java | 125 - .../openapitools/model/Capitalization.java | 203 -- .../main/java/org/openapitools/model/Cat.java | 87 - .../java/org/openapitools/model/CatAllOf.java | 85 - .../java/org/openapitools/model/Category.java | 107 - .../org/openapitools/model/ClassModel.java | 84 - .../java/org/openapitools/model/Client.java | 83 - .../main/java/org/openapitools/model/Dog.java | 87 - .../java/org/openapitools/model/DogAllOf.java | 85 - .../org/openapitools/model/EnumArrays.java | 189 -- .../org/openapitools/model/EnumClass.java | 56 - .../java/org/openapitools/model/EnumTest.java | 327 --- .../java/org/openapitools/model/File.java | 84 - .../model/FileSchemaTestClass.java | 119 - .../org/openapitools/model/FormatTest.java | 415 --- .../openapitools/model/HasOnlyReadOnly.java | 109 - .../java/org/openapitools/model/MapTest.java | 230 -- ...ropertiesAndAdditionalPropertiesClass.java | 148 -- .../openapitools/model/Model200Response.java | 110 - .../openapitools/model/ModelApiResponse.java | 133 - .../org/openapitools/model/ModelFile.java | 84 - .../org/openapitools/model/ModelList.java | 85 - .../org/openapitools/model/ModelReturn.java | 86 - .../java/org/openapitools/model/Name.java | 156 -- .../org/openapitools/model/NumberOnly.java | 84 - .../java/org/openapitools/model/Order.java | 244 -- .../openapitools/model/OuterComposite.java | 132 - .../org/openapitools/model/OuterEnum.java | 56 - .../main/java/org/openapitools/model/Pet.java | 267 -- .../org/openapitools/model/ReadOnlyFirst.java | 107 - .../openapitools/model/SpecialModelName.java | 85 - .../main/java/org/openapitools/model/Tag.java | 107 - .../openapitools/model/TypeHolderDefault.java | 191 -- .../openapitools/model/TypeHolderExample.java | 215 -- .../java/org/openapitools/model/User.java | 251 -- .../java/org/openapitools/model/XmlItem.java | 839 ------ .../src/main/resources/application.properties | 1 - .../src/main/resources/openapi.yaml | 2264 ----------------- .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 68 - .../.openapi-generator/VERSION | 1 - .../spring-mvc-spring-pageable/README.md | 12 - .../spring-mvc-spring-pageable/pom.xml | 178 -- .../org/openapitools/api/AnotherFakeApi.java | 73 - .../api/AnotherFakeApiController.java | 27 - .../java/org/openapitools/api/ApiUtil.java | 19 - .../java/org/openapitools/api/FakeApi.java | 586 ----- .../openapitools/api/FakeApiController.java | 27 - .../api/FakeClassnameTestApi.java | 76 - .../api/FakeClassnameTestApiController.java | 27 - .../java/org/openapitools/api/PetApi.java | 396 --- .../openapitools/api/PetApiController.java | 27 - .../java/org/openapitools/api/StoreApi.java | 190 -- .../openapitools/api/StoreApiController.java | 27 - .../java/org/openapitools/api/UserApi.java | 285 --- .../openapitools/api/UserApiController.java | 27 - .../configuration/HomeController.java | 19 - .../OpenAPIDocumentationConfig.java | 70 - .../configuration/OpenAPIUiConfiguration.java | 101 - .../configuration/RFC3339DateFormat.java | 38 - .../configuration/WebApplication.java | 23 - .../configuration/WebMvcConfiguration.java | 13 - .../model/AdditionalPropertiesAnyType.java | 88 - .../model/AdditionalPropertiesArray.java | 89 - .../model/AdditionalPropertiesBoolean.java | 88 - .../model/AdditionalPropertiesClass.java | 400 --- .../model/AdditionalPropertiesInteger.java | 88 - .../model/AdditionalPropertiesNumber.java | 89 - .../model/AdditionalPropertiesObject.java | 88 - .../model/AdditionalPropertiesString.java | 88 - .../java/org/openapitools/model/Animal.java | 115 - .../model/ArrayOfArrayOfNumberOnly.java | 96 - .../openapitools/model/ArrayOfNumberOnly.java | 96 - .../org/openapitools/model/ArrayTest.java | 162 -- .../openapitools/model/Capitalization.java | 204 -- .../main/java/org/openapitools/model/Cat.java | 88 - .../java/org/openapitools/model/CatAllOf.java | 86 - .../java/org/openapitools/model/Category.java | 108 - .../org/openapitools/model/ClassModel.java | 85 - .../java/org/openapitools/model/Client.java | 84 - .../main/java/org/openapitools/model/Dog.java | 88 - .../java/org/openapitools/model/DogAllOf.java | 86 - .../org/openapitools/model/EnumArrays.java | 190 -- .../org/openapitools/model/EnumClass.java | 57 - .../java/org/openapitools/model/EnumTest.java | 328 --- .../java/org/openapitools/model/File.java | 85 - .../model/FileSchemaTestClass.java | 120 - .../org/openapitools/model/FormatTest.java | 416 --- .../openapitools/model/HasOnlyReadOnly.java | 110 - .../java/org/openapitools/model/MapTest.java | 231 -- ...ropertiesAndAdditionalPropertiesClass.java | 149 -- .../openapitools/model/Model200Response.java | 111 - .../openapitools/model/ModelApiResponse.java | 134 - .../org/openapitools/model/ModelFile.java | 85 - .../org/openapitools/model/ModelList.java | 86 - .../org/openapitools/model/ModelReturn.java | 87 - .../java/org/openapitools/model/Name.java | 157 -- .../org/openapitools/model/NumberOnly.java | 85 - .../java/org/openapitools/model/Order.java | 245 -- .../openapitools/model/OuterComposite.java | 133 - .../org/openapitools/model/OuterEnum.java | 57 - .../org/openapitools/model/ReadOnlyFirst.java | 108 - .../openapitools/model/SpecialModelName.java | 86 - .../main/java/org/openapitools/model/Tag.java | 108 - .../openapitools/model/TypeHolderDefault.java | 189 -- .../openapitools/model/TypeHolderExample.java | 213 -- .../java/org/openapitools/model/User.java | 252 -- .../java/org/openapitools/model/XmlItem.java | 840 ------ .../src/main/resources/application.properties | 1 - .../src/main/resources/openapi.yaml | 2248 ---------------- .../spring-mvc/.openapi-generator-ignore | 23 - .../spring-mvc/.openapi-generator/FILES | 70 - .../spring-mvc/.openapi-generator/VERSION | 1 - samples/server/petstore/spring-mvc/README.md | 12 - samples/server/petstore/spring-mvc/pom.xml | 178 -- .../org/openapitools/api/AnotherFakeApi.java | 73 - .../api/AnotherFakeApiController.java | 27 - .../java/org/openapitools/api/ApiUtil.java | 19 - .../java/org/openapitools/api/FakeApi.java | 586 ----- .../openapitools/api/FakeApiController.java | 27 - .../api/FakeClassnameTestApi.java | 76 - .../api/FakeClassnameTestApiController.java | 27 - .../java/org/openapitools/api/PetApi.java | 393 --- .../openapitools/api/PetApiController.java | 27 - .../java/org/openapitools/api/StoreApi.java | 190 -- .../openapitools/api/StoreApiController.java | 27 - .../java/org/openapitools/api/UserApi.java | 285 --- .../openapitools/api/UserApiController.java | 27 - .../configuration/HomeController.java | 19 - .../OpenAPIDocumentationConfig.java | 70 - .../configuration/OpenAPIUiConfiguration.java | 101 - .../configuration/RFC3339DateFormat.java | 38 - .../configuration/WebApplication.java | 23 - .../configuration/WebMvcConfiguration.java | 13 - .../model/AdditionalPropertiesAnyType.java | 90 - .../model/AdditionalPropertiesArray.java | 91 - .../model/AdditionalPropertiesBoolean.java | 90 - .../model/AdditionalPropertiesClass.java | 402 --- .../model/AdditionalPropertiesInteger.java | 90 - .../model/AdditionalPropertiesNumber.java | 91 - .../model/AdditionalPropertiesObject.java | 90 - .../model/AdditionalPropertiesString.java | 90 - .../java/org/openapitools/model/Animal.java | 118 - .../org/openapitools/model/AnimalFarm.java | 52 - .../model/ArrayOfArrayOfNumberOnly.java | 98 - .../openapitools/model/ArrayOfNumberOnly.java | 98 - .../org/openapitools/model/ArrayTest.java | 164 -- .../java/org/openapitools/model/BigCat.java | 131 - .../org/openapitools/model/BigCatAllOf.java | 129 - .../openapitools/model/Capitalization.java | 206 -- .../main/java/org/openapitools/model/Cat.java | 90 - .../java/org/openapitools/model/CatAllOf.java | 88 - .../java/org/openapitools/model/Category.java | 110 - .../org/openapitools/model/ClassModel.java | 87 - .../java/org/openapitools/model/Client.java | 86 - .../main/java/org/openapitools/model/Dog.java | 90 - .../java/org/openapitools/model/DogAllOf.java | 88 - .../org/openapitools/model/EnumArrays.java | 194 -- .../org/openapitools/model/EnumClass.java | 58 - .../java/org/openapitools/model/EnumTest.java | 334 --- .../java/org/openapitools/model/File.java | 87 - .../model/FileSchemaTestClass.java | 122 - .../org/openapitools/model/FormatTest.java | 418 --- .../openapitools/model/HasOnlyReadOnly.java | 112 - .../java/org/openapitools/model/MapTest.java | 234 -- ...ropertiesAndAdditionalPropertiesClass.java | 151 -- .../openapitools/model/Model200Response.java | 113 - .../openapitools/model/ModelApiResponse.java | 136 - .../org/openapitools/model/ModelFile.java | 87 - .../org/openapitools/model/ModelList.java | 88 - .../org/openapitools/model/ModelReturn.java | 89 - .../java/org/openapitools/model/Name.java | 159 -- .../org/openapitools/model/NumberOnly.java | 87 - .../java/org/openapitools/model/Order.java | 248 -- .../openapitools/model/OuterComposite.java | 135 - .../org/openapitools/model/OuterEnum.java | 58 - .../main/java/org/openapitools/model/Pet.java | 268 -- .../org/openapitools/model/ReadOnlyFirst.java | 110 - .../openapitools/model/SpecialModelName.java | 88 - .../openapitools/model/StringBooleanMap.java | 51 - .../main/java/org/openapitools/model/Tag.java | 110 - .../openapitools/model/TypeHolderDefault.java | 191 -- .../openapitools/model/TypeHolderExample.java | 215 -- .../java/org/openapitools/model/User.java | 254 -- .../java/org/openapitools/model/XmlItem.java | 842 ------ .../src/main/resources/application.properties | 1 - .../src/main/resources/openapi.yaml | 2264 ----------------- .../.openapi-generator/FILES | 5 +- .../README.md | 15 +- .../pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 52 - .../OpenApiGeneratorApplication.java | 17 + .../configuration/HomeController.java | 15 +- .../OpenAPIDocumentationConfig.java | 69 - .../SpringFoxConfiguration.java} | 5 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 4 +- .../springboot-beanvalidation/README.md | 15 +- .../springboot-beanvalidation/pom.xml | 5 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 10 +- .../SpringFoxConfiguration.java} | 5 +- .../src/main/resources/application.properties | 1 - .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 5 +- .../petstore/springboot-delegate-j8/README.md | 15 +- .../petstore/springboot-delegate-j8/pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- .../SpringFoxConfiguration.java} | 5 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 5 +- .../petstore/springboot-delegate/README.md | 15 +- .../petstore/springboot-delegate/pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- .../SpringFoxConfiguration.java} | 5 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 5 +- .../springboot-implicitHeaders/README.md | 15 +- .../springboot-implicitHeaders/pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- .../configuration/SpringFoxConfiguration.java | 71 + .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 4 +- .../petstore/springboot-reactive/README.md | 16 +- .../petstore/springboot-reactive/pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 16 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 5 +- .../README.md | 15 +- .../pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- .../OpenAPIDocumentationConfig.java | 69 - .../SpringFoxConfiguration.java} | 5 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 5 +- .../README.md | 15 +- .../pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- .../SpringFoxConfiguration.java} | 5 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 5 +- .../README.md | 15 +- .../pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- .../OpenAPIDocumentationConfig.java | 69 - .../configuration/SpringFoxConfiguration.java | 71 + .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 5 +- .../springboot-spring-pageable/README.md | 15 +- .../springboot-spring-pageable/pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- .../configuration/SpringFoxConfiguration.java | 71 + .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 5 +- .../petstore/springboot-useoptional/README.md | 15 +- .../petstore/springboot-useoptional/pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- ...onfig.java => SpringFoxConfiguration.java} | 5 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../.openapi-generator/FILES | 5 +- .../petstore/springboot-virtualan/README.md | 15 +- .../petstore/springboot-virtualan/pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- ...onfig.java => SpringFoxConfiguration.java} | 5 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../springboot/.openapi-generator/FILES | 5 +- samples/server/petstore/springboot/README.md | 15 +- samples/server/petstore/springboot/pom.xml | 15 + .../org/openapitools/OpenAPI2SpringBoot.java | 57 - .../OpenApiGeneratorApplication.java | 23 + .../configuration/HomeController.java | 15 +- .../OpenAPIDocumentationConfig.java | 70 - .../configuration/SpringFoxConfiguration.java | 71 + .../src/main/resources/application.properties | 1 - .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + 656 files changed, 3948 insertions(+), 62921 deletions(-) create mode 100644 bin/configs/spring-boot-source.yaml delete mode 100644 bin/configs/spring-mvc-default-values.yaml delete mode 100644 bin/configs/spring-mvc-j8-async.yaml delete mode 100644 bin/configs/spring-mvc-j8-localdatetime.yaml delete mode 100644 bin/configs/spring-mvc-no-nullable.yaml delete mode 100644 bin/configs/spring-mvc-petstore-server-spring-pageable.yaml delete mode 100644 bin/configs/spring-mvc.yaml create mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/SpringBootTest.mustache create mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/swagger-ui.mustache delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/RFC3339DateFormat.mustache delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/defaultBasePath.mustache delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webApplication.mustache delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webMvcConfiguration.mustache delete mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/openapi3/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java rename samples/{server/petstore/spring-mvc-default-value => openapi3/server/petstore/springboot-source}/.openapi-generator-ignore (100%) create mode 100644 samples/openapi3/server/petstore/springboot-source/.openapi-generator/FILES rename samples/{server/petstore/spring-mvc-default-value => openapi3/server/petstore/springboot-source}/.openapi-generator/VERSION (100%) rename samples/{server/petstore/spring-mvc-default-value => openapi3/server/petstore/springboot-source}/README.md (73%) rename samples/{server/petstore/spring-mvc-default-value => openapi3/server/petstore/springboot-source}/pom.xml (77%) create mode 100644 samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/OpenApiGeneratorApplication.java rename samples/{server/petstore/spring-mvc-default-value => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/RFC3339DateFormat.java (100%) rename samples/{server/petstore/spring-mvc-default-value => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/api/ApiUtil.java (100%) rename samples/{server/petstore/spring-mvc-no-nullable => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/api/PetApi.java (52%) rename samples/{server/petstore/spring-mvc-j8-async => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/api/PetApiController.java (92%) rename samples/{server/petstore/spring-mvc-j8-localdatetime => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/api/StoreApi.java (66%) rename samples/{server/petstore/spring-mvc-j8-localdatetime => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/api/StoreApiController.java (92%) rename samples/{server/petstore/spring-mvc-no-nullable => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/api/UserApi.java (58%) rename samples/{server/petstore/spring-mvc-j8-localdatetime => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/api/UserApiController.java (92%) create mode 100644 samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/configuration/HomeController.java rename samples/{server/petstore/spring-mvc-j8-localdatetime => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/model/Category.java (89%) rename samples/{server/petstore/spring-mvc-j8-async => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/model/ModelApiResponse.java (93%) rename samples/{server/petstore/spring-mvc-j8-async => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/model/Order.java (94%) rename samples/{server/petstore/spring-mvc-spring-pageable => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/model/Pet.java (93%) rename samples/{server/petstore/spring-mvc-j8-localdatetime => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/model/Tag.java (92%) rename samples/{server/petstore/spring-mvc-j8-localdatetime => openapi3/server/petstore/springboot-source}/src/main/java/org/openapitools/model/User.java (93%) rename samples/{server/petstore/spring-mvc-default-value => openapi3/server/petstore/springboot-source}/src/main/resources/application.properties (73%) create mode 100644 samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml create mode 100644 samples/openapi3/server/petstore/springboot-source/src/main/resources/static/swagger-ui.html create mode 100644 samples/openapi3/server/petstore/springboot-source/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/openapi3/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenApiGeneratorApplication.java delete mode 100644 samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/config/swagger/OpenAPIDocumentationConfig.java delete mode 100644 samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES delete mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/OpenAPI2SpringBoot.java delete mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java delete mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java delete mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java delete mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java delete mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/HomeController.java delete mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java delete mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java delete mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml delete mode 100644 samples/server/petstore/spring-mvc-j8-async/.openapi-generator-ignore delete mode 100644 samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES delete mode 100644 samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION delete mode 100644 samples/server/petstore/spring-mvc-j8-async/README.md delete mode 100644 samples/server/petstore/spring-mvc-j8-async/pom.xml delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiException.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiOriginFilter.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiResponseMessage.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiUtil.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/NotFoundException.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/HomeController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AnimalFarm.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelFile.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/StringBooleanMap.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/resources/application.properties delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.properties delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml delete mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/resources/swagger.properties delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator-ignore delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/README.md delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiException.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiOriginFilter.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiResponseMessage.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiUtil.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/NotFoundException.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApiController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/HomeController.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebApplication.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AnimalFarm.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/File.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelFile.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/StringBooleanMap.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/application.properties delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.properties delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml delete mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/swagger.properties delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/.openapi-generator-ignore delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/README.md delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/pom.xml delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/ApiUtil.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApiController.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApiController.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebApplication.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/File.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelFile.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/resources/application.properties delete mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator-ignore delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/README.md delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/pom.xml delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/ApiUtil.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebApplication.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/File.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelFile.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/application.properties delete mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml delete mode 100644 samples/server/petstore/spring-mvc/.openapi-generator-ignore delete mode 100644 samples/server/petstore/spring-mvc/.openapi-generator/FILES delete mode 100644 samples/server/petstore/spring-mvc/.openapi-generator/VERSION delete mode 100644 samples/server/petstore/spring-mvc/README.md delete mode 100644 samples/server/petstore/spring-mvc/pom.xml delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/ApiUtil.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/HomeController.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebApplication.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AnimalFarm.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/File.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelFile.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/StringBooleanMap.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java delete mode 100644 samples/server/petstore/spring-mvc/src/main/resources/application.properties delete mode 100644 samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml delete mode 100644 samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java delete mode 100644 samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename samples/server/petstore/{springboot-beanvalidation/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java => springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java} (95%) create mode 100644 samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/OpenApiGeneratorApplication.java rename samples/server/petstore/{springboot-delegate-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java => springboot-beanvalidation/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java} (95%) create mode 100644 samples/server/petstore/springboot-beanvalidation/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java rename samples/server/petstore/{springboot-delegate/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java => springboot-delegate-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java} (95%) create mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-delegate-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java rename samples/server/petstore/{springboot-implicitHeaders/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java => springboot-delegate/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java} (95%) create mode 100644 samples/server/petstore/springboot-delegate/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/server/petstore/springboot-reactive/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java delete mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename samples/server/petstore/{springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java => springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java} (95%) create mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/OpenApiGeneratorApplication.java rename samples/server/petstore/{springboot-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java => springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java} (95%) create mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java delete mode 100644 samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java create mode 100644 samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java create mode 100644 samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-spring-pageable-without-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java create mode 100644 samples/server/petstore/springboot-spring-pageable/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-spring-pageable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java rename samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/{OpenAPIDocumentationConfig.java => SpringFoxConfiguration.java} (95%) create mode 100644 samples/server/petstore/springboot-useoptional/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenApiGeneratorApplication.java rename samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/{OpenAPIDocumentationConfig.java => SpringFoxConfiguration.java} (95%) create mode 100644 samples/server/petstore/springboot-virtualan/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-virtualan/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java delete mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java delete mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java create mode 100644 samples/server/petstore/springboot/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/.github/.test/samples.json b/.github/.test/samples.json index 6272fb28cc67..6520d1fbf09c 100644 --- a/.github/.test/samples.json +++ b/.github/.test/samples.json @@ -920,24 +920,6 @@ "Server: Spring" ] }, - { - "input": "spring-mvc-petstore-j8-async-server.sh", - "matches": [ - "Server: Spring" - ] - }, - { - "input": "spring-mvc-petstore-j8-localdatetime.sh", - "matches": [ - "Server: Spring" - ] - }, - { - "input": "spring-mvc-petstore-server.sh", - "matches": [ - "Server: Spring" - ] - }, { "input": "spring-stubs.sh", "matches": [ diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index 6f8ac8537980..328052970b31 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -26,10 +26,6 @@ jobs: - samples/openapi3/client/petstore/spring-stubs - samples/openapi3/client/petstore/spring-stubs-skip-default-interface # servers - - samples/server/petstore/spring-mvc - - samples/server/petstore/spring-mvc-default-value - - samples/server/petstore/spring-mvc-j8-async - - samples/server/petstore/spring-mvc-j8-localdatetime - samples/server/petstore/springboot - samples/openapi3/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation diff --git a/bin/configs/spring-boot-beanvalidation.yaml b/bin/configs/spring-boot-beanvalidation.yaml index dd4ea561c849..4a5daef58453 100644 --- a/bin/configs/spring-boot-beanvalidation.yaml +++ b/bin/configs/spring-boot-beanvalidation.yaml @@ -5,6 +5,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox + useSwaggerUI: false java8: true useBeanValidation: true artifactId: spring-boot-beanvalidation diff --git a/bin/configs/spring-boot-source.yaml b/bin/configs/spring-boot-source.yaml new file mode 100644 index 000000000000..a1572c0e19c4 --- /dev/null +++ b/bin/configs/spring-boot-source.yaml @@ -0,0 +1,10 @@ +generatorName: spring +outputDir: samples/openapi3/server/petstore/springboot-source +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + groupId: org.openapitools.openapi3 + documentationProvider: source + artifactId: springboot + snapshotVersion: "true" + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-springdoc.yaml b/bin/configs/spring-boot-springdoc.yaml index 47b1c195c36f..fe479cd21e7f 100644 --- a/bin/configs/spring-boot-springdoc.yaml +++ b/bin/configs/spring-boot-springdoc.yaml @@ -5,6 +5,7 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 documentationProvider: springdoc + useSwaggerUI: false artifactId: spring-boot-springdoc snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-mvc-default-values.yaml b/bin/configs/spring-mvc-default-values.yaml deleted file mode 100644 index e25aa41b503d..000000000000 --- a/bin/configs/spring-mvc-default-values.yaml +++ /dev/null @@ -1,8 +0,0 @@ -generatorName: spring -outputDir: samples/server/petstore/spring-mvc-default-value -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_8535.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - documentationProvider: springfox - hideGenerationTimestamp: "true" - artifactId: spring-mvc-default-value \ No newline at end of file diff --git a/bin/configs/spring-mvc-j8-async.yaml b/bin/configs/spring-mvc-j8-async.yaml deleted file mode 100644 index 287d05993ee4..000000000000 --- a/bin/configs/spring-mvc-j8-async.yaml +++ /dev/null @@ -1,12 +0,0 @@ -generatorName: spring -outputDir: samples/server/petstore/spring-mvc-j8-async -library: spring-mvc -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - documentationProvider: springfox - async: "true" - java8: true - artifactId: spring-mvc-server-j8-async - hideGenerationTimestamp: "true" - serverPort: "8002" diff --git a/bin/configs/spring-mvc-j8-localdatetime.yaml b/bin/configs/spring-mvc-j8-localdatetime.yaml deleted file mode 100644 index c1e66bf80a63..000000000000 --- a/bin/configs/spring-mvc-j8-localdatetime.yaml +++ /dev/null @@ -1,12 +0,0 @@ -generatorName: spring -outputDir: samples/server/petstore/spring-mvc-j8-localdatetime -library: spring-mvc -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - documentationProvider: springfox - booleanGetterPrefix: get - artifactId: spring-mvc-j8-localdatetime - hideGenerationTimestamp: "true" - serverPort: "8002" - dateLibrary: java8-localdatetime diff --git a/bin/configs/spring-mvc-no-nullable.yaml b/bin/configs/spring-mvc-no-nullable.yaml deleted file mode 100644 index 76cefce348f2..000000000000 --- a/bin/configs/spring-mvc-no-nullable.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: spring -outputDir: samples/server/petstore/spring-mvc-no-nullable -library: spring-mvc -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - documentationProvider: springfox - artifactId: spring-mvc-server-no-nullable - openApiNullable: "false" - serverPort: "8002" - hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml b/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml deleted file mode 100644 index 027a98cbff47..000000000000 --- a/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml +++ /dev/null @@ -1,9 +0,0 @@ -generatorName: spring -outputDir: samples/server/petstore/spring-mvc-spring-pageable -library: spring-mvc -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - documentationProvider: springfox - artifactId: spring-mvc-spring-pageable - hideGenerationTimestamp: 'true' diff --git a/bin/configs/spring-mvc.yaml b/bin/configs/spring-mvc.yaml deleted file mode 100644 index 9093bb518c8f..000000000000 --- a/bin/configs/spring-mvc.yaml +++ /dev/null @@ -1,14 +0,0 @@ -generatorName: spring -outputDir: samples/server/petstore/spring-mvc -library: spring-mvc -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - documentationProvider: springfox - java8: true - booleanGetterPrefix: get - artifactId: spring-mvc-server - hideGenerationTimestamp: "true" - serverPort: "8002" - additionalModelTypeAnnotations: '@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name");@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id")' - additionalEnumTypeAnnotations: '@com.fasterxml.jackson.annotation.JsonFormat' diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 9813b1b4dd08..57f0a58f855a 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -49,7 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| |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| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| -|documentationProvider|Select the OpenAPI documentation provider.|
    **none**
    Do not publish an OpenAPI specification.
    **source**
    Publish the original input OpenAPI specification.
    **springfox**
    Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x.
    **springdoc**
    Generate an OpenAPI 3 specification using SpringDoc.
    |springdoc| +|documentationProvider|Select the OpenAPI documentation provider.|
    **none**
    Do not publish an OpenAPI specification.
    **source**
    Publish the original input OpenAPI specification.
    **springfox**
    Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.
    **springdoc**
    Generate an OpenAPI 3 specification using SpringDoc.
    |springdoc| |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| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| @@ -61,7 +61,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |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|library template (sub-template)|
    **spring-boot**
    Spring-boot Server application using the SpringFox integration.
    **spring-mvc**
    Spring-MVC Server application using the SpringFox integration.
    **spring-cloud**
    Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
    |spring-boot| +|library|library template (sub-template)|
    **spring-boot**
    Spring-boot Server application.
    **spring-cloud**
    Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
    |spring-boot| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| @@ -84,13 +84,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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/main/java| -|swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false| |testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|server title name or client service name| |OpenAPI Spring| |unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false| |useBeanValidation|Use BeanValidation API annotations| |true| |useOptional|Use Optional container for optional parameters| |false| |useSpringController|Annotate the generated API as a Spring Controller| |false| +|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| |useTags|use tags for creating interface and controller classnames| |false| |virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 8f244c07e9c1..f63fea0e35c2 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -42,7 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| |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| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| -|documentationProvider|Select the OpenAPI documentation provider.|
    **none**
    Do not publish an OpenAPI specification.
    **source**
    Publish the original input OpenAPI specification.
    **springfox**
    Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x.
    **springdoc**
    Generate an OpenAPI 3 specification using SpringDoc.
    |springdoc| +|documentationProvider|Select the OpenAPI documentation provider.|
    **none**
    Do not publish an OpenAPI specification.
    **source**
    Publish the original input OpenAPI specification.
    **springfox**
    Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.
    **springdoc**
    Generate an OpenAPI 3 specification using SpringDoc.
    |springdoc| |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| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| @@ -54,7 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |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|library template (sub-template)|
    **spring-boot**
    Spring-boot Server application using the SpringFox integration.
    **spring-mvc**
    Spring-MVC Server application using the SpringFox integration.
    **spring-cloud**
    Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
    |spring-boot| +|library|library template (sub-template)|
    **spring-boot**
    Spring-boot Server application.
    **spring-cloud**
    Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
    |spring-boot| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| @@ -77,13 +77,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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/main/java| -|swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false| |testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|server title name or client service name| |OpenAPI Spring| |unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false| |useBeanValidation|Use BeanValidation API annotations| |true| |useOptional|Use Optional container for optional parameters| |false| |useSpringController|Annotate the generated API as a Spring Controller| |false| +|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| |useTags|use tags for creating interface and controller classnames| |false| |virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java index 40d17458e1f4..305a9038ffe7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java @@ -119,7 +119,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("openapi2SpringBoot.mustache", (sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator), - "OpenAPI2SpringBoot.java")); + "OpenApiGeneratorApplication.java")); if (!interfaceOnly) { apiTemplateFiles.put("routesImpl.mustache", "RoutesImpl.java"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 336f9ed05887..93cb9dcf0ccf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -20,6 +20,12 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty; import static org.openapitools.codegen.utils.StringUtils.camelize; +import com.samskivert.mustache.Mustache; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.servers.Server; import java.io.File; import java.net.URL; import java.util.ArrayList; @@ -31,13 +37,6 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.stream.Collectors; - -import com.samskivert.mustache.Mustache; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.servers.Server; import org.apache.commons.lang3.tuple.Pair; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; @@ -50,8 +49,10 @@ import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.languages.features.BeanValidationFeatures; +import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; import org.openapitools.codegen.languages.features.OptionalFeatures; import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; +import org.openapitools.codegen.languages.features.SwaggerUIFeatures; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.GlobalFeature; import org.openapitools.codegen.meta.features.ParameterFeature; @@ -65,7 +66,7 @@ import org.slf4j.LoggerFactory; public class SpringCodegen extends AbstractJavaCodegen - implements BeanValidationFeatures, PerformBeanValidationFeatures, OptionalFeatures { + implements BeanValidationFeatures, PerformBeanValidationFeatures, OptionalFeatures, SwaggerUIFeatures { private final Logger LOGGER = LoggerFactory.getLogger(SpringCodegen.class); public static final String TITLE = "title"; @@ -83,11 +84,9 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String REACTIVE = "reactive"; public static final String RESPONSE_WRAPPER = "responseWrapper"; public static final String USE_TAGS = "useTags"; - public static final String SPRING_MVC_LIBRARY = "spring-mvc"; public static final String SPRING_BOOT = "spring-boot"; public static final String SPRING_CLOUD_LIBRARY = "spring-cloud"; public static final String IMPLICIT_HEADERS = "implicitHeaders"; - public static final String OPENAPI_DOCKET_CONFIG = "swaggerDocketConfig"; public static final String API_FIRST = "apiFirst"; public static final String SPRING_CONTROLLER = "useSpringController"; public static final String HATEOAS = "hateoas"; @@ -113,7 +112,6 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean useBeanValidation = true; protected boolean performBeanValidation = false; protected boolean implicitHeaders = false; - protected boolean openapiDocketConfig = false; protected boolean apiFirst = false; protected boolean useOptional = false; protected boolean virtualService = false; @@ -121,6 +119,7 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean returnSuccessCode = false; protected boolean unhandledException = false; protected boolean useSpringController = false; + protected boolean useSwaggerUI = true; public SpringCodegen() { super(); @@ -185,8 +184,6 @@ public SpringCodegen() { cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); - cliOptions.add(CliOption.newBoolean(OPENAPI_DOCKET_CONFIG, - "Generate Spring OpenAPI Docket configuration class.", openapiDocketConfig)); cliOptions.add(CliOption.newBoolean(API_FIRST, "Generate the API from the OAI spec at server compile time (API first approach)", apiFirst)); cliOptions @@ -199,11 +196,13 @@ public SpringCodegen() { cliOptions.add(CliOption.newBoolean(UNHANDLED_EXCEPTION_HANDLING, "Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).", unhandledException)); + cliOptions.add(CliOption.newBoolean(USE_SWAGGER_UI, + "Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies", + useSwaggerUI)); - supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application using the SpringFox integration."); - supportedLibraries.put(SPRING_MVC_LIBRARY, "Spring-MVC Server application using the SpringFox integration."); + supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application."); supportedLibraries.put(SPRING_CLOUD_LIBRARY, - "Spring-Cloud-Feign client with Spring-Boot auto-configured settings."); + "Spring-Cloud-Feign client with Spring-Boot auto-configured settings."); setLibrary(SPRING_BOOT); final CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC) .defaultValue(SPRING_BOOT); @@ -250,6 +249,16 @@ public List supportedAnnotationLibraries() { return supportedLibraries; } + /** + * Whether the selected {@link DocumentationProviderFeatures.DocumentationProvider} requires us to bootstrap and + * configure swagger-ui by ourselves. Springdoc, for example ships its own swagger-ui integration. + * + * @return true if the selected DocumentationProvider requires us to bootstrap swagger-ui. + */ + private boolean selectedDocumentationProviderRequiresSwaggerUiBootstrap() { + return getDocumentationProvider().equals(DocumentationProvider.SPRINGFOX) || getDocumentationProvider().equals(DocumentationProvider.SOURCE); + } + @Override public void processOpts() { final List> configOptions = additionalProperties.entrySet().stream() @@ -285,6 +294,10 @@ public void processOpts() { super.processOpts(); + if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) { + LOGGER.warn("The springfox documentation provider is deprecated for removal. Use the springdoc provider instead."); + } + // clear model and api doc template as this codegen // does not support auto-generated markdown doc at the moment // TODO: add doc templates @@ -367,11 +380,6 @@ public void processOpts() { this.setImplicitHeaders(Boolean.parseBoolean(additionalProperties.get(IMPLICIT_HEADERS).toString())); } - if (additionalProperties.containsKey(OPENAPI_DOCKET_CONFIG)) { - this.setOpenapiDocketConfig( - Boolean.parseBoolean(additionalProperties.get(OPENAPI_DOCKET_CONFIG).toString())); - } - if (additionalProperties.containsKey(API_FIRST)) { this.setApiFirst(Boolean.parseBoolean(additionalProperties.get(API_FIRST).toString())); } @@ -389,6 +397,16 @@ public void processOpts() { this.setReturnSuccessCode(Boolean.parseBoolean(additionalProperties.get(RETURN_SUCCESS_CODE).toString())); } + if (additionalProperties.containsKey(USE_SWAGGER_UI)) { + this.setUseSwaggerUI(convertPropertyToBoolean(USE_SWAGGER_UI)); + } + + if (getDocumentationProvider().equals(DocumentationProvider.NONE)) { + this.setUseSwaggerUI(false); + } + + writePropertyBack(USE_SWAGGER_UI, useSwaggerUI); + if (additionalProperties.containsKey(UNHANDLED_EXCEPTION_HANDLING)) { this.setUnhandledException( Boolean.parseBoolean(additionalProperties.get(UNHANDLED_EXCEPTION_HANDLING).toString())); @@ -422,27 +440,20 @@ public void processOpts() { if (!interfaceOnly) { if (SPRING_BOOT.equals(library)) { + if (useSwaggerUI && selectedDocumentationProviderRequiresSwaggerUiBootstrap()) { + supportingFiles.add(new SupportingFile("swagger-ui.mustache", "src/main/resources/static", "swagger-ui.html")); + } + // rename template to SpringBootApplication.mustache supportingFiles.add(new SupportingFile("openapi2SpringBoot.mustache", (sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator), - "OpenAPI2SpringBoot.java")); + "OpenApiGeneratorApplication.java")); + supportingFiles.add(new SupportingFile("SpringBootTest.mustache", + (testFolder + File.separator + basePackage).replace(".", java.io.File.separator), + "OpenApiGeneratorApplicationTests.java")); supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", (sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator), "RFC3339DateFormat.java")); } - if (SPRING_MVC_LIBRARY.equals(library)) { - supportingFiles.add(new SupportingFile("webApplication.mustache", - (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), - "WebApplication.java")); - supportingFiles.add(new SupportingFile("webMvcConfiguration.mustache", - (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), - "WebMvcConfiguration.java")); - supportingFiles.add(new SupportingFile("openapiUiConfiguration.mustache", - (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), - "OpenAPIUiConfiguration.java")); - supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", - (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), - "RFC3339DateFormat.java")); - } if (SPRING_CLOUD_LIBRARY.equals(library)) { supportingFiles.add(new SupportingFile("apiKeyRequestInterceptor.mustache", (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), @@ -462,19 +473,14 @@ public void processOpts() { supportingFiles.add(new SupportingFile("homeController.mustache", (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "HomeController.java")); - if (!reactive && !apiFirst && this.openapiDocketConfig) { + supportingFiles.add(new SupportingFile("openapi.mustache", + ("src/main/resources").replace("/", java.io.File.separator), "openapi.yaml")); + if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider()) && !reactive && !apiFirst) { supportingFiles.add(new SupportingFile("openapiDocumentationConfig.mustache", - (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), - "OpenAPIDocumentationConfig.java")); - } else { - supportingFiles.add(new SupportingFile("openapi.mustache", - ("src/main/resources").replace("/", java.io.File.separator), "openapi.yaml")); + (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), + "SpringFoxConfiguration.java")); } } - } else if (openapiDocketConfig && !SPRING_CLOUD_LIBRARY.equals(library) && !reactive && !apiFirst) { - supportingFiles.add(new SupportingFile("openapiDocumentationConfig.mustache", - (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), - "OpenAPIDocumentationConfig.java")); } if (!SPRING_CLOUD_LIBRARY.equals(library)) { @@ -570,7 +576,7 @@ public void processOpts() { @Override public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { - if ((SPRING_BOOT.equals(library) || SPRING_MVC_LIBRARY.equals(library)) && !useTags) { + if ((SPRING_BOOT.equals(library) && !useTags)) { String basePath = resourcePath; if (basePath.startsWith("/")) { basePath = basePath.substring(1); @@ -868,10 +874,6 @@ public void setImplicitHeaders(boolean implicitHeaders) { this.implicitHeaders = implicitHeaders; } - public void setOpenapiDocketConfig(boolean openapiDocketConfig) { - this.openapiDocketConfig = openapiDocketConfig; - } - public void setApiFirst(boolean apiFirst) { this.apiFirst = apiFirst; } @@ -1008,4 +1010,9 @@ public void setPerformBeanValidation(boolean performBeanValidation) { public void setUseOptional(boolean useOptional) { this.useOptional = useOptional; } + + @Override + public void setUseSwaggerUI(boolean useSwaggerUI) { + this.useSwaggerUI = useSwaggerUI; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java index 172ac8f025c3..adfa20dc46d6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java @@ -20,9 +20,9 @@ public interface BeanValidationExtendedFeatures { // Language (implementing Client/Server) supports automatic BeanValidation (1.1) - public static final String USE_BEANVALIDATION_FEATURE = "useBeanValidationFeature"; + String USE_BEANVALIDATION_FEATURE = "useBeanValidationFeature"; - public void setUseBeanValidationFeature(boolean useBeanValidationFeature); + void setUseBeanValidationFeature(boolean useBeanValidationFeature); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java index 44ded47f71b8..cc895613bc98 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java @@ -20,8 +20,8 @@ public interface BeanValidationFeatures { // Language supports generating BeanValidation-Annotations - public static final String USE_BEANVALIDATION = "useBeanValidation"; + String USE_BEANVALIDATION = "useBeanValidation"; - public void setUseBeanValidation(boolean useBeanValidation); + void setUseBeanValidation(boolean useBeanValidation); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java index d009595e20c5..ff6561f3f807 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java @@ -23,25 +23,25 @@ public interface CXFServerFeatures extends CXFFeatures, SwaggerFeatures, SpringFeatures, JbossFeature, BeanValidationExtendedFeatures, SwaggerUIFeatures { - public static final String USE_WADL_FEATURE = "useWadlFeature"; + String USE_WADL_FEATURE = "useWadlFeature"; - public static final String USE_MULTIPART_FEATURE = "useMultipartFeature"; + String USE_MULTIPART_FEATURE = "useMultipartFeature"; - public static final String ADD_CONSUMES_PRODUCES_JSON = "addConsumesProducesJson"; + String ADD_CONSUMES_PRODUCES_JSON = "addConsumesProducesJson"; - public static final String USE_ANNOTATED_BASE_PATH = "useAnnotatedBasePath"; + String USE_ANNOTATED_BASE_PATH = "useAnnotatedBasePath"; - public static final String GENERATE_NON_SPRING_APPLICATION = "generateNonSpringApplication"; + String GENERATE_NON_SPRING_APPLICATION = "generateNonSpringApplication"; - public static final String LOAD_TEST_DATA_FROM_FILE = "loadTestDataFromFile"; + String LOAD_TEST_DATA_FROM_FILE = "loadTestDataFromFile"; - public void setUseWadlFeature(boolean useWadlFeature); + void setUseWadlFeature(boolean useWadlFeature); - public void setUseMultipartFeature(boolean useMultipartFeature); + void setUseMultipartFeature(boolean useMultipartFeature); - public void setAddConsumesProducesJson(boolean addConsumesProducesJson); + void setAddConsumesProducesJson(boolean addConsumesProducesJson); - public void setUseAnnotatedBasePath(boolean useAnnotatedBasePath); + void setUseAnnotatedBasePath(boolean useAnnotatedBasePath); - public void setGenerateNonSpringApplication(boolean generateNonSpringApplication); + void setGenerateNonSpringApplication(boolean generateNonSpringApplication); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java index b658ea0e4d9e..b4edcaea5df8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java @@ -72,7 +72,7 @@ enum DocumentationProvider { SWAGGER2("swagger2DocumentationProvider", "Generate an OpenAPI 3 specification using Swagger-Core 2.x.", AnnotationLibrary.SWAGGER2, AnnotationLibrary.SWAGGER2), - SPRINGFOX("springFoxDocumentationProvider", "Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x.", + SPRINGFOX("springFoxDocumentationProvider", "Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.", AnnotationLibrary.SWAGGER1, AnnotationLibrary.SWAGGER1), SPRINGDOC("springDocDocumentationProvider", "Generate an OpenAPI 3 specification using SpringDoc.", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java index 683d23f25857..f86832330945 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java @@ -19,8 +19,8 @@ public interface GzipFeatures { - public static final String USE_GZIP_FEATURE = "useGzipFeature"; + String USE_GZIP_FEATURE = "useGzipFeature"; - public void setUseGzipFeature(boolean useGzipFeature); + void setUseGzipFeature(boolean useGzipFeature); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java index 26a6f93aef8c..5f036dd6880e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java @@ -19,8 +19,8 @@ public interface GzipTestFeatures { - public static final String USE_GZIP_FEATURE_FOR_TESTS = "useGzipFeatureForTests"; + String USE_GZIP_FEATURE_FOR_TESTS = "useGzipFeatureForTests"; - public void setUseGzipFeatureForTests(boolean useGzipFeatureForTests); + void setUseGzipFeatureForTests(boolean useGzipFeatureForTests); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java index 463075836a94..c022ef8cea62 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java @@ -19,8 +19,8 @@ public interface JbossFeature { - public static final String GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR = "generateJbossDeploymentDescriptor"; + String GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR = "generateJbossDeploymentDescriptor"; - public void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor); + void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java index 795854481236..e7b75a898dde 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java @@ -19,8 +19,8 @@ public interface LoggingFeatures extends BeanValidationFeatures { - public static final String USE_LOGGING_FEATURE = "useLoggingFeature"; + String USE_LOGGING_FEATURE = "useLoggingFeature"; - public void setUseLoggingFeature(boolean useLoggingFeature); + void setUseLoggingFeature(boolean useLoggingFeature); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java index cef8873cdcad..c342f127c2c5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java @@ -18,8 +18,9 @@ package org.openapitools.codegen.languages.features; public interface LoggingTestFeatures { - public static final String USE_LOGGING_FEATURE_FOR_TESTS = "useLoggingFeatureForTests"; - public void setUseLoggingFeatureForTests(boolean useLoggingFeatureForTests); + String USE_LOGGING_FEATURE_FOR_TESTS = "useLoggingFeatureForTests"; + + void setUseLoggingFeatureForTests(boolean useLoggingFeatureForTests); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java index a09e00815ed8..f2b5369f5442 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java @@ -20,8 +20,8 @@ public interface PerformBeanValidationFeatures { // Language supports performing BeanValidation - public static final String PERFORM_BEANVALIDATION = "performBeanValidation"; + String PERFORM_BEANVALIDATION = "performBeanValidation"; - public void setPerformBeanValidation(boolean performBeanValidation); + void setPerformBeanValidation(boolean performBeanValidation); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java index 78ff54738ee8..7976b39c2722 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java @@ -19,17 +19,16 @@ public interface SpringFeatures extends BeanValidationFeatures { - public static final String GENERATE_SPRING_APPLICATION = "generateSpringApplication"; + String GENERATE_SPRING_APPLICATION = "generateSpringApplication"; - public static final String GENERATE_SPRING_BOOT_APPLICATION = "generateSpringBootApplication"; + String GENERATE_SPRING_BOOT_APPLICATION = "generateSpringBootApplication"; - public static final String USE_SPRING_ANNOTATION_CONFIG = "useSpringAnnotationConfig"; + String USE_SPRING_ANNOTATION_CONFIG = "useSpringAnnotationConfig"; - public void setGenerateSpringApplication(boolean useGenerateSpringApplication); + void setGenerateSpringApplication(boolean useGenerateSpringApplication); - public void setGenerateSpringBootApplication(boolean generateSpringBootApplication); - - public void setUseSpringAnnotationConfig(boolean useSpringAnnotationConfig); + void setGenerateSpringBootApplication(boolean generateSpringBootApplication); + void setUseSpringAnnotationConfig(boolean useSpringAnnotationConfig); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java index 0487bcef88a2..c37135d29585 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java @@ -19,8 +19,8 @@ public interface SwaggerFeatures { - public static final String USE_SWAGGER_FEATURE = "useSwaggerFeature"; + String USE_SWAGGER_FEATURE = "useSwaggerFeature"; - public void setUseSwaggerFeature(boolean useSwaggerFeature); + void setUseSwaggerFeature(boolean useSwaggerFeature); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java index 27483bce2d26..e3e73d29ea21 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java @@ -17,10 +17,10 @@ package org.openapitools.codegen.languages.features; -public interface SwaggerUIFeatures extends CXFFeatures { +public interface SwaggerUIFeatures { - public static final String USE_SWAGGER_UI = "useSwaggerUI"; + String USE_SWAGGER_UI = "useSwaggerUI"; - public void setUseSwaggerUI(boolean useSwaggerUI); + void setUseSwaggerUI(boolean useSwaggerUI); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java index 713e349e3af0..c035bffc432f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java @@ -20,7 +20,7 @@ public interface UseGenericResponseFeatures { // Language supports generating generic Jaxrs or native return types - public static final String USE_GENERIC_RESPONSE = "useGenericResponse"; + String USE_GENERIC_RESPONSE = "useGenericResponse"; - public void setUseGenericResponse(boolean useGenericResponse); + void setUseGenericResponse(boolean useGenericResponse); } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache index 189eccefbc83..258392223cd6 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache @@ -1,36 +1,34 @@ package {{configPackage}}; -{{^springFoxDocumentationProvider}} import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +{{#sourceDocumentationProvider}} import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.Resource; -{{/springFoxDocumentationProvider}} -import org.springframework.stereotype.Controller; -{{^springFoxDocumentationProvider}} import org.springframework.util.StreamUtils; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.GetMapping; -{{/springFoxDocumentationProvider}} -import org.springframework.web.bind.annotation.RequestMapping; -{{^springFoxDocumentationProvider}} +{{/sourceDocumentationProvider}} +{{#useSwaggerUI}} import org.springframework.web.bind.annotation.ResponseBody; -{{/springFoxDocumentationProvider}} +import org.springframework.web.bind.annotation.GetMapping; +{{/useSwaggerUI}} {{#reactive}} -import org.springframework.context.annotation.Bean; import org.springframework.web.reactive.function.server.RouterFunction; import org.springframework.web.reactive.function.server.ServerResponse; {{/reactive}} - -{{^springFoxDocumentationProvider}} +{{#sourceDocumentationProvider}} import java.io.IOException; import java.io.InputStream; -{{/springFoxDocumentationProvider}} +{{/sourceDocumentationProvider}} {{#reactive}} import java.net.URI; {{/reactive}} -{{^springFoxDocumentationProvider}} +{{#sourceDocumentationProvider}} import java.nio.charset.Charset; -{{/springFoxDocumentationProvider}} +{{/sourceDocumentationProvider}} {{#reactive}} import static org.springframework.web.reactive.function.server.RequestPredicates.GET; @@ -42,8 +40,8 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r */ @Controller public class HomeController { +{{#sourceDocumentationProvider}} -{{^springFoxDocumentationProvider}} private static YAMLMapper yamlMapper = new YAMLMapper(); @Value("classpath:/openapi.yaml") @@ -67,23 +65,40 @@ public class HomeController { public Object openapiJson() throws IOException { return yamlMapper.readValue(openapiContent(), Object.class); } +{{/sourceDocumentationProvider}} +{{#useSwaggerUI}} +{{^springDocDocumentationProvider}} +{{#sourceDocumentationProvider}} + static final String API_DOCS_PATH = "/openapi.json"; +{{/sourceDocumentationProvider}} +{{#springFoxDocumentationProvider}} + static final String API_DOCS_PATH = "/v2/api-docs"; {{/springFoxDocumentationProvider}} + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } +{{/springDocDocumentationProvider}} {{#reactive}} + @Bean RouterFunction index() { return route( GET("/"), - req -> ServerResponse.temporaryRedirect(URI.create("{{#springFoxDocumentationProvider}}swagger-ui.html{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}swagger-ui/index.html?url=../openapi.json{{/springFoxDocumentationProvider}}")).build() + req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui.html")).build() ); } {{/reactive}} {{^reactive}} + @RequestMapping("/") public String index() { - return "redirect:{{#springFoxDocumentationProvider}}swagger-ui.html{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}swagger-ui/index.html?url=../openapi.json{{/springFoxDocumentationProvider}}"; + return "redirect:swagger-ui.html"; } {{/reactive}} +{{/useSwaggerUI}} - -} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache index b304cb8866d8..75b663946562 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache @@ -2,23 +2,44 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. - {{#springFoxDocumentationProvider}} -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) + +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:{{serverPort}}/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. {{/springFoxDocumentationProvider}} + +{{#springDocDocumentationProvider}} + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:{{serverPort}}/v3/api-docs/ +{{/springDocDocumentationProvider}} +{{#sourceDocumentationProvider}} + +The OpenAPI specification used to generate this project is available to download using the following url: +http://localhost:{{serverPort}}/openapi.json +{{/sourceDocumentationProvider}} + Start your server as a simple java application +{{#useSwaggerUI}} -{{^reactive}} You can view the api documentation in swagger-ui by pointing to -http://localhost:{{serverPort}}/ +http://localhost:{{serverPort}}/swagger-ui.html -{{/reactive}} +{{/useSwaggerUI}} Change default port value in application.properties{{/interfaceOnly}}{{#interfaceOnly}} # OpenAPI generated API stub diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/SpringBootTest.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/SpringBootTest.mustache new file mode 100644 index 000000000000..f8d9032c6032 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/SpringBootTest.mustache @@ -0,0 +1,13 @@ +package {{basePackage}}; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache index 06f041051b96..f8740df9541d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache @@ -1,6 +1,3 @@ -{{#springFoxDocumentationProvider}} -springfox.documentation.swagger.v2.path=/api-docs -{{/springFoxDocumentationProvider}} server.port={{serverPort}} spring.jackson.date-format={{basePackage}}.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache index 5649aaa99dbc..01725be2d207 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache @@ -1,73 +1,20 @@ package {{basePackage}}; -import com.fasterxml.jackson.databind.Module; {{#openApiNullable}} +import com.fasterxml.jackson.databind.Module; import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; -{{^reactive}} -import org.springframework.web.servlet.config.annotation.CorsRegistry; - {{^springFoxDocumentationProvider}} -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; - {{/springFoxDocumentationProvider}} -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -{{/reactive}} -{{#reactive}} -import org.springframework.web.reactive.config.CorsRegistry; - {{^springFoxDocumentationProvider}} -import org.springframework.web.reactive.config.ResourceHandlerRegistry; - {{/springFoxDocumentationProvider}} -import org.springframework.web.reactive.config.WebFluxConfigurer; -{{/reactive}} @SpringBootApplication @ComponentScan(basePackages = {"{{basePackage}}", "{{apiPackage}}" , "{{configPackage}}"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public Web{{^reactive}}Mvc{{/reactive}}{{#reactive}}Flux{{/reactive}}Configurer webConfigurer() { - return new Web{{^reactive}}Mvc{{/reactive}}{{#reactive}}Flux{{/reactive}}Configurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ -{{^springFoxDocumentationProvider}} +public class OpenApiGeneratorApplication { - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } -{{/springFoxDocumentationProvider}} - }; + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); } {{#openApiNullable}} @@ -77,4 +24,4 @@ public class OpenAPI2SpringBoot implements CommandLineRunner { } {{/openApiNullable}} -} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index 9fc6b89ca756..ccdd99326ace 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -25,6 +25,9 @@ {{/swagger2AnnotationLibrary}} {{/springDocDocumentationProvider}} {{/springFoxDocumentationProvider}} + {{#useSwaggerUI}} + 4.4.1-1 + {{/useSwaggerUI}}
    {{#parentOverridden}} @@ -37,7 +40,7 @@ org.springframework.boot spring-boot-starter-parent - {{#springFoxDocumentationProvider}}2.5.8{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}2.6.2{{/springFoxDocumentationProvider}} + {{#springFoxDocumentationProvider}}2.5.8{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}2.6.3{{/springFoxDocumentationProvider}} {{/parentOverridden}} @@ -94,11 +97,20 @@
    {{#springDocDocumentationProvider}} + {{#useSwaggerUI}} org.springdoc - springdoc-openapi-ui + springdoc-openapi-{{#reactive}}webflux-{{/reactive}}ui ${springdoc.version} + {{/useSwaggerUI}} + {{^useSwaggerUI}} + + org.springdoc + springdoc-openapi-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-core + ${springdoc.version} + + {{/useSwaggerUI}} {{/springDocDocumentationProvider}} {{#springFoxDocumentationProvider}} @@ -108,6 +120,19 @@ ${springfox.version} {{/springFoxDocumentationProvider}} + {{#useSwaggerUI}} + {{^springDocDocumentationProvider}} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + + {{/springDocDocumentationProvider}} + {{/useSwaggerUI}} {{^springFoxDocumentationProvider}} {{^springDocDocumentationProvider}} {{#swagger1AnnotationLibrary}} @@ -204,5 +229,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/swagger-ui.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/swagger-ui.mustache new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/swagger-ui.mustache @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache deleted file mode 100644 index bdd21d95a70d..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache +++ /dev/null @@ -1,14 +0,0 @@ -# OpenAPI generated server - -Spring MVC Server - - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the Spring MVC framework. - -{{#springFoxDocumentationProvider}} -The underlying library integrating OpenAPI to Spring-MVC is [springfox](https://github.com/springfox/springfox) - -{{/springFoxDocumentationProvider}} -You can view the server in swagger-ui by pointing to -http://localhost:{{serverPort}}{{contextPath}}{{^contextPath}}/{{/contextPath}}/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/RFC3339DateFormat.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/RFC3339DateFormat.mustache deleted file mode 100644 index 84897b70d400..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/RFC3339DateFormat.mustache +++ /dev/null @@ -1,38 +0,0 @@ -package {{configPackage}}; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache deleted file mode 100644 index 655c870be613..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache +++ /dev/null @@ -1,3 +0,0 @@ -{{#springFoxDocumentationProvider}} -springfox.documentation.swagger.v2.path=/api-docs -{{/springFoxDocumentationProvider}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/defaultBasePath.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/defaultBasePath.mustache deleted file mode 100644 index 35ec3b9d7586..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/defaultBasePath.mustache +++ /dev/null @@ -1 +0,0 @@ -/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache deleted file mode 100644 index a9b5410403d2..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache +++ /dev/null @@ -1,126 +0,0 @@ -package {{configPackage}}; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} -{{#openApiNullable}} -import org.openapitools.jackson.nullable.JsonNullableModule; -{{/openApiNullable}} -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -{{#springFoxDocumentationProvider}} -import org.springframework.context.annotation.Import; -{{/springFoxDocumentationProvider}} -import org.springframework.context.annotation.Bean; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -{{#threetenbp}} -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZonedDateTime; -{{/threetenbp}} - -import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.data.web.PageableHandlerMethodArgumentResolver; - -import java.util.List; -import javax.annotation.Generated; - -{{>generatedAnnotation}} -@Configuration -@ComponentScan(basePackages = {"{{apiPackage}}", "{{configPackage}}"}) -@EnableWebMvc -@PropertySource("classpath:application.properties") -{{#springFoxDocumentationProvider}} -@Import(OpenAPIDocumentationConfig.class) -{{/springFoxDocumentationProvider}} -public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter { - private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; - - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "classpath:/META-INF/resources/", "classpath:/resources/", - "classpath:/static/", "classpath:/public/" }; - - private static final String[] RESOURCE_LOCATIONS; - static { - RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length - + SERVLET_RESOURCE_LOCATIONS.length]; - System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0, - SERVLET_RESOURCE_LOCATIONS.length); - System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, - SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length); - } - - private static final String[] STATIC_INDEX_HTML_RESOURCES; - static { - STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length]; - for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) { - STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html"; - } - } - - @Override - public void addArgumentResolvers(List argumentResolvers) { - argumentResolvers.add(new PageableHandlerMethodArgumentResolver()); - super.addArgumentResolvers(argumentResolvers); - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - if (!registry.hasMappingForPattern("/webjars/**")) { - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); - } - {{^springFoxDocumentationProvider}} - if (!registry.hasMappingForPattern("/swagger-ui/**")) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } - {{/springFoxDocumentationProvider}} - } - - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Bean - public Jackson2ObjectMapperBuilder builder() { - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - {{/threetenbp}} - return new Jackson2ObjectMapperBuilder() - .indentOutput(true) - .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - {{#openApiNullable}}.modulesToInstall({{#threetenbp}}module, {{/threetenbp}}new JsonNullableModule()){{/openApiNullable}} - {{^openApiNullable}}{{#threetenbp}}.modulesToInstall(module){{/threetenbp}}{{/openApiNullable}} - .dateFormat(new RFC3339DateFormat()); - } - - @Override - public void configureMessageConverters(List> converters) { - converters.add(new MappingJackson2HttpMessageConverter(objectMapper())); - converters.add(new StringHttpMessageConverter()); - super.configureMessageConverters(converters); - } - - @Bean - public ObjectMapper objectMapper(){ - return builder().build(); - } -} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache deleted file mode 100644 index a1cd9ae20857..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ /dev/null @@ -1,303 +0,0 @@ - - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} -{{#parentOverridden}} - - {{{parentGroupId}}} - {{{parentArtifactId}}} - {{{parentVersion}}} - -{{/parentOverridden}} - - src/main/java - - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty-version} - - - {{contextPath}}{{^contextPath}}/{{/contextPath}} - - target/${project.artifactId}-${project.version} - 8079 - stopit - 10 - - {{serverPort}} - 60000 - - -{{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - - -{{/useBeanValidation}} - - - start-jetty - pre-integration-test - - start - - - 0 - true - - - - stop-jetty - post-integration-test - - stop - - - - - {{#apiFirst}} - - org.openapitools - openapi-generator-maven-plugin - {{{generatorVersion}}} - - - - generate - - - src/main/resources/openapi.yaml - spring - spring-mvc - {{{apiPackage}}} - {{{modelPackage}}} - false - {{#modelNamePrefix}} - {{{.}}} - {{/modelNamePrefix}} - {{#modelNameSuffix}} - {{{.}}} - {{/modelNameSuffix}} - - {{#configOptions}} - <{{left}}>{{right}} - {{/configOptions}} - - - - - - {{/apiFirst}} - - - - - org.slf4j - slf4j-log4j12 - ${slf4j-version} - - - - - org.springframework - spring-core - ${spring-version} - - - org.springframework - spring-webmvc - ${spring-version} - - - org.springframework - spring-web - ${spring-version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - - - jakarta.xml.bind - jakarta.xml.bind-api - ${jakarta.xml.bind-version} - - {{#springFoxDocumentationProvider}} - - - io.springfox - springfox-swagger2 - ${springfox-version} - - - com.fasterxml.jackson.core - jackson-annotations - - - - - io.springfox - springfox-swagger-ui - ${springfox-version} - - {{/springFoxDocumentationProvider}} - {{^springFoxDocumentationProvider}} - - io.springfox - springfox-swagger2 - ${springfox-version} - - - com.fasterxml.jackson.core - jackson-annotations - - - - - org.webjars - swagger-ui - 3.14.2 - - {{#oas3}} - - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} - - {{/oas3}} - {{^oas3}} - - io.swagger - swagger-annotations - ${swagger-core-version} - - {{/oas3}} - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - ${jackson-version} - - {{/springFoxDocumentationProvider}} - {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - - {{/withXml}} - {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} - {{#openApiNullable}} - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - {{/openApiNullable}} - - junit - junit - ${junit-version} - test - - - jakarta.servlet - jakarta.servlet-api - ${servlet-api-version} - -{{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - -{{/useBeanValidation}} -{{#hateoas}} - - - org.springframework.hateoas - spring-hateoas - 1.0.1.RELEASE - -{{/hateoas}} - - org.springframework.data - spring-data-commons - 2.0.11.RELEASE - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - - - - 1.8 - ${java.version} - ${java.version} - 1.3.5 - 2.3.3 - 9.2.15.v20160210 - 1.7.21 - 4.13.1 - 4.0.4 - 2.9.2 - 2.9.9 - 2.8.4 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 4.3.20.RELEASE - {{#openApiNullable}} - 0.2.2 - {{/openApiNullable}} - 2.9.8 - {{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}} - - diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webApplication.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webApplication.mustache deleted file mode 100644 index ff18a53cdaca..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webApplication.mustache +++ /dev/null @@ -1,23 +0,0 @@ -package {{configPackage}}; - -import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; -import javax.annotation.Generated; - -{{>generatedAnnotation}} -public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { - - @Override - protected Class[] getRootConfigClasses() { - return new Class[] { OpenAPIUiConfiguration.class }; - } - - @Override - protected Class[] getServletConfigClasses() { - return new Class[] { WebMvcConfiguration.class }; - } - - @Override - protected String[] getServletMappings() { - return new String[] { "/" }; - } -} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webMvcConfiguration.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webMvcConfiguration.mustache deleted file mode 100644 index a77ca1552b9e..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webMvcConfiguration.mustache +++ /dev/null @@ -1,13 +0,0 @@ -package {{configPackage}}; - -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import javax.annotation.Generated; - -{{>generatedAnnotation}} -public class WebMvcConfiguration extends WebMvcConfigurationSupport { - @Override - public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } -} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache index f240b38c05e1..eabd41caf918 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache @@ -24,7 +24,7 @@ import javax.servlet.ServletContext; {{>generatedAnnotation}} @Configuration @EnableSwagger2 -public class OpenAPIDocumentationConfig { +public class SpringFoxConfiguration { ApiInfo apiInfo() { return new ApiInfoBuilder() diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 5868af8466da..997a1a2ab0c0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -775,7 +775,7 @@ public void shouldGenerateDefaultValueForEnumRequestParameter() throws IOExcepti } /**define the destinationFilename*/ - private final static String DESTINATIONFILE = "OpenAPIDocumentationConfig.java"; + private final static String DESTINATIONFILE = "SpringFoxConfiguration.java"; /**define the templateFile*/ private final static String TEMPLATEFILE = "openapiDocumentationConfig.mustache"; @@ -787,14 +787,14 @@ public void shouldGenerateDefaultValueForEnumRequestParameter() throws IOExcepti public void testConfigFileGeneration() { final SpringCodegen codegen = new SpringCodegen(); - + codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox"); codegen.additionalProperties().put(SpringCodegen.INTERFACE_ONLY, false); codegen.additionalProperties().put(SpringCodegen.SPRING_CLOUD_LIBRARY, "spring-cloud"); - codegen.additionalProperties().put(SpringCodegen.OPENAPI_DOCKET_CONFIG, true); codegen.additionalProperties().put(SpringCodegen.REACTIVE, false); codegen.additionalProperties().put(SpringCodegen.API_FIRST, false); codegen.processOpts(); + final List supList = codegen.supportingFiles(); String tmpFile; String desFile; diff --git a/pom.xml b/pom.xml index 643d5b98329e..d719aa806de4 100644 --- a/pom.xml +++ b/pom.xml @@ -1036,18 +1036,6 @@ samples/client/petstore/go - - spring-mvc - - - env - java - - - - samples/server/petstore/spring-mvc - - springboot-beanvalidation @@ -1186,10 +1174,6 @@ samples/server/petstore/jaxrs/jersey2 samples/server/petstore/jaxrs/jersey2-useTags - samples/server/petstore/spring-mvc - samples/server/petstore/spring-mvc-default-value - samples/server/petstore/spring-mvc-j8-async - samples/server/petstore/spring-mvc-j8-localdatetime samples/server/petstore/java-camel samples/server/petstore/jaxrs-jersey diff --git a/samples/client/petstore/spring-stubs/pom.xml b/samples/client/petstore/spring-stubs/pom.xml index ef22a9c572a8..6a65cedf99b7 100644 --- a/samples/client/petstore/spring-stubs/pom.xml +++ b/samples/client/petstore/spring-stubs/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -34,6 +35,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -62,5 +72,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml index b2890ab9d519..5a357f4fd888 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml @@ -10,11 +10,12 @@ ${java.version} ${java.version} 1.6.4 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -62,5 +63,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/client/petstore/spring-stubs/pom.xml b/samples/openapi3/client/petstore/spring-stubs/pom.xml index b2890ab9d519..5a357f4fd888 100644 --- a/samples/openapi3/client/petstore/spring-stubs/pom.xml +++ b/samples/openapi3/client/petstore/spring-stubs/pom.xml @@ -10,11 +10,12 @@ ${java.version} ${java.version} 1.6.4 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -62,5 +63,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES b/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES index 7de4a0d86c09..baf10ab6b83b 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/ApiUtil.java src/main/java/org/openapitools/api/PetApi.java @@ -18,3 +18,4 @@ src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/User.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/README.md b/samples/openapi3/server/petstore/spring-boot-springdoc/README.md index 5bbe4a495d99..28079dcd2a86 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/README.md +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/README.md @@ -2,15 +2,16 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -Start your server as a simple java application -You can view the api documentation in swagger-ui by pointing to -http://localhost:8080/ +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:8080/v3/api-docs/ +Start your server as a simple java application Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml index 8cc169fadddd..dd6b400eb7a3 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -37,7 +37,7 @@ org.springdoc - springdoc-openapi-ui + springdoc-openapi-webmvc-core ${springdoc.version} @@ -68,5 +68,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index cb088f451935..000000000000 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java index 61d4ebb31830..707313504790 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,18 +1,8 @@ package org.openapitools.configuration; import org.springframework.context.annotation.Bean; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; -import org.springframework.util.StreamUtils; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; /** * Home redirection to OpenAPI api documentation @@ -20,34 +10,4 @@ @Controller public class HomeController { - private static YAMLMapper yamlMapper = new YAMLMapper(); - - @Value("classpath:/openapi.yaml") - private Resource openapi; - - @Bean - public String openapiContent() throws IOException { - try(InputStream is = openapi.getInputStream()) { - return StreamUtils.copyToString(is, Charset.defaultCharset()); - } - } - - @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") - @ResponseBody - public String openapiYaml() throws IOException { - return openapiContent(); - } - - @GetMapping(value = "/openapi.json", produces = "application/json") - @ResponseBody - public Object openapiJson() throws IOException { - return yamlMapper.readValue(openapiContent(), Object.class); - } - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui/index.html?url=../openapi.json"; - } - - -} +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES index 6d8d3656155a..dcc247ba165c 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -66,3 +66,4 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md index befc961488ae..e6de7e038cea 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md @@ -2,15 +2,20 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:80/v3/api-docs/ + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index 81e608be23ab..fe0cd0c3a1de 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -10,11 +10,12 @@ ${java.version} ${java.version} 1.6.4 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -63,5 +64,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index f265e75c51b3..000000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } - }; - } - - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..1ebe51cb901d --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,17 @@ +package org.openapitools; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java index 61d4ebb31830..9aa29284ab5f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,18 +1,10 @@ package org.openapitools.configuration; import org.springframework.context.annotation.Bean; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; -import org.springframework.util.StreamUtils; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -20,34 +12,9 @@ @Controller public class HomeController { - private static YAMLMapper yamlMapper = new YAMLMapper(); - - @Value("classpath:/openapi.yaml") - private Resource openapi; - - @Bean - public String openapiContent() throws IOException { - try(InputStream is = openapi.getInputStream()) { - return StreamUtils.copyToString(is, Charset.defaultCharset()); - } - } - - @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") - @ResponseBody - public String openapiYaml() throws IOException { - return openapiContent(); - } - - @GetMapping(value = "/openapi.json", produces = "application/json") - @ResponseBody - public Object openapiJson() throws IOException { - return yamlMapper.readValue(openapiContent(), Object.class); - } - @RequestMapping("/") public String index() { - return "redirect:swagger-ui/index.html?url=../openapi.json"; + return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES index bd5a0e2c0574..0ed351e7bdaf 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -72,3 +72,4 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-delegate/README.md b/samples/openapi3/server/petstore/springboot-delegate/README.md index befc961488ae..e6de7e038cea 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/README.md +++ b/samples/openapi3/server/petstore/springboot-delegate/README.md @@ -2,15 +2,20 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:80/v3/api-docs/ + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-delegate/pom.xml b/samples/openapi3/server/petstore/springboot-delegate/pom.xml index 8edd9579ef5c..3817b6421c0b 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/pom.xml +++ b/samples/openapi3/server/petstore/springboot-delegate/pom.xml @@ -10,11 +10,12 @@ ${java.version} ${java.version} 1.6.4 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -68,5 +69,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index cb088f451935..000000000000 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java index 61d4ebb31830..9aa29284ab5f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,18 +1,10 @@ package org.openapitools.configuration; import org.springframework.context.annotation.Bean; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; -import org.springframework.util.StreamUtils; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -20,34 +12,9 @@ @Controller public class HomeController { - private static YAMLMapper yamlMapper = new YAMLMapper(); - - @Value("classpath:/openapi.yaml") - private Resource openapi; - - @Bean - public String openapiContent() throws IOException { - try(InputStream is = openapi.getInputStream()) { - return StreamUtils.copyToString(is, Charset.defaultCharset()); - } - } - - @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") - @ResponseBody - public String openapiYaml() throws IOException { - return openapiContent(); - } - - @GetMapping(value = "/openapi.json", produces = "application/json") - @ResponseBody - public Object openapiJson() throws IOException { - return yamlMapper.readValue(openapiContent(), Object.class); - } - @RequestMapping("/") public String index() { - return "redirect:swagger-ui/index.html?url=../openapi.json"; + return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 6d8d3656155a..dcc247ba165c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -66,3 +66,4 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/README.md b/samples/openapi3/server/petstore/springboot-implicitHeaders/README.md index befc961488ae..e6de7e038cea 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/README.md +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/README.md @@ -2,15 +2,20 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:80/v3/api-docs/ + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml index 7759fcc3928a..072919a92260 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml @@ -10,11 +10,12 @@ ${java.version} ${java.version} 1.6.4 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -68,5 +69,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index cb088f451935..000000000000 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java index 61d4ebb31830..9aa29284ab5f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,18 +1,10 @@ package org.openapitools.configuration; import org.springframework.context.annotation.Bean; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; -import org.springframework.util.StreamUtils; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -20,34 +12,9 @@ @Controller public class HomeController { - private static YAMLMapper yamlMapper = new YAMLMapper(); - - @Value("classpath:/openapi.yaml") - private Resource openapi; - - @Bean - public String openapiContent() throws IOException { - try(InputStream is = openapi.getInputStream()) { - return StreamUtils.copyToString(is, Charset.defaultCharset()); - } - } - - @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") - @ResponseBody - public String openapiYaml() throws IOException { - return openapiContent(); - } - - @GetMapping(value = "/openapi.json", produces = "application/json") - @ResponseBody - public Object openapiJson() throws IOException { - return yamlMapper.readValue(openapiContent(), Object.class); - } - @RequestMapping("/") public String index() { - return "redirect:swagger-ui/index.html?url=../openapi.json"; + return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES index bd5a0e2c0574..0ed351e7bdaf 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -72,3 +72,4 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-reactive/README.md b/samples/openapi3/server/petstore/springboot-reactive/README.md index 55dc732c1b00..e6de7e038cea 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/README.md +++ b/samples/openapi3/server/petstore/springboot-reactive/README.md @@ -2,12 +2,20 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:80/v3/api-docs/ + Start your server as a simple java application +You can view the api documentation in swagger-ui by pointing to +http://localhost:80/swagger-ui.html + Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/pom.xml b/samples/openapi3/server/petstore/springboot-reactive/pom.xml index 098af25f1834..417ecda3e692 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/pom.xml +++ b/samples/openapi3/server/petstore/springboot-reactive/pom.xml @@ -10,11 +10,12 @@ ${java.version} ${java.version} 1.6.4 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -37,7 +38,7 @@ org.springdoc - springdoc-openapi-ui + springdoc-openapi-webflux-ui ${springdoc.version} @@ -68,5 +69,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 254af0225142..000000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.reactive.config.CorsRegistry; -import org.springframework.web.reactive.config.ResourceHandlerRegistry; -import org.springframework.web.reactive.config.WebFluxConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebFluxConfigurer webConfigurer() { - return new WebFluxConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java index fadcaeb03c60..cf658246a9de 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,22 +1,13 @@ package org.openapitools.configuration; import org.springframework.context.annotation.Bean; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; -import org.springframework.util.StreamUtils; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.reactive.function.server.RouterFunction; import org.springframework.web.reactive.function.server.ServerResponse; - -import java.io.IOException; -import java.io.InputStream; import java.net.URI; -import java.nio.charset.Charset; import static org.springframework.web.reactive.function.server.RequestPredicates.GET; import static org.springframework.web.reactive.function.server.RouterFunctions.route; @@ -27,37 +18,12 @@ @Controller public class HomeController { - private static YAMLMapper yamlMapper = new YAMLMapper(); - - @Value("classpath:/openapi.yaml") - private Resource openapi; - - @Bean - public String openapiContent() throws IOException { - try(InputStream is = openapi.getInputStream()) { - return StreamUtils.copyToString(is, Charset.defaultCharset()); - } - } - - @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") - @ResponseBody - public String openapiYaml() throws IOException { - return openapiContent(); - } - - @GetMapping(value = "/openapi.json", produces = "application/json") - @ResponseBody - public Object openapiJson() throws IOException { - return yamlMapper.readValue(openapiContent(), Object.class); - } - @Bean RouterFunction index() { return route( GET("/"), - req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui/index.html?url=../openapi.json")).build() + req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui.html")).build() ); } - -} +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator-ignore b/samples/openapi3/server/petstore/springboot-source/.openapi-generator-ignore similarity index 100% rename from samples/server/petstore/spring-mvc-default-value/.openapi-generator-ignore rename to samples/openapi3/server/petstore/springboot-source/.openapi-generator-ignore diff --git a/samples/openapi3/server/petstore/springboot-source/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-source/.openapi-generator/FILES new file mode 100644 index 000000000000..3a114308838f --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-source/.openapi-generator/FILES @@ -0,0 +1,22 @@ +README.md +pom.xml +src/main/java/org/openapitools/OpenApiGeneratorApplication.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java +src/main/resources/application.properties +src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION b/samples/openapi3/server/petstore/springboot-source/.openapi-generator/VERSION similarity index 100% rename from samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION rename to samples/openapi3/server/petstore/springboot-source/.openapi-generator/VERSION diff --git a/samples/server/petstore/spring-mvc-default-value/README.md b/samples/openapi3/server/petstore/springboot-source/README.md similarity index 73% rename from samples/server/petstore/spring-mvc-default-value/README.md rename to samples/openapi3/server/petstore/springboot-source/README.md index 1ff91b81b2ec..2649bbca9eb0 100644 --- a/samples/server/petstore/spring-mvc-default-value/README.md +++ b/samples/openapi3/server/petstore/springboot-source/README.md @@ -2,17 +2,18 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) + +The OpenAPI specification used to generate this project is available to download using the following url: +http://localhost:8080/openapi.json Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:8080/ +http://localhost:8080/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/pom.xml b/samples/openapi3/server/petstore/springboot-source/pom.xml similarity index 77% rename from samples/server/petstore/spring-mvc-default-value/pom.xml rename to samples/openapi3/server/petstore/springboot-source/pom.xml index dc8d196bfaf2..62a892cfbaa9 100644 --- a/samples/server/petstore/spring-mvc-default-value/pom.xml +++ b/samples/openapi3/server/petstore/springboot-source/pom.xml @@ -1,20 +1,20 @@ 4.0.0 - org.openapitools - spring-mvc-default-value + org.openapitools.openapi3 + springboot jar - spring-mvc-default-value - 1.0.0 + springboot + 1.0.0-SNAPSHOT 1.8 ${java.version} ${java.version} - 2.9.2 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.5.8 + 2.6.3 src/main/java @@ -34,11 +34,14 @@ org.springframework.data spring-data-commons - - io.springfox - springfox-swagger2 - ${springfox.version} + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core @@ -68,5 +71,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/RFC3339DateFormat.java similarity index 100% rename from samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/RFC3339DateFormat.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/RFC3339DateFormat.java diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/ApiUtil.java similarity index 100% rename from samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/ApiUtil.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/ApiUtil.java diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java similarity index 52% rename from samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java index 864173ded4fc..c29de936952a 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java @@ -7,8 +7,6 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -26,7 +24,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated -@Api(value = "pet", description = "the pet API") public interface PetApi { default Optional getRequest() { @@ -36,34 +33,33 @@ default Optional getRequest() { /** * POST /pet : Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation( - tags = { "pet" }, - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") - }) @RequestMapping( method = RequestMethod.POST, value = "/pet", + produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + default ResponseEntity addPet( + @Valid @RequestBody Pet pet ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -74,32 +70,15 @@ default ResponseEntity addPet( * * @param petId Pet id to delete (required) * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) + * @return Invalid pet value (status code 400) */ - @ApiOperation( - tags = { "pet" }, - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") - }) @RequestMapping( method = RequestMethod.DELETE, value = "/pet/{petId}" ) default ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey + @PathVariable("petId") Long petId, + @RequestHeader(value = "api_key", required = false) String apiKey ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -114,36 +93,18 @@ default ResponseEntity deletePet( * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") - }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) default ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + @NotNull @Valid @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -168,36 +129,18 @@ default ResponseEntity> findPetsByStatus( * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet.class, - responseContainer = "Set", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), - @ApiResponse(code = 400, message = "Invalid tag value") - }) @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + default ResponseEntity> findPetsByTags( + @NotNull @Valid @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -222,33 +165,18 @@ default ResponseEntity> findPetsByTags( * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation( - tags = { "pet" }, - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet.class, - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") - }) @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) default ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -267,38 +195,35 @@ default ResponseEntity getPetById( /** * PUT /pet : Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation( - tags = { "pet" }, - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") - }) @RequestMapping( method = RequestMethod.PUT, value = "/pet", + produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + default ResponseEntity updatePet( + @Valid @RequestBody Pet pet ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -312,30 +237,15 @@ default ResponseEntity updatePet( * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation( - tags = { "pet" }, - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 405, message = "Invalid input") - }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + @PathVariable("petId") Long petId, + @Valid @RequestPart(value = "name", required = false) String name, + @Valid @RequestPart(value = "status", required = false) String status ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -350,22 +260,6 @@ default ResponseEntity updatePetWithForm( * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", @@ -373,9 +267,9 @@ default ResponseEntity updatePetWithForm( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + @PathVariable("petId") Long petId, + @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @RequestPart(value = "file", required = false) MultipartFile file ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java similarity index 92% rename from samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java index 57cbf21bde71..4ad9ef06158b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java @@ -9,7 +9,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java similarity index 66% rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java index 1292cf4edaa2..577b14c1ad5d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java @@ -7,7 +7,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -25,7 +24,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated -@Api(value = "store", description = "the store API") public interface StoreApi { default Optional getRequest() { @@ -33,29 +31,19 @@ default Optional getRequest() { } /** - * DELETE /store/order/{order_id} : Delete purchase order by ID + * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * * @param orderId ID of the order that needs to be deleted (required) * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation( - tags = { "store" }, - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = "/store/order/{orderId}" ) default ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + @PathVariable("orderId") String orderId ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -68,20 +56,6 @@ default ResponseEntity deleteOrder( * * @return successful operation (status code 200) */ - @ApiOperation( - tags = { "store" }, - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Integer.class, - responseContainer = "Map", - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") - }) @RequestMapping( method = RequestMethod.GET, value = "/store/inventory", @@ -96,7 +70,7 @@ default ResponseEntity> getInventory( /** - * GET /store/order/{order_id} : Find purchase order by ID + * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * * @param orderId ID of pet that needs to be fetched (required) @@ -104,25 +78,13 @@ default ResponseEntity> getInventory( * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation( - tags = { "store" }, - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = "/store/order/{orderId}", produces = { "application/xml", "application/json" } ) default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + @Min(1L) @Max(5L) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -146,28 +108,18 @@ default ResponseEntity getOrderById( /** * POST /store/order : Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation( - tags = { "store" }, - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") - }) @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java similarity index 92% rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java index a1f02f844bf3..293d3035f805 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java @@ -9,7 +9,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java similarity index 58% rename from samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java index 8b7791294a9b..d8c777c16eb2 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java @@ -8,7 +8,6 @@ import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -26,7 +25,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated -@Api(value = "user", description = "the user API") public interface UserApi { default Optional getRequest() { @@ -37,24 +35,16 @@ default Optional getRequest() { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation( - tags = { "user" }, - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -64,24 +54,16 @@ default ResponseEntity createUser( /** * POST /user/createWithArray : Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -91,24 +73,16 @@ default ResponseEntity createUsersWithArrayInput( /** * POST /user/createWithList : Creates list of users with given input array * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -123,22 +97,12 @@ default ResponseEntity createUsersWithListInput( * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation( - tags = { "user" }, - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) default ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + @PathVariable("username") String username ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -153,25 +117,13 @@ default ResponseEntity deleteUser( * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation( - tags = { "user" }, - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) default ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + @PathVariable("username") String username ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -200,25 +152,14 @@ default ResponseEntity getUserByName( * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation( - tags = { "user" }, - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") - }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) default ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Valid @RequestParam(value = "password", required = true) String password ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -230,15 +171,6 @@ default ResponseEntity loginUser( * * @return successful operation (status code 200) */ - @ApiOperation( - tags = { "user" }, - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) @RequestMapping( method = RequestMethod.GET, value = "/user/logout" @@ -256,27 +188,18 @@ default ResponseEntity logoutUser( * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation( - tags = { "user" }, - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") - }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @PathVariable("username") String username, + @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java similarity index 92% rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java index 8efc6418c2e8..aab4767a50d0 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java @@ -9,7 +9,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/configuration/HomeController.java new file mode 100644 index 000000000000..f773286ac450 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/configuration/HomeController.java @@ -0,0 +1,61 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; +import org.springframework.util.StreamUtils; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +public class HomeController { + + private static YAMLMapper yamlMapper = new YAMLMapper(); + + @Value("classpath:/openapi.yaml") + private Resource openapi; + + @Bean + public String openapiContent() throws IOException { + try(InputStream is = openapi.getInputStream()) { + return StreamUtils.copyToString(is, Charset.defaultCharset()); + } + } + + @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") + @ResponseBody + public String openapiYaml() throws IOException { + return openapiContent(); + } + + @GetMapping(value = "/openapi.json", produces = "application/json") + @ResponseBody + public Object openapiJson() throws IOException { + return yamlMapper.readValue(openapiContent(), Object.class); + } + + static final String API_DOCS_PATH = "/openapi.json"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + + @RequestMapping("/") + public String index() { + return "redirect:swagger-ui.html"; + } + +} \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java similarity index 89% rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java index 8adf35c2fa00..6218e1d3e171 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java @@ -4,8 +4,6 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -16,7 +14,7 @@ import javax.annotation.Generated; /** - * Category + * A category for a pet */ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -26,7 +24,7 @@ public class Category { private Long id; @JsonProperty("name") - private String name = "default-name"; + private String name; public Category id(Long id) { this.id = id; @@ -38,7 +36,6 @@ public Category id(Long id) { * @return id */ - @ApiModelProperty(value = "") public Long getId() { return id; } @@ -56,8 +53,7 @@ public Category name(String name) { * Get name * @return name */ - @NotNull - @ApiModelProperty(required = true, value = "") + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") public String getName() { return name; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java similarity index 93% rename from samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java index 131e671e9160..279de49b2ce0 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -17,7 +15,7 @@ import javax.annotation.Generated; /** - * ModelApiResponse + * Describes the result of uploading an image resource */ @JsonTypeName("ApiResponse") @@ -43,7 +41,6 @@ public ModelApiResponse code(Integer code) { * @return code */ - @ApiModelProperty(value = "") public Integer getCode() { return code; } @@ -62,7 +59,6 @@ public ModelApiResponse type(String type) { * @return type */ - @ApiModelProperty(value = "") public String getType() { return type; } @@ -81,7 +77,6 @@ public ModelApiResponse message(String message) { * @return message */ - @ApiModelProperty(value = "") public String getMessage() { return message; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java similarity index 94% rename from samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java index 6bd55e5a1548..13ec59e549c9 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java @@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,7 +17,7 @@ import javax.annotation.Generated; /** - * Order + * An order for a pets from the pet store */ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -91,7 +89,6 @@ public Order id(Long id) { * @return id */ - @ApiModelProperty(value = "") public Long getId() { return id; } @@ -110,7 +107,6 @@ public Order petId(Long petId) { * @return petId */ - @ApiModelProperty(value = "") public Long getPetId() { return petId; } @@ -129,7 +125,6 @@ public Order quantity(Integer quantity) { * @return quantity */ - @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } @@ -148,7 +143,6 @@ public Order shipDate(OffsetDateTime shipDate) { * @return shipDate */ @Valid - @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } @@ -167,7 +161,6 @@ public Order status(StatusEnum status) { * @return status */ - @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } @@ -186,7 +179,6 @@ public Order complete(Boolean complete) { * @return complete */ - @ApiModelProperty(value = "") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java similarity index 93% rename from samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java index d330c28e6791..05a9ea718d7a 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java @@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.model.Category; @@ -21,7 +19,7 @@ import javax.annotation.Generated; /** - * Pet + * A pet for sale in the pet store */ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -94,7 +92,6 @@ public Pet id(Long id) { * @return id */ - @ApiModelProperty(value = "") public Long getId() { return id; } @@ -113,7 +110,6 @@ public Pet category(Category category) { * @return category */ @Valid - @ApiModelProperty(value = "") public Category getCategory() { return category; } @@ -132,7 +128,6 @@ public Pet name(String name) { * @return name */ @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } @@ -156,7 +151,6 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } @@ -183,7 +177,6 @@ public Pet addTagsItem(Tag tagsItem) { * @return tags */ @Valid - @ApiModelProperty(value = "") public List getTags() { return tags; } @@ -202,7 +195,6 @@ public Pet status(StatusEnum status) { * @return status */ - @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java similarity index 92% rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java index 03b4ffcdadca..e3ba0c6d29a8 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java @@ -4,8 +4,6 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -16,7 +14,7 @@ import javax.annotation.Generated; /** - * Tag + * A tag for a pet */ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -38,7 +36,6 @@ public Tag id(Long id) { * @return id */ - @ApiModelProperty(value = "") public Long getId() { return id; } @@ -57,7 +54,6 @@ public Tag name(String name) { * @return name */ - @ApiModelProperty(value = "") public String getName() { return name; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java similarity index 93% rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java index cff62427bf1a..8a27d52814ab 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java @@ -4,8 +4,6 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -16,7 +14,7 @@ import javax.annotation.Generated; /** - * User + * A User who is purchasing from the pet store */ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -56,7 +54,6 @@ public User id(Long id) { * @return id */ - @ApiModelProperty(value = "") public Long getId() { return id; } @@ -75,7 +72,6 @@ public User username(String username) { * @return username */ - @ApiModelProperty(value = "") public String getUsername() { return username; } @@ -94,7 +90,6 @@ public User firstName(String firstName) { * @return firstName */ - @ApiModelProperty(value = "") public String getFirstName() { return firstName; } @@ -113,7 +108,6 @@ public User lastName(String lastName) { * @return lastName */ - @ApiModelProperty(value = "") public String getLastName() { return lastName; } @@ -132,7 +126,6 @@ public User email(String email) { * @return email */ - @ApiModelProperty(value = "") public String getEmail() { return email; } @@ -151,7 +144,6 @@ public User password(String password) { * @return password */ - @ApiModelProperty(value = "") public String getPassword() { return password; } @@ -170,7 +162,6 @@ public User phone(String phone) { * @return phone */ - @ApiModelProperty(value = "") public String getPhone() { return phone; } @@ -189,7 +180,6 @@ public User userStatus(Integer userStatus) { * @return userStatus */ - @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/resources/application.properties b/samples/openapi3/server/petstore/springboot-source/src/main/resources/application.properties similarity index 73% rename from samples/server/petstore/spring-mvc-default-value/src/main/resources/application.properties rename to samples/openapi3/server/petstore/springboot-source/src/main/resources/application.properties index b80025e1aa33..7e90813e59b2 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/resources/application.properties +++ b/samples/openapi3/server/petstore/springboot-source/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=8080 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..5fc39a2ce2a4 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml @@ -0,0 +1,893 @@ +openapi: 3.0.0 +info: + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io +servers: +- url: http://petstore.swagger.io/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + put: + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object' + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_1' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: store + /store/order/{orderId}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: orderId + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: orderId + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Create user + tags: + - user + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + Set-Cookie: + description: Cookie authentication key for use with the `api_key` apiKey + authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - api_key: [] + summary: Delete user + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + security: + - api_key: [] + summary: Updated user + tags: + - user + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: user +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + 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 + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' + schemas: + Order: + description: An order for a pets from the pet store + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + title: Pet Order + type: object + xml: + name: Order + Category: + description: A category for a pet + example: + name: name + id: 6 + properties: + id: + format: int64 + type: integer + name: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" + type: string + title: Pet category + type: object + xml: + name: Category + User: + description: A User who is purchasing from the pet store + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + title: a User + type: object + xml: + name: User + Tag: + description: A tag for a pet + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + title: Pet Tag + type: object + xml: + name: Tag + Pet: + description: A pet for sale in the pet store + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + deprecated: true + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + title: a Pet + type: object + xml: + name: Pet + ApiResponse: + description: Describes the result of uploading an image resource + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + title: An uploaded response + type: object + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/resources/static/swagger-ui.html b/samples/openapi3/server/petstore/springboot-source/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-source/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/openapi3/server/petstore/springboot-source/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-source/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-source/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES index 6d8d3656155a..dcc247ba165c 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -66,3 +66,4 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-useoptional/README.md b/samples/openapi3/server/petstore/springboot-useoptional/README.md index befc961488ae..e6de7e038cea 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/README.md +++ b/samples/openapi3/server/petstore/springboot-useoptional/README.md @@ -2,15 +2,20 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:80/v3/api-docs/ + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml b/samples/openapi3/server/petstore/springboot-useoptional/pom.xml index 975547fc709c..d01f0f5e07f2 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml +++ b/samples/openapi3/server/petstore/springboot-useoptional/pom.xml @@ -10,11 +10,12 @@ ${java.version} ${java.version} 1.6.4 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -68,5 +69,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index cb088f451935..000000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java index 61d4ebb31830..9aa29284ab5f 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,18 +1,10 @@ package org.openapitools.configuration; import org.springframework.context.annotation.Bean; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; -import org.springframework.util.StreamUtils; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -20,34 +12,9 @@ @Controller public class HomeController { - private static YAMLMapper yamlMapper = new YAMLMapper(); - - @Value("classpath:/openapi.yaml") - private Resource openapi; - - @Bean - public String openapiContent() throws IOException { - try(InputStream is = openapi.getInputStream()) { - return StreamUtils.copyToString(is, Charset.defaultCharset()); - } - } - - @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") - @ResponseBody - public String openapiYaml() throws IOException { - return openapiContent(); - } - - @GetMapping(value = "/openapi.json", produces = "application/json") - @ResponseBody - public Object openapiJson() throws IOException { - return yamlMapper.readValue(openapiContent(), Object.class); - } - @RequestMapping("/") public String index() { - return "redirect:swagger-ui/index.html?url=../openapi.json"; + return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot/.openapi-generator/FILES index 7de4a0d86c09..baf10ab6b83b 100644 --- a/samples/openapi3/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/ApiUtil.java src/main/java/org/openapitools/api/PetApi.java @@ -18,3 +18,4 @@ src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/User.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot/README.md b/samples/openapi3/server/petstore/springboot/README.md index 5bbe4a495d99..5cd22b6081a2 100644 --- a/samples/openapi3/server/petstore/springboot/README.md +++ b/samples/openapi3/server/petstore/springboot/README.md @@ -2,15 +2,20 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:8080/v3/api-docs/ + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:8080/ +http://localhost:8080/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot/pom.xml b/samples/openapi3/server/petstore/springboot/pom.xml index 4320644df2cc..0524f400cd1f 100644 --- a/samples/openapi3/server/petstore/springboot/pom.xml +++ b/samples/openapi3/server/petstore/springboot/pom.xml @@ -10,11 +10,12 @@ ${java.version} ${java.version} 1.6.4 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -68,5 +69,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index cb088f451935..000000000000 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java index 61d4ebb31830..9aa29284ab5f 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,18 +1,10 @@ package org.openapitools.configuration; import org.springframework.context.annotation.Bean; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; -import org.springframework.util.StreamUtils; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -20,34 +12,9 @@ @Controller public class HomeController { - private static YAMLMapper yamlMapper = new YAMLMapper(); - - @Value("classpath:/openapi.yaml") - private Resource openapi; - - @Bean - public String openapiContent() throws IOException { - try(InputStream is = openapi.getInputStream()) { - return StreamUtils.copyToString(is, Charset.defaultCharset()); - } - } - - @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") - @ResponseBody - public String openapiYaml() throws IOException { - return openapiContent(); - } - - @GetMapping(value = "/openapi.json", produces = "application/json") - @ResponseBody - public Object openapiJson() throws IOException { - return yamlMapper.readValue(openapiContent(), Object.class); - } - @RequestMapping("/") public String index() { - return "redirect:swagger-ui/index.html?url=../openapi.json"; + return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/java-camel/.openapi-generator/FILES b/samples/server/petstore/java-camel/.openapi-generator/FILES index 4c9d78d30ebe..24eceb6f8ad9 100644 --- a/samples/server/petstore/java-camel/.openapi-generator/FILES +++ b/samples/server/petstore/java-camel/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/RestConfiguration.java src/main/java/org/openapitools/ValidationErrorProcessor.java diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index cb088f451935..000000000000 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/config/swagger/OpenAPIDocumentationConfig.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/config/swagger/OpenAPIDocumentationConfig.java deleted file mode 100644 index dac5a9cdd15f..000000000000 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/config/swagger/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.prokarma.pkmst.config.swagger; - -import java.util.Date; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.ResponseEntity; -import org.springframework.util.StopWatch; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -//import static springfox.documentation.builders.PathSelectors.regex; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; -/** - * Enable swagger ui for application - * @author pkmst - * - */ -@EnableSwagger2 -@Configuration -public class OpenAPIDocumentationConfig { - - public static final String DEFAULT_INCLUDE_PATTERN = "/pkmst/.*"; - @Bean - public Docket swaggerSpringfoxDocket(PkmstProperties pkmstProperties) { - StopWatch watch = new StopWatch(); - watch.start(); - Contact contact = new Contact( - pkmstProperties.getSwagger().getContactName(), - pkmstProperties.getSwagger().getContactUrl(), - pkmstProperties.getSwagger().getContactEmail()); - - ApiInfo apiInfo = new ApiInfo( - pkmstProperties.getSwagger().getTitle(), - pkmstProperties.getSwagger().getDescription(), - pkmstProperties.getSwagger().getVersion(), - pkmstProperties.getSwagger().getTermsOfServiceUrl(), - contact, - pkmstProperties.getSwagger().getLicense(), - pkmstProperties.getSwagger().getLicenseUrl()); - - Docket docket = new Docket(DocumentationType.SWAGGER_2) - .apiInfo(apiInfo) - .forCodeGeneration(true) - .genericModelSubstitutes(ResponseEntity.class) - .ignoredParameterTypes(java.sql.Date.class) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.ZonedDateTime.class, Date.class) - .directModelSubstitute(java.time.LocalDateTime.class, Date.class) - .select() - .apis(RequestHandlerSelectors.basePackage("com.prokarma.pkmst")) - // .paths(regex(DEFAULT_INCLUDE_PATTERN)) - .paths(PathSelectors.any()) - .build(); - watch.stop(); - return docket; - } - -} \ No newline at end of file diff --git a/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES b/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES index 476018140121..65d58a20ec41 100644 --- a/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES +++ b/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/api/ApiUtil.java diff --git a/samples/server/petstore/spring-boot-nullable-set/pom.xml b/samples/server/petstore/spring-boot-nullable-set/pom.xml index 616991b3db3d..896c15f5167f 100644 --- a/samples/server/petstore/spring-boot-nullable-set/pom.xml +++ b/samples/server/petstore/spring-boot-nullable-set/pom.xml @@ -10,11 +10,12 @@ ${java.version} ${java.version} 1.6.4 + 4.4.1-1 org.springframework.boot spring-boot-starter-parent - 2.6.2 + 2.6.3 src/main/java @@ -62,5 +63,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java index 7406be7426c1..796126d05a9f 100644 --- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java @@ -59,7 +59,7 @@ default Optional getRequest() { consumes = "application/json" ) default ResponseEntity nullableTest( - @Parameter(name = "ObjectWithUniqueItems", description = "", schema = @Schema(description = "")) @Valid @RequestBody(required = false) ObjectWithUniqueItems objectWithUniqueItems + @Parameter(name = "ObjectWithUniqueItems", description = "") @Valid @RequestBody(required = false) ObjectWithUniqueItems objectWithUniqueItems ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES deleted file mode 100644 index 3522987f15f9..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES +++ /dev/null @@ -1,13 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java -src/main/java/org/openapitools/RFC3339DateFormat.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/TestHeadersApi.java -src/main/java/org/openapitools/api/TestHeadersApiController.java -src/main/java/org/openapitools/api/TestQueryParamsApi.java -src/main/java/org/openapitools/api/TestQueryParamsApiController.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/model/TestResponse.java -src/main/resources/application.properties -src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java deleted file mode 100644 index c05f7a3be323..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.TestResponse; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "test-headers", description = "the test-headers API") -public interface TestHeadersApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * GET /test-headers : test headers - * desc - * - * @param headerNumber (optional, default to 11.2) - * @param headerString (optional, default to qwerty) - * @param headerStringWrapped (optional, default to qwerty) - * @param headerStringQuotes (optional, default to qwerty\"with quotes\" test) - * @param headerStringQuotesWrapped (optional, default to qwerty\"with quotes\" test) - * @param headerBoolean (optional, default to true) - * @return default response (status code 200) - */ - @ApiOperation( - tags = { "verify-default-value" }, - value = "test headers", - nickname = "headersTest", - notes = "desc", - response = TestResponse.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "default response", response = TestResponse.class) - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/test-headers", - produces = { "application/json" } - ) - default ResponseEntity headersTest( - @ApiParam(value = "", defaultValue = "11.2") @RequestHeader(value = "headerNumber", required = false, defaultValue = "11.2") BigDecimal headerNumber, - @ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerString", required = false, defaultValue = "qwerty") String headerString, - @ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerStringWrapped", required = false, defaultValue = "qwerty") String headerStringWrapped, - @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotes", required = false, defaultValue = "qwerty\"with quotes\" test") String headerStringQuotes, - @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotesWrapped", required = false, defaultValue = "qwerty\"with quotes\" test") String headerStringQuotesWrapped, - @ApiParam(value = "", defaultValue = "true") @RequestHeader(value = "headerBoolean", required = false, defaultValue = "true") Boolean headerBoolean - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"numberField\" : 6.027456183070403, \"booleanField\" : true, \"id\" : 0, \"stringField\" : \"asd\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java deleted file mode 100644 index cdc9e71f4347..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.toto.base-path:}") -public class TestHeadersApiController implements TestHeadersApi { - - private final NativeWebRequest request; - - @Autowired - public TestHeadersApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java deleted file mode 100644 index 701275ec4880..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.TestResponse; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "test-query-params", description = "the test-query-params API") -public interface TestQueryParamsApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * GET /test-query-params : test query params - * desc - * - * @param queryNumber (optional, default to 11.2) - * @param queryString (optional, default to qwerty) - * @param queryStringWrapped (optional, default to qwerty) - * @param queryStringQuotes (optional, default to qwerty\"with quotes\" test) - * @param queryStringQuotesWrapped (optional, default to qwerty\"with quotes\" test) - * @param queryBoolean (optional, default to true) - * @return default response (status code 200) - */ - @ApiOperation( - tags = { "verify-default-value" }, - value = "test query params", - nickname = "queryParamsTest", - notes = "desc", - response = TestResponse.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "default response", response = TestResponse.class) - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/test-query-params", - produces = { "application/json" } - ) - default ResponseEntity queryParamsTest( - @ApiParam(value = "", defaultValue = "11.2") @Valid @RequestParam(value = "queryNumber", required = false, defaultValue = "11.2") BigDecimal queryNumber, - @ApiParam(value = "", defaultValue = "qwerty") @Valid @RequestParam(value = "queryString", required = false, defaultValue = "qwerty") String queryString, - @ApiParam(value = "", defaultValue = "qwerty") @Valid @RequestParam(value = "queryStringWrapped", required = false, defaultValue = "qwerty") String queryStringWrapped, - @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @Valid @RequestParam(value = "queryStringQuotes", required = false, defaultValue = "qwerty\"with quotes\" test") String queryStringQuotes, - @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @Valid @RequestParam(value = "queryStringQuotesWrapped", required = false, defaultValue = "qwerty\"with quotes\" test") String queryStringQuotesWrapped, - @ApiParam(value = "", defaultValue = "true") @Valid @RequestParam(value = "queryBoolean", required = false, defaultValue = "true") Boolean queryBoolean - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"numberField\" : 6.027456183070403, \"booleanField\" : true, \"id\" : 0, \"stringField\" : \"asd\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java deleted file mode 100644 index 1884ac71c223..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.toto.base-path:}") -public class TestQueryParamsApiController implements TestQueryParamsApi { - - private final NativeWebRequest request; - - @Autowired - public TestQueryParamsApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 25727830541b..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - - -} diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 03247106ff56..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("toto") - .description("desc") - .license("") - .licenseUrl("http://unlicense.org") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.toto.base-path:}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java deleted file mode 100644 index cae289f03d1b..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java +++ /dev/null @@ -1,157 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TestResponse - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TestResponse { - - @JsonProperty("id") - private Integer id; - - @JsonProperty("stringField") - private String stringField = "asd"; - - @JsonProperty("numberField") - private BigDecimal numberField = new BigDecimal("11"); - - @JsonProperty("booleanField") - private Boolean booleanField = true; - - public TestResponse id(Integer id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public TestResponse stringField(String stringField) { - this.stringField = stringField; - return this; - } - - /** - * Get stringField - * @return stringField - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getStringField() { - return stringField; - } - - public void setStringField(String stringField) { - this.stringField = stringField; - } - - public TestResponse numberField(BigDecimal numberField) { - this.numberField = numberField; - return this; - } - - /** - * Get numberField - * @return numberField - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumberField() { - return numberField; - } - - public void setNumberField(BigDecimal numberField) { - this.numberField = numberField; - } - - public TestResponse booleanField(Boolean booleanField) { - this.booleanField = booleanField; - return this; - } - - /** - * Get booleanField - * @return booleanField - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Boolean getBooleanField() { - return booleanField; - } - - public void setBooleanField(Boolean booleanField) { - this.booleanField = booleanField; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestResponse testResponse = (TestResponse) o; - return Objects.equals(this.id, testResponse.id) && - Objects.equals(this.stringField, testResponse.stringField) && - Objects.equals(this.numberField, testResponse.numberField) && - Objects.equals(this.booleanField, testResponse.booleanField); - } - - @Override - public int hashCode() { - return Objects.hash(id, stringField, numberField, booleanField); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestResponse {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" stringField: ").append(toIndentedString(stringField)).append("\n"); - sb.append(" numberField: ").append(toIndentedString(numberField)).append("\n"); - sb.append(" booleanField: ").append(toIndentedString(booleanField)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml deleted file mode 100644 index bd7100d9b552..000000000000 --- a/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml +++ /dev/null @@ -1,170 +0,0 @@ -openapi: 3.0.1 -info: - description: desc - title: toto - version: 1.0.0 -servers: -- description: / - url: / -tags: -- description: verify-default-value - name: verify-default-value -paths: - /test-headers: - get: - description: desc - operationId: headersTest - parameters: - - explode: false - in: header - name: headerNumber - required: false - schema: - default: 11.2 - type: number - style: simple - - explode: false - in: header - name: headerString - required: false - schema: - default: qwerty - type: string - style: simple - - explode: false - in: header - name: headerStringWrapped - required: false - schema: - default: qwerty - type: string - style: simple - - explode: false - in: header - name: headerStringQuotes - required: false - schema: - default: qwerty"with quotes" test - type: string - style: simple - - explode: false - in: header - name: headerStringQuotesWrapped - required: false - schema: - default: qwerty"with quotes" test - type: string - style: simple - - explode: false - in: header - name: headerBoolean - required: false - schema: - default: true - type: boolean - style: simple - responses: - default: - content: - application/json: - schema: - $ref: '#/components/schemas/TestResponse' - description: default response - summary: test headers - tags: - - verify-default-value - x-accepts: application/json - x-tags: - - tag: verify-default-value - /test-query-params: - get: - description: desc - operationId: queryParamsTest - parameters: - - explode: true - in: query - name: queryNumber - required: false - schema: - default: 11.2 - type: number - style: form - - explode: true - in: query - name: queryString - required: false - schema: - default: qwerty - type: string - style: form - - explode: true - in: query - name: queryStringWrapped - required: false - schema: - default: qwerty - type: string - style: form - - explode: true - in: query - name: queryStringQuotes - required: false - schema: - default: qwerty"with quotes" test - type: string - style: form - - explode: true - in: query - name: queryStringQuotesWrapped - required: false - schema: - default: qwerty"with quotes" test - type: string - style: form - - explode: true - in: query - name: queryBoolean - required: false - schema: - default: true - type: boolean - style: form - responses: - default: - content: - application/json: - schema: - $ref: '#/components/schemas/TestResponse' - description: default response - summary: test query params - tags: - - verify-default-value - x-accepts: application/json - x-tags: - - tag: verify-default-value -components: - schemas: - TestResponse: - example: - numberField: 6.027456183070403 - booleanField: true - id: 0 - stringField: asd - properties: - id: - type: integer - stringField: - default: asd - type: string - numberField: - default: 11 - type: number - booleanField: - default: true - type: boolean - required: - - booleanField - - id - - numberField - - stringField - type: object diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator-ignore b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/.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/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES deleted file mode 100644 index 97eae4aa8c7a..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES +++ /dev/null @@ -1,70 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java -src/main/java/org/openapitools/configuration/RFC3339DateFormat.java -src/main/java/org/openapitools/configuration/WebApplication.java -src/main/java/org/openapitools/configuration/WebMvcConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION deleted file mode 100644 index 5f68295fc196..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/README.md b/samples/server/petstore/spring-mvc-j8-async/README.md deleted file mode 100644 index 4d5e52bd8f88..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# OpenAPI generated server - -Spring MVC Server - - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the Spring MVC framework. - -The underlying library integrating OpenAPI to Spring-MVC is [springfox](https://github.com/springfox/springfox) - -You can view the server in swagger-ui by pointing to -http://localhost:8002/v2/ \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml deleted file mode 100644 index 5a556ac88569..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/pom.xml +++ /dev/null @@ -1,178 +0,0 @@ - - 4.0.0 - org.openapitools - spring-mvc-server-j8-async - jar - spring-mvc-server-j8-async - 1.0.0 - - src/main/java - - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty-version} - - - /v2 - - target/${project.artifactId}-${project.version} - 8079 - stopit - 10 - - 8002 - 60000 - - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - - - - - start-jetty - pre-integration-test - - start - - - 0 - true - - - - stop-jetty - post-integration-test - - stop - - - - - - - - - org.slf4j - slf4j-log4j12 - ${slf4j-version} - - - - - org.springframework - spring-core - ${spring-version} - - - org.springframework - spring-webmvc - ${spring-version} - - - org.springframework - spring-web - ${spring-version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - - - jakarta.xml.bind - jakarta.xml.bind-api - ${jakarta.xml.bind-version} - - - - io.springfox - springfox-swagger2 - ${springfox-version} - - - com.fasterxml.jackson.core - jackson-annotations - - - - - io.springfox - springfox-swagger-ui - ${springfox-version} - - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - - junit - junit - ${junit-version} - test - - - jakarta.servlet - jakarta.servlet-api - ${servlet-api-version} - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - - org.springframework.data - spring-data-commons - 2.0.11.RELEASE - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - - - - 1.8 - ${java.version} - ${java.version} - 1.3.5 - 2.3.3 - 9.2.15.v20160210 - 1.7.21 - 4.13.1 - 4.0.4 - 2.9.2 - 2.9.9 - 2.8.4 - 2.0.2 - 4.3.20.RELEASE - 0.2.2 - 2.9.8 - 1.6.3 - - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index e3fcb154af3b..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "another-fake", description = "the another-fake API") -public interface AnotherFakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "$another-fake?" }, - value = "To test special tags", - nickname = "call123testSpecialTags", - notes = "To test special tags and operation ID starting with number", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default CompletableFuture> call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index 81dcb1da85e4..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final NativeWebRequest request; - - @Autowired - public AnotherFakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiException.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiException.java deleted file mode 100644 index fdbaeee3a29e..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiException.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.openapitools.api; - - -public class ApiException extends Exception{ - private int code; - public ApiException (int code, String msg) { - super(msg); - this.code = code; - } -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiOriginFilter.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiOriginFilter.java deleted file mode 100644 index 32424c32c4cc..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiOriginFilter.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import java.io.IOException; - -import javax.servlet.*; -import javax.servlet.http.HttpServletResponse; - - -public class ApiOriginFilter implements javax.servlet.Filter { - @Override - public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException, ServletException { - HttpServletResponse res = (HttpServletResponse) response; - res.addHeader("Access-Control-Allow-Origin", "*"); - res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); - res.addHeader("Access-Control-Allow-Headers", "Content-Type"); - chain.doFilter(request, response); - } - - @Override - public void destroy() { - } - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - } -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiResponseMessage.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiResponseMessage.java deleted file mode 100644 index c85c5b51afdf..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiResponseMessage.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.api; - -import javax.xml.bind.annotation.XmlTransient; - - -@javax.xml.bind.annotation.XmlRootElement -public class ApiResponseMessage { - public static final int ERROR = 1; - public static final int WARNING = 2; - public static final int INFO = 3; - public static final int OK = 4; - public static final int TOO_BUSY = 5; - - int code; - String type; - String message; - - public ApiResponseMessage(){} - - public ApiResponseMessage(int code, String message){ - this.code = code; - switch(code){ - case ERROR: - setType("error"); - break; - case WARNING: - setType("warning"); - break; - case INFO: - setType("info"); - break; - case OK: - setType("ok"); - break; - case TOO_BUSY: - setType("too busy"); - break; - default: - setType("unknown"); - break; - } - this.message = message; - } - - @XmlTransient - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0ccf..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index 792e526a2bcf..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,593 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake", description = "the fake API") -public interface FakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "creates an XmlItem", - nickname = "createXmlItem", - notes = "this route creates an XmlItem" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/create_xml_item", - consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } - ) - default CompletableFuture> createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterBooleanSerialize", - notes = "Test serialization of outer boolean types", - response = Boolean.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default CompletableFuture> fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterCompositeSerialize", - notes = "Test serialization of object with outer number type", - response = OuterComposite.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default CompletableFuture> fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterNumberSerialize", - notes = "Test serialization of outer number types", - response = BigDecimal.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default CompletableFuture> fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterStringSerialize", - notes = "Test serialization of outer string types", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default CompletableFuture> fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithFileSchema", - notes = "For this test, the body for this request much reference a schema named `File`." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default CompletableFuture> testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithQueryParams", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default CompletableFuture> testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test \"client\" model", - nickname = "testClientModel", - notes = "To test \"client\" model", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default CompletableFuture> testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - nickname = "testEndpointParameters", - notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - authorizations = { - @Authorization(value = "http_basic_test") - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default CompletableFuture> testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test enum parameters", - nickname = "testEnumParameters", - notes = "To test enum parameters" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default CompletableFuture> testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint to test group parameters (optional)", - nickname = "testGroupParameters", - notes = "Fake endpoint to test group parameters (optional)" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Someting wrong") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default CompletableFuture> testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test inline additionalProperties", - nickname = "testInlineAdditionalProperties", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default CompletableFuture> testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test json serialization of form data", - nickname = "testJsonFormData", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default CompletableFuture> testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testQueryParameterCollectionFormat", - notes = "To test the collection format in query parameters" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default CompletableFuture> testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image (required)", - nickname = "uploadFileWithRequiredFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default CompletableFuture> uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index b81393d39d3b..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeApiController implements FakeApi { - - private final NativeWebRequest request; - - @Autowired - public FakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index 7510bd1d4794..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") -public interface FakeClassnameTestApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake_classname_tags 123#$%^" }, - value = "To test class name in snake case", - nickname = "testClassname", - notes = "To test class name in snake case", - response = Client.class, - authorizations = { - @Authorization(value = "api_key_query") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default CompletableFuture> testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 3f4a45e1f9fa..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final NativeWebRequest request; - - @Autowired - public FakeClassnameTestApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/NotFoundException.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/NotFoundException.java deleted file mode 100644 index 526df6c1c197..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/NotFoundException.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.openapitools.api; - - -public class NotFoundException extends ApiException { - private int code; - public NotFoundException (int code, String msg) { - super(code, msg); - this.code = code; - } -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index ed40dbe01413..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,402 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "pet", description = "the pet API") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default CompletableFuture> addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default CompletableFuture> deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default CompletableFuture>> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet.class, - responseContainer = "Set", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), - @ApiResponse(code = 400, message = "Invalid tag value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default CompletableFuture>> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @ApiOperation( - tags = { "pet" }, - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet.class, - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default CompletableFuture> getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default CompletableFuture> updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default CompletableFuture> updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default CompletableFuture> uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index ec47c8498512..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,195 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "store", description = "the store API") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default CompletableFuture> deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "store" }, - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Integer.class, - responseContainer = "Map", - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default CompletableFuture>> getInventory( - - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default CompletableFuture> getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @ApiOperation( - tags = { "store" }, - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default CompletableFuture> placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index a1f02f844bf3..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class StoreApiController implements StoreApi { - - private final NativeWebRequest request; - - @Autowired - public StoreApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index aca32843e370..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,288 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "user", description = "the user API") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default CompletableFuture> createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default CompletableFuture> createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default CompletableFuture> createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default CompletableFuture> deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default CompletableFuture> getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default CompletableFuture> loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default CompletableFuture> logoutUser( - - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default CompletableFuture> updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index 8efc6418c2e8..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class UserApiController implements UserApi { - - private final NativeWebRequest request; - - @Autowired - public UserApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 25727830541b..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 3df5ef9f3c34..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("OpenAPI Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java deleted file mode 100644 index 682e77202d1e..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Bean; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.data.web.PageableHandlerMethodArgumentResolver; - -import java.util.List; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) -@EnableWebMvc -@PropertySource("classpath:application.properties") -@Import(OpenAPIDocumentationConfig.class) -public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter { - private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; - - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "classpath:/META-INF/resources/", "classpath:/resources/", - "classpath:/static/", "classpath:/public/" }; - - private static final String[] RESOURCE_LOCATIONS; - static { - RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length - + SERVLET_RESOURCE_LOCATIONS.length]; - System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0, - SERVLET_RESOURCE_LOCATIONS.length); - System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, - SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length); - } - - private static final String[] STATIC_INDEX_HTML_RESOURCES; - static { - STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length]; - for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) { - STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html"; - } - } - - @Override - public void addArgumentResolvers(List argumentResolvers) { - argumentResolvers.add(new PageableHandlerMethodArgumentResolver()); - super.addArgumentResolvers(argumentResolvers); - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - if (!registry.hasMappingForPattern("/webjars/**")) { - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); - } - } - - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Bean - public Jackson2ObjectMapperBuilder builder() { - return new Jackson2ObjectMapperBuilder() - .indentOutput(true) - .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .modulesToInstall(new JsonNullableModule()) - - .dateFormat(new RFC3339DateFormat()); - } - - @Override - public void configureMessageConverters(List> converters) { - converters.add(new MappingJackson2HttpMessageConverter(objectMapper())); - converters.add(new StringHttpMessageConverter()); - super.configureMessageConverters(converters); - } - - @Bean - public ObjectMapper objectMapper(){ - return builder().build(); - } -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java deleted file mode 100644 index 697c27391a5c..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java deleted file mode 100644 index 4a567429c250..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - - -@Configuration -@EnableSwagger2 -public class SwaggerDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("Swagger Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "apiteam@swagger.io")) - .build(); - } - - @Bean - public Docket customImplementation(){ - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java deleted file mode 100644 index 4518796ac56f..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Bean; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import java.util.List; - - -@Configuration -@ComponentScan(basePackages = "org.openapitools.api") -@EnableWebMvc -@PropertySource("classpath:swagger.properties") -@Import(SwaggerDocumentationConfig.class) -public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter { - private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; - - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "classpath:/META-INF/resources/", "classpath:/resources/", - "classpath:/static/", "classpath:/public/" }; - - private static final String[] RESOURCE_LOCATIONS; - static { - RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length - + SERVLET_RESOURCE_LOCATIONS.length]; - System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0, - SERVLET_RESOURCE_LOCATIONS.length); - System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, - SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length); - } - - private static final String[] STATIC_INDEX_HTML_RESOURCES; - static { - STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length]; - for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) { - STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html"; - } - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - if (!registry.hasMappingForPattern("/webjars/**")) { - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); - } - } - - @Bean - public Jackson2ObjectMapperBuilder builder() { - Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder() - .indentOutput(true) - .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .dateFormat(new RFC3339DateFormat()); - return builder; - } - - @Override - public void configureMessageConverters(List> converters) { - converters.add(new MappingJackson2HttpMessageConverter(objectMapper())); - super.configureMessageConverters(converters); - } - - @Bean - public ObjectMapper objectMapper(){ - return builder().build(); - } -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java deleted file mode 100644 index 8e9d7af82449..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { - - @Override - protected Class[] getRootConfigClasses() { - return new Class[] { OpenAPIUiConfiguration.class }; - } - - @Override - protected Class[] getServletConfigClasses() { - return new Class[] { WebMvcConfiguration.class }; - } - - @Override - protected String[] getServletMappings() { - return new String[] { "/" }; - } -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java deleted file mode 100644 index 691a5378ca49..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebMvcConfiguration extends WebMvcConfigurationSupport { - @Override - public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } -} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index ea719cc4ad89..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index a4ec39252ebe..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index 47db34f7b504..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index 5851aa2c2498..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,400 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - private Map> mapMapAnytype = null; - - @JsonProperty("anytype_1") - private Object anytype1; - - @JsonProperty("anytype_2") - private Object anytype2; - - @JsonProperty("anytype_3") - private Object anytype3; - - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @ApiModelProperty(value = "") - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @ApiModelProperty(value = "") - public Map getMapNumber() { - return mapNumber; - } - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - /** - * Get mapInteger - * @return mapInteger - */ - - @ApiModelProperty(value = "") - public Map getMapInteger() { - return mapInteger; - } - - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - /** - * Get mapBoolean - * @return mapBoolean - */ - - @ApiModelProperty(value = "") - public Map getMapBoolean() { - return mapBoolean; - } - - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - /** - * Get mapArrayInteger - * @return mapArrayInteger - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - /** - * Get mapArrayAnytype - * @return mapArrayAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - /** - * Get mapMapString - * @return mapMapString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapString() { - return mapMapString; - } - - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - /** - * Get mapMapAnytype - * @return mapMapAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - */ - - @ApiModelProperty(value = "") - public Object getAnytype1() { - return anytype1; - } - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - */ - - @ApiModelProperty(value = "") - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @ApiModelProperty(value = "") - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index bba3dce1a55e..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index 5f48487e05d6..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index 40ca1af6ab4f..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index ddc76e27b19f..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index fcd78770a43d..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), -}) -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @ApiModelProperty(value = "") - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac0..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 3859dcfdcc05..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index a90ce117c238..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index e8f37b16d5cb..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,162 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @ApiModelProperty(value = "") - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index 68a00f5edd47..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCatAllOf; -import org.openapitools.model.Cat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @ApiModelProperty(value = "") - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index 23fd197e0faa..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @ApiModelProperty(value = "") - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index 37c928a79482..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,204 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @ApiModelProperty(value = "") - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @ApiModelProperty(value = "") - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @ApiModelProperty(value = "") - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @ApiModelProperty(value = "") - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @ApiModelProperty(value = "") - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @ApiModelProperty(value = "Name of the pet ") - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index 9fb7bfef1800..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.CatAllOf; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index 7f699ced5842..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 8adf35c2fa00..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index 72e9288b53af..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@ApiModel(description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index 9891fe7dafce..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @ApiModelProperty(value = "") - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 3ee8ac596893..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.DogAllOf; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index c081b7517a47..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index b85ad3e155ec..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,190 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @ApiModelProperty(value = "") - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @ApiModelProperty(value = "") - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index c2abaaed4305..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index ba5b8c323a9a..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,328 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.OuterEnum; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @ApiModelProperty(value = "") - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @ApiModelProperty(value = "") - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @ApiModelProperty(value = "") - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index 685394664974..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@ApiModel(description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @ApiModelProperty(value = "Test capitalization") - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 01149ce8f6ae..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @ApiModelProperty(value = "") - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @ApiModelProperty(value = "") - public List getFiles() { - return files; - } - - public void setFiles(List files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index 153641cacd56..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,416 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @ApiModelProperty(value = "") - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @ApiModelProperty(value = "") - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @ApiModelProperty(value = "") - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @ApiModelProperty(value = "") - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @ApiModelProperty(value = "") - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @ApiModelProperty(value = "") - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @ApiModelProperty(value = "") - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @ApiModelProperty(required = true, value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index d235c68a51ff..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index 27e3cea8e6ed..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,231 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @ApiModelProperty(value = "") - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @ApiModelProperty(value = "") - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap<>(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - */ - - @ApiModelProperty(value = "") - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index e490e2a61ef7..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @ApiModelProperty(value = "") - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 56b222f4e45b..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@ApiModel(description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be1..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index 7800a7d698f7..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @ApiModelProperty(value = "") - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index a933badc4910..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@ApiModel(description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @ApiModelProperty(value = "") - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index febe2115a665..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,157 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@ApiModel(description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @ApiModelProperty(value = "") - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index dcf5c5e801a6..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index eca5e7cd4fa5..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @ApiModelProperty(value = "") - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @ApiModelProperty(value = "") - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 1f09d0a5d17a..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index 9f17ad305dae..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,265 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Pet - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private Set photoUrls = new LinkedHashSet<>(); - - @JsonProperty("tags") - @Valid - private List tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @ApiModelProperty(value = "") - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @ApiModelProperty(value = "") - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @ApiModelProperty(value = "pet status in the store") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index e2ddfcdfcb17..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @ApiModelProperty(value = "") - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index cbc94826b926..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @ApiModelProperty(value = "") - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e223..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index 03b4ffcdadca..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 01e5d5f3fccd..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderDefault { - - @JsonProperty("string_item") - private String stringItem = "what"; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem = true; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index e907ad9c28e7..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,213 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderExample { - - @JsonProperty("string_item") - private String stringItem; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("float_item") - private Float floatItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(example = "what", required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - */ - @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") - public Float getFloatItem() { - return floatItem; - } - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(example = "true", required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index cff62427bf1a..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,252 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @ApiModelProperty(value = "") - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @ApiModelProperty(value = "") - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @ApiModelProperty(value = "") - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @ApiModelProperty(value = "") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @ApiModelProperty(value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @ApiModelProperty(value = "") - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 930edebcef74..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,840 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class XmlItem { - - @JsonProperty("attribute_string") - private String attributeString; - - @JsonProperty("attribute_number") - private BigDecimal attributeNumber; - - @JsonProperty("attribute_integer") - private Integer attributeInteger; - - @JsonProperty("attribute_boolean") - private Boolean attributeBoolean; - - @JsonProperty("wrapped_array") - @Valid - private List wrappedArray = null; - - @JsonProperty("name_string") - private String nameString; - - @JsonProperty("name_number") - private BigDecimal nameNumber; - - @JsonProperty("name_integer") - private Integer nameInteger; - - @JsonProperty("name_boolean") - private Boolean nameBoolean; - - @JsonProperty("name_array") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - private List nameWrappedArray = null; - - @JsonProperty("prefix_string") - private String prefixString; - - @JsonProperty("prefix_number") - private BigDecimal prefixNumber; - - @JsonProperty("prefix_integer") - private Integer prefixInteger; - - @JsonProperty("prefix_boolean") - private Boolean prefixBoolean; - - @JsonProperty("prefix_array") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - private List prefixWrappedArray = null; - - @JsonProperty("namespace_string") - private String namespaceString; - - @JsonProperty("namespace_number") - private BigDecimal namespaceNumber; - - @JsonProperty("namespace_integer") - private Integer namespaceInteger; - - @JsonProperty("namespace_boolean") - private Boolean namespaceBoolean; - - @JsonProperty("namespace_array") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - private List namespaceWrappedArray = null; - - @JsonProperty("prefix_ns_string") - private String prefixNsString; - - @JsonProperty("prefix_ns_number") - private BigDecimal prefixNsNumber; - - @JsonProperty("prefix_ns_integer") - private Integer prefixNsInteger; - - @JsonProperty("prefix_ns_boolean") - private Boolean prefixNsBoolean; - - @JsonProperty("prefix_ns_array") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @ApiModelProperty(example = "string", value = "") - public String getAttributeString() { - return attributeString; - } - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getAttributeInteger() { - return attributeInteger; - } - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @ApiModelProperty(value = "") - public List getWrappedArray() { - return wrappedArray; - } - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNameString() { - return nameString; - } - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNameNumber() { - return nameNumber; - } - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNameInteger() { - return nameInteger; - } - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNameBoolean() { - return nameBoolean; - } - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @ApiModelProperty(value = "") - public List getNameArray() { - return nameArray; - } - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNameWrappedArray() { - return nameWrappedArray; - } - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixString() { - return prefixString; - } - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixInteger() { - return prefixInteger; - } - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @ApiModelProperty(value = "") - public List getPrefixArray() { - return prefixArray; - } - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNamespaceString() { - return namespaceString; - } - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceArray() { - return namespaceArray; - } - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixNsString() { - return prefixNsString; - } - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsArray() { - return prefixNsArray; - } - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/application.properties b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/application.properties deleted file mode 100644 index 99ebf4d7c55e..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.properties b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.properties deleted file mode 100644 index 8d3a7a8292be..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.properties +++ /dev/null @@ -1,2 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs -#server.port=8090 diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml deleted file mode 100644 index d02806b2d38c..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml +++ /dev/null @@ -1,2264 +0,0 @@ -openapi: 3.0.1 -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:\ - \ \" \\" - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- url: http://petstore.swagger.io:80/v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /pet: - post: - operationId: addPet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - put: - operationId: updatePet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - "405": - content: {} - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - content: {} - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByTags: - get: - deprecated: true - description: "Multiple tags can be provided with comma separated strings. Use\ - \ tag1, tag2, tag3 for testing." - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - uniqueItems: true - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - description: successful operation - "400": - content: {} - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - responses: - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - "200": - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: store - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Find purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - format: int32 - type: integer - X-Expires-After: - description: date in UTC when token expires - schema: - format: date-time - type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Get user by user name - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - content: {} - description: Invalid user supplied - "404": - content: {} - description: User not found - summary: Updated user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - post: - description: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-contentType: application/xml - x-accepts: application/json - x-tags: - - tag: fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: $another-fake? - /fake/body-with-file-schema: - put: - description: "For this test, the body for this request much reference a schema\ - \ named `File`." - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: {} - description: Success - tags: - - fake - x-accepts: application/json - x-tags: - - tag: fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet -components: - schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - uniqueItems: true - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: "/[a-z]/i" - type: string - byte: - format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - BigDecimal: - format: number - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - 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 - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - type: object - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/swagger.properties b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/swagger.properties deleted file mode 100644 index 8d3a7a8292be..000000000000 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/swagger.properties +++ /dev/null @@ -1,2 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs -#server.port=8090 diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator-ignore b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.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/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES deleted file mode 100644 index 97eae4aa8c7a..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES +++ /dev/null @@ -1,70 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java -src/main/java/org/openapitools/configuration/RFC3339DateFormat.java -src/main/java/org/openapitools/configuration/WebApplication.java -src/main/java/org/openapitools/configuration/WebMvcConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION deleted file mode 100644 index 5f68295fc196..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/README.md b/samples/server/petstore/spring-mvc-j8-localdatetime/README.md deleted file mode 100644 index 4d5e52bd8f88..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# OpenAPI generated server - -Spring MVC Server - - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the Spring MVC framework. - -The underlying library integrating OpenAPI to Spring-MVC is [springfox](https://github.com/springfox/springfox) - -You can view the server in swagger-ui by pointing to -http://localhost:8002/v2/ \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml deleted file mode 100644 index 9e48eee987ed..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml +++ /dev/null @@ -1,178 +0,0 @@ - - 4.0.0 - org.openapitools - spring-mvc-j8-localdatetime - jar - spring-mvc-j8-localdatetime - 1.0.0 - - src/main/java - - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty-version} - - - /v2 - - target/${project.artifactId}-${project.version} - 8079 - stopit - 10 - - 8002 - 60000 - - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - - - - - start-jetty - pre-integration-test - - start - - - 0 - true - - - - stop-jetty - post-integration-test - - stop - - - - - - - - - org.slf4j - slf4j-log4j12 - ${slf4j-version} - - - - - org.springframework - spring-core - ${spring-version} - - - org.springframework - spring-webmvc - ${spring-version} - - - org.springframework - spring-web - ${spring-version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - - - jakarta.xml.bind - jakarta.xml.bind-api - ${jakarta.xml.bind-version} - - - - io.springfox - springfox-swagger2 - ${springfox-version} - - - com.fasterxml.jackson.core - jackson-annotations - - - - - io.springfox - springfox-swagger-ui - ${springfox-version} - - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - - junit - junit - ${junit-version} - test - - - jakarta.servlet - jakarta.servlet-api - ${servlet-api-version} - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - - org.springframework.data - spring-data-commons - 2.0.11.RELEASE - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - - - - 1.8 - ${java.version} - ${java.version} - 1.3.5 - 2.3.3 - 9.2.15.v20160210 - 1.7.21 - 4.13.1 - 4.0.4 - 2.9.2 - 2.9.9 - 2.8.4 - 2.0.2 - 4.3.20.RELEASE - 0.2.2 - 2.9.8 - 1.6.3 - - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index bbbc5c96bf77..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "another-fake", description = "the another-fake API") -public interface AnotherFakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "$another-fake?" }, - value = "To test special tags", - nickname = "call123testSpecialTags", - notes = "To test special tags and operation ID starting with number", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index 81dcb1da85e4..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final NativeWebRequest request; - - @Autowired - public AnotherFakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiException.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiException.java deleted file mode 100644 index fdbaeee3a29e..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiException.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.openapitools.api; - - -public class ApiException extends Exception{ - private int code; - public ApiException (int code, String msg) { - super(msg); - this.code = code; - } -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiOriginFilter.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiOriginFilter.java deleted file mode 100644 index 32424c32c4cc..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiOriginFilter.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import java.io.IOException; - -import javax.servlet.*; -import javax.servlet.http.HttpServletResponse; - - -public class ApiOriginFilter implements javax.servlet.Filter { - @Override - public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException, ServletException { - HttpServletResponse res = (HttpServletResponse) response; - res.addHeader("Access-Control-Allow-Origin", "*"); - res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); - res.addHeader("Access-Control-Allow-Headers", "Content-Type"); - chain.doFilter(request, response); - } - - @Override - public void destroy() { - } - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - } -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiResponseMessage.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiResponseMessage.java deleted file mode 100644 index c85c5b51afdf..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiResponseMessage.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.api; - -import javax.xml.bind.annotation.XmlTransient; - - -@javax.xml.bind.annotation.XmlRootElement -public class ApiResponseMessage { - public static final int ERROR = 1; - public static final int WARNING = 2; - public static final int INFO = 3; - public static final int OK = 4; - public static final int TOO_BUSY = 5; - - int code; - String type; - String message; - - public ApiResponseMessage(){} - - public ApiResponseMessage(int code, String message){ - this.code = code; - switch(code){ - case ERROR: - setType("error"); - break; - case WARNING: - setType("warning"); - break; - case INFO: - setType("info"); - break; - case OK: - setType("ok"); - break; - case TOO_BUSY: - setType("too busy"); - break; - default: - setType("unknown"); - break; - } - this.message = message; - } - - @XmlTransient - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0ccf..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index 32e0a657f508..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,586 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake", description = "the fake API") -public interface FakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "creates an XmlItem", - nickname = "createXmlItem", - notes = "this route creates an XmlItem" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/create_xml_item", - consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } - ) - default ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterBooleanSerialize", - notes = "Test serialization of outer boolean types", - response = Boolean.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterCompositeSerialize", - notes = "Test serialization of object with outer number type", - response = OuterComposite.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterNumberSerialize", - notes = "Test serialization of outer number types", - response = BigDecimal.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterStringSerialize", - notes = "Test serialization of outer string types", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithFileSchema", - notes = "For this test, the body for this request much reference a schema named `File`." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithQueryParams", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test \"client\" model", - nickname = "testClientModel", - notes = "To test \"client\" model", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - nickname = "testEndpointParameters", - notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - authorizations = { - @Authorization(value = "http_basic_test") - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test enum parameters", - nickname = "testEnumParameters", - notes = "To test enum parameters" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint to test group parameters (optional)", - nickname = "testGroupParameters", - notes = "Fake endpoint to test group parameters (optional)" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Someting wrong") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test inline additionalProperties", - nickname = "testInlineAdditionalProperties", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test json serialization of form data", - nickname = "testJsonFormData", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testQueryParameterCollectionFormat", - notes = "To test the collection format in query parameters" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image (required)", - nickname = "uploadFileWithRequiredFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index b81393d39d3b..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeApiController implements FakeApi { - - private final NativeWebRequest request; - - @Autowired - public FakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index 17ce875daaac..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") -public interface FakeClassnameTestApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake_classname_tags 123#$%^" }, - value = "To test class name in snake case", - nickname = "testClassname", - notes = "To test class name in snake case", - response = Client.class, - authorizations = { - @Authorization(value = "api_key_query") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 3f4a45e1f9fa..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final NativeWebRequest request; - - @Autowired - public FakeClassnameTestApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/NotFoundException.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/NotFoundException.java deleted file mode 100644 index 526df6c1c197..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/NotFoundException.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.openapitools.api; - - -public class NotFoundException extends ApiException { - private int code; - public NotFoundException (int code, String msg) { - super(code, msg); - this.code = code; - } -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index 864173ded4fc..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "pet", description = "the pet API") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet.class, - responseContainer = "Set", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), - @ApiResponse(code = 400, message = "Invalid tag value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @ApiOperation( - tags = { "pet" }, - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet.class, - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index 57cbf21bde71..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class PetApiController implements PetApi { - - private final NativeWebRequest request; - - @Autowired - public PetApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index ea62d39c13db..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,285 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.LocalDateTime; -import org.openapitools.model.User; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "user", description = "the user API") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 25727830541b..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 3df5ef9f3c34..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("OpenAPI Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java deleted file mode 100644 index 682e77202d1e..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Bean; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.data.web.PageableHandlerMethodArgumentResolver; - -import java.util.List; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) -@EnableWebMvc -@PropertySource("classpath:application.properties") -@Import(OpenAPIDocumentationConfig.class) -public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter { - private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; - - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "classpath:/META-INF/resources/", "classpath:/resources/", - "classpath:/static/", "classpath:/public/" }; - - private static final String[] RESOURCE_LOCATIONS; - static { - RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length - + SERVLET_RESOURCE_LOCATIONS.length]; - System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0, - SERVLET_RESOURCE_LOCATIONS.length); - System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, - SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length); - } - - private static final String[] STATIC_INDEX_HTML_RESOURCES; - static { - STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length]; - for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) { - STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html"; - } - } - - @Override - public void addArgumentResolvers(List argumentResolvers) { - argumentResolvers.add(new PageableHandlerMethodArgumentResolver()); - super.addArgumentResolvers(argumentResolvers); - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - if (!registry.hasMappingForPattern("/webjars/**")) { - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); - } - } - - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Bean - public Jackson2ObjectMapperBuilder builder() { - return new Jackson2ObjectMapperBuilder() - .indentOutput(true) - .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .modulesToInstall(new JsonNullableModule()) - - .dateFormat(new RFC3339DateFormat()); - } - - @Override - public void configureMessageConverters(List> converters) { - converters.add(new MappingJackson2HttpMessageConverter(objectMapper())); - converters.add(new StringHttpMessageConverter()); - super.configureMessageConverters(converters); - } - - @Bean - public ObjectMapper objectMapper(){ - return builder().build(); - } -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java deleted file mode 100644 index 697c27391a5c..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java deleted file mode 100644 index 4a567429c250..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - - -@Configuration -@EnableSwagger2 -public class SwaggerDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("Swagger Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "apiteam@swagger.io")) - .build(); - } - - @Bean - public Docket customImplementation(){ - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java deleted file mode 100644 index 4518796ac56f..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Bean; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import java.util.List; - - -@Configuration -@ComponentScan(basePackages = "org.openapitools.api") -@EnableWebMvc -@PropertySource("classpath:swagger.properties") -@Import(SwaggerDocumentationConfig.class) -public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter { - private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; - - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "classpath:/META-INF/resources/", "classpath:/resources/", - "classpath:/static/", "classpath:/public/" }; - - private static final String[] RESOURCE_LOCATIONS; - static { - RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length - + SERVLET_RESOURCE_LOCATIONS.length]; - System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0, - SERVLET_RESOURCE_LOCATIONS.length); - System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, - SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length); - } - - private static final String[] STATIC_INDEX_HTML_RESOURCES; - static { - STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length]; - for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) { - STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html"; - } - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - if (!registry.hasMappingForPattern("/webjars/**")) { - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); - } - } - - @Bean - public Jackson2ObjectMapperBuilder builder() { - Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder() - .indentOutput(true) - .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .dateFormat(new RFC3339DateFormat()); - return builder; - } - - @Override - public void configureMessageConverters(List> converters) { - converters.add(new MappingJackson2HttpMessageConverter(objectMapper())); - super.configureMessageConverters(converters); - } - - @Bean - public ObjectMapper objectMapper(){ - return builder().build(); - } -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebApplication.java deleted file mode 100644 index 8e9d7af82449..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebApplication.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { - - @Override - protected Class[] getRootConfigClasses() { - return new Class[] { OpenAPIUiConfiguration.class }; - } - - @Override - protected Class[] getServletConfigClasses() { - return new Class[] { WebMvcConfiguration.class }; - } - - @Override - protected String[] getServletMappings() { - return new String[] { "/" }; - } -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java deleted file mode 100644 index 691a5378ca49..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebMvcConfiguration extends WebMvcConfigurationSupport { - @Override - public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } -} diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index ea719cc4ad89..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index a4ec39252ebe..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index 47db34f7b504..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index 5851aa2c2498..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,400 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - private Map> mapMapAnytype = null; - - @JsonProperty("anytype_1") - private Object anytype1; - - @JsonProperty("anytype_2") - private Object anytype2; - - @JsonProperty("anytype_3") - private Object anytype3; - - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @ApiModelProperty(value = "") - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @ApiModelProperty(value = "") - public Map getMapNumber() { - return mapNumber; - } - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - /** - * Get mapInteger - * @return mapInteger - */ - - @ApiModelProperty(value = "") - public Map getMapInteger() { - return mapInteger; - } - - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - /** - * Get mapBoolean - * @return mapBoolean - */ - - @ApiModelProperty(value = "") - public Map getMapBoolean() { - return mapBoolean; - } - - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - /** - * Get mapArrayInteger - * @return mapArrayInteger - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - /** - * Get mapArrayAnytype - * @return mapArrayAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - /** - * Get mapMapString - * @return mapMapString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapString() { - return mapMapString; - } - - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - /** - * Get mapMapAnytype - * @return mapMapAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - */ - - @ApiModelProperty(value = "") - public Object getAnytype1() { - return anytype1; - } - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - */ - - @ApiModelProperty(value = "") - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @ApiModelProperty(value = "") - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index bba3dce1a55e..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index 5f48487e05d6..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index 40ca1af6ab4f..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index ddc76e27b19f..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index fcd78770a43d..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), -}) -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @ApiModelProperty(value = "") - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac0..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 3859dcfdcc05..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index a90ce117c238..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index e8f37b16d5cb..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,162 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @ApiModelProperty(value = "") - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index 68a00f5edd47..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCatAllOf; -import org.openapitools.model.Cat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @ApiModelProperty(value = "") - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index 23fd197e0faa..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @ApiModelProperty(value = "") - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index 37c928a79482..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,204 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @ApiModelProperty(value = "") - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @ApiModelProperty(value = "") - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @ApiModelProperty(value = "") - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @ApiModelProperty(value = "") - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @ApiModelProperty(value = "") - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @ApiModelProperty(value = "Name of the pet ") - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index 9fb7bfef1800..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.CatAllOf; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index 7f699ced5842..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index 72e9288b53af..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@ApiModel(description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index 9891fe7dafce..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @ApiModelProperty(value = "") - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 3ee8ac596893..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.DogAllOf; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index c081b7517a47..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index b85ad3e155ec..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,190 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @ApiModelProperty(value = "") - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @ApiModelProperty(value = "") - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index c2abaaed4305..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index ba5b8c323a9a..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,328 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.OuterEnum; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @ApiModelProperty(value = "") - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @ApiModelProperty(value = "") - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @ApiModelProperty(value = "") - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index 685394664974..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@ApiModel(description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @ApiModelProperty(value = "Test capitalization") - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 01149ce8f6ae..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @ApiModelProperty(value = "") - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @ApiModelProperty(value = "") - public List getFiles() { - return files; - } - - public void setFiles(List files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index 559b55340b91..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,416 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private LocalDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @ApiModelProperty(value = "") - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @ApiModelProperty(value = "") - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @ApiModelProperty(value = "") - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @ApiModelProperty(value = "") - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @ApiModelProperty(value = "") - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @ApiModelProperty(value = "") - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @ApiModelProperty(value = "") - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public LocalDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @ApiModelProperty(required = true, value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index d235c68a51ff..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index 27e3cea8e6ed..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,231 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @ApiModelProperty(value = "") - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @ApiModelProperty(value = "") - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap<>(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - */ - - @ApiModelProperty(value = "") - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index d36d85b62d81..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private LocalDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public LocalDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @ApiModelProperty(value = "") - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 56b222f4e45b..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@ApiModel(description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 131e671e9160..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,134 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @ApiModelProperty(value = "") - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @ApiModelProperty(value = "") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @ApiModelProperty(value = "") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be1..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index 7800a7d698f7..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @ApiModelProperty(value = "") - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index a933badc4910..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@ApiModel(description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @ApiModelProperty(value = "") - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index febe2115a665..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,157 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@ApiModel(description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @ApiModelProperty(value = "") - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index dcf5c5e801a6..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 2a6c352f08b1..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,245 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.LocalDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private LocalDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @ApiModelProperty(value = "") - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @ApiModelProperty(value = "") - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(LocalDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @ApiModelProperty(value = "") - public LocalDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(LocalDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @ApiModelProperty(value = "Order Status") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @ApiModelProperty(value = "") - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index eca5e7cd4fa5..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @ApiModelProperty(value = "") - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @ApiModelProperty(value = "") - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 1f09d0a5d17a..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index 9f17ad305dae..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,265 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Pet - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private Set photoUrls = new LinkedHashSet<>(); - - @JsonProperty("tags") - @Valid - private List tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @ApiModelProperty(value = "") - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @ApiModelProperty(value = "") - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @ApiModelProperty(value = "pet status in the store") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index e2ddfcdfcb17..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @ApiModelProperty(value = "") - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index cbc94826b926..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @ApiModelProperty(value = "") - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e223..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 01e5d5f3fccd..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderDefault { - - @JsonProperty("string_item") - private String stringItem = "what"; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem = true; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index e907ad9c28e7..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,213 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderExample { - - @JsonProperty("string_item") - private String stringItem; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("float_item") - private Float floatItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(example = "what", required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - */ - @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") - public Float getFloatItem() { - return floatItem; - } - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(example = "true", required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 930edebcef74..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,840 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class XmlItem { - - @JsonProperty("attribute_string") - private String attributeString; - - @JsonProperty("attribute_number") - private BigDecimal attributeNumber; - - @JsonProperty("attribute_integer") - private Integer attributeInteger; - - @JsonProperty("attribute_boolean") - private Boolean attributeBoolean; - - @JsonProperty("wrapped_array") - @Valid - private List wrappedArray = null; - - @JsonProperty("name_string") - private String nameString; - - @JsonProperty("name_number") - private BigDecimal nameNumber; - - @JsonProperty("name_integer") - private Integer nameInteger; - - @JsonProperty("name_boolean") - private Boolean nameBoolean; - - @JsonProperty("name_array") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - private List nameWrappedArray = null; - - @JsonProperty("prefix_string") - private String prefixString; - - @JsonProperty("prefix_number") - private BigDecimal prefixNumber; - - @JsonProperty("prefix_integer") - private Integer prefixInteger; - - @JsonProperty("prefix_boolean") - private Boolean prefixBoolean; - - @JsonProperty("prefix_array") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - private List prefixWrappedArray = null; - - @JsonProperty("namespace_string") - private String namespaceString; - - @JsonProperty("namespace_number") - private BigDecimal namespaceNumber; - - @JsonProperty("namespace_integer") - private Integer namespaceInteger; - - @JsonProperty("namespace_boolean") - private Boolean namespaceBoolean; - - @JsonProperty("namespace_array") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - private List namespaceWrappedArray = null; - - @JsonProperty("prefix_ns_string") - private String prefixNsString; - - @JsonProperty("prefix_ns_number") - private BigDecimal prefixNsNumber; - - @JsonProperty("prefix_ns_integer") - private Integer prefixNsInteger; - - @JsonProperty("prefix_ns_boolean") - private Boolean prefixNsBoolean; - - @JsonProperty("prefix_ns_array") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @ApiModelProperty(example = "string", value = "") - public String getAttributeString() { - return attributeString; - } - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getAttributeInteger() { - return attributeInteger; - } - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @ApiModelProperty(value = "") - public List getWrappedArray() { - return wrappedArray; - } - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNameString() { - return nameString; - } - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNameNumber() { - return nameNumber; - } - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNameInteger() { - return nameInteger; - } - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNameBoolean() { - return nameBoolean; - } - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @ApiModelProperty(value = "") - public List getNameArray() { - return nameArray; - } - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNameWrappedArray() { - return nameWrappedArray; - } - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixString() { - return prefixString; - } - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixInteger() { - return prefixInteger; - } - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @ApiModelProperty(value = "") - public List getPrefixArray() { - return prefixArray; - } - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNamespaceString() { - return namespaceString; - } - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceArray() { - return namespaceArray; - } - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixNsString() { - return prefixNsString; - } - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsArray() { - return prefixNsArray; - } - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/application.properties b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/application.properties deleted file mode 100644 index 99ebf4d7c55e..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.properties b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.properties deleted file mode 100644 index 8d3a7a8292be..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.properties +++ /dev/null @@ -1,2 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs -#server.port=8090 diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml deleted file mode 100644 index d02806b2d38c..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml +++ /dev/null @@ -1,2264 +0,0 @@ -openapi: 3.0.1 -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:\ - \ \" \\" - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- url: http://petstore.swagger.io:80/v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /pet: - post: - operationId: addPet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - put: - operationId: updatePet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - "405": - content: {} - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - content: {} - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByTags: - get: - deprecated: true - description: "Multiple tags can be provided with comma separated strings. Use\ - \ tag1, tag2, tag3 for testing." - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - uniqueItems: true - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - description: successful operation - "400": - content: {} - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - responses: - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - "200": - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: store - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Find purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - format: int32 - type: integer - X-Expires-After: - description: date in UTC when token expires - schema: - format: date-time - type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Get user by user name - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - content: {} - description: Invalid user supplied - "404": - content: {} - description: User not found - summary: Updated user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - post: - description: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-contentType: application/xml - x-accepts: application/json - x-tags: - - tag: fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: $another-fake? - /fake/body-with-file-schema: - put: - description: "For this test, the body for this request much reference a schema\ - \ named `File`." - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: {} - description: Success - tags: - - fake - x-accepts: application/json - x-tags: - - tag: fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet -components: - schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - uniqueItems: true - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: "/[a-z]/i" - type: string - byte: - format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - BigDecimal: - format: number - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - 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 - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - type: object - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/swagger.properties b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/swagger.properties deleted file mode 100644 index 8d3a7a8292be..000000000000 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/swagger.properties +++ /dev/null @@ -1,2 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs -#server.port=8090 diff --git a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator-ignore b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/.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/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES deleted file mode 100644 index 97eae4aa8c7a..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES +++ /dev/null @@ -1,70 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java -src/main/java/org/openapitools/configuration/RFC3339DateFormat.java -src/main/java/org/openapitools/configuration/WebApplication.java -src/main/java/org/openapitools/configuration/WebMvcConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION deleted file mode 100644 index 5f68295fc196..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-no-nullable/README.md b/samples/server/petstore/spring-mvc-no-nullable/README.md deleted file mode 100644 index 4d5e52bd8f88..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# OpenAPI generated server - -Spring MVC Server - - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the Spring MVC framework. - -The underlying library integrating OpenAPI to Spring-MVC is [springfox](https://github.com/springfox/springfox) - -You can view the server in swagger-ui by pointing to -http://localhost:8002/v2/ \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-no-nullable/pom.xml b/samples/server/petstore/spring-mvc-no-nullable/pom.xml deleted file mode 100644 index ef2658adf026..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/pom.xml +++ /dev/null @@ -1,172 +0,0 @@ - - 4.0.0 - org.openapitools - spring-mvc-server-no-nullable - jar - spring-mvc-server-no-nullable - 1.0.0 - - src/main/java - - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty-version} - - - /v2 - - target/${project.artifactId}-${project.version} - 8079 - stopit - 10 - - 8002 - 60000 - - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - - - - - start-jetty - pre-integration-test - - start - - - 0 - true - - - - stop-jetty - post-integration-test - - stop - - - - - - - - - org.slf4j - slf4j-log4j12 - ${slf4j-version} - - - - - org.springframework - spring-core - ${spring-version} - - - org.springframework - spring-webmvc - ${spring-version} - - - org.springframework - spring-web - ${spring-version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - - - jakarta.xml.bind - jakarta.xml.bind-api - ${jakarta.xml.bind-version} - - - - io.springfox - springfox-swagger2 - ${springfox-version} - - - com.fasterxml.jackson.core - jackson-annotations - - - - - io.springfox - springfox-swagger-ui - ${springfox-version} - - - junit - junit - ${junit-version} - test - - - jakarta.servlet - jakarta.servlet-api - ${servlet-api-version} - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - - org.springframework.data - spring-data-commons - 2.0.11.RELEASE - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - - - - 1.8 - ${java.version} - ${java.version} - 1.3.5 - 2.3.3 - 9.2.15.v20160210 - 1.7.21 - 4.13.1 - 4.0.4 - 2.9.2 - 2.9.9 - 2.8.4 - 2.0.2 - 4.3.20.RELEASE - 2.9.8 - 1.6.3 - - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index bbbc5c96bf77..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "another-fake", description = "the another-fake API") -public interface AnotherFakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "$another-fake?" }, - value = "To test special tags", - nickname = "call123testSpecialTags", - notes = "To test special tags and operation ID starting with number", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index 81dcb1da85e4..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final NativeWebRequest request; - - @Autowired - public AnotherFakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0ccf..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index 27ddf876c5ec..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,586 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake", description = "the fake API") -public interface FakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "creates an XmlItem", - nickname = "createXmlItem", - notes = "this route creates an XmlItem" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/create_xml_item", - consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } - ) - default ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterBooleanSerialize", - notes = "Test serialization of outer boolean types", - response = Boolean.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterCompositeSerialize", - notes = "Test serialization of object with outer number type", - response = OuterComposite.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterNumberSerialize", - notes = "Test serialization of outer number types", - response = BigDecimal.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterStringSerialize", - notes = "Test serialization of outer string types", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithFileSchema", - notes = "For this test, the body for this request much reference a schema named `File`." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithQueryParams", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test \"client\" model", - nickname = "testClientModel", - notes = "To test \"client\" model", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - nickname = "testEndpointParameters", - notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - authorizations = { - @Authorization(value = "http_basic_test") - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test enum parameters", - nickname = "testEnumParameters", - notes = "To test enum parameters" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint to test group parameters (optional)", - nickname = "testGroupParameters", - notes = "Fake endpoint to test group parameters (optional)" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Someting wrong") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test inline additionalProperties", - nickname = "testInlineAdditionalProperties", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test json serialization of form data", - nickname = "testJsonFormData", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testQueryParameterCollectionFormat", - notes = "To test the collection format in query parameters" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image (required)", - nickname = "uploadFileWithRequiredFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index b81393d39d3b..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeApiController implements FakeApi { - - private final NativeWebRequest request; - - @Autowired - public FakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index 17ce875daaac..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") -public interface FakeClassnameTestApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake_classname_tags 123#$%^" }, - value = "To test class name in snake case", - nickname = "testClassname", - notes = "To test class name in snake case", - response = Client.class, - authorizations = { - @Authorization(value = "api_key_query") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 3f4a45e1f9fa..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final NativeWebRequest request; - - @Autowired - public FakeClassnameTestApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index 57cbf21bde71..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class PetApiController implements PetApi { - - private final NativeWebRequest request; - - @Autowired - public PetApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 1292cf4edaa2..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "store", description = "the store API") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "store" }, - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Integer.class, - responseContainer = "Map", - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @ApiOperation( - tags = { "store" }, - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index a1f02f844bf3..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class StoreApiController implements StoreApi { - - private final NativeWebRequest request; - - @Autowired - public StoreApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index 8efc6418c2e8..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class UserApiController implements UserApi { - - private final NativeWebRequest request; - - @Autowired - public UserApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 25727830541b..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 3df5ef9f3c34..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("OpenAPI Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java deleted file mode 100644 index 7e3d25bb2752..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Bean; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.data.web.PageableHandlerMethodArgumentResolver; - -import java.util.List; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) -@EnableWebMvc -@PropertySource("classpath:application.properties") -@Import(OpenAPIDocumentationConfig.class) -public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter { - private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; - - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "classpath:/META-INF/resources/", "classpath:/resources/", - "classpath:/static/", "classpath:/public/" }; - - private static final String[] RESOURCE_LOCATIONS; - static { - RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length - + SERVLET_RESOURCE_LOCATIONS.length]; - System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0, - SERVLET_RESOURCE_LOCATIONS.length); - System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, - SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length); - } - - private static final String[] STATIC_INDEX_HTML_RESOURCES; - static { - STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length]; - for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) { - STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html"; - } - } - - @Override - public void addArgumentResolvers(List argumentResolvers) { - argumentResolvers.add(new PageableHandlerMethodArgumentResolver()); - super.addArgumentResolvers(argumentResolvers); - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - if (!registry.hasMappingForPattern("/webjars/**")) { - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); - } - } - - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Bean - public Jackson2ObjectMapperBuilder builder() { - return new Jackson2ObjectMapperBuilder() - .indentOutput(true) - .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - - - .dateFormat(new RFC3339DateFormat()); - } - - @Override - public void configureMessageConverters(List> converters) { - converters.add(new MappingJackson2HttpMessageConverter(objectMapper())); - converters.add(new StringHttpMessageConverter()); - super.configureMessageConverters(converters); - } - - @Bean - public ObjectMapper objectMapper(){ - return builder().build(); - } -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java deleted file mode 100644 index 697c27391a5c..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebApplication.java deleted file mode 100644 index 8e9d7af82449..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebApplication.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { - - @Override - protected Class[] getRootConfigClasses() { - return new Class[] { OpenAPIUiConfiguration.class }; - } - - @Override - protected Class[] getServletConfigClasses() { - return new Class[] { WebMvcConfiguration.class }; - } - - @Override - protected String[] getServletMappings() { - return new String[] { "/" }; - } -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java deleted file mode 100644 index 691a5378ca49..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebMvcConfiguration extends WebMvcConfigurationSupport { - @Override - public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } -} diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index 73241ece58af..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index 8ccdac40b273..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index a191e434268c..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index b319600c9510..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,399 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - private Map> mapMapAnytype = null; - - @JsonProperty("anytype_1") - private Object anytype1; - - @JsonProperty("anytype_2") - private Object anytype2; - - @JsonProperty("anytype_3") - private Object anytype3; - - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @ApiModelProperty(value = "") - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @ApiModelProperty(value = "") - public Map getMapNumber() { - return mapNumber; - } - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - /** - * Get mapInteger - * @return mapInteger - */ - - @ApiModelProperty(value = "") - public Map getMapInteger() { - return mapInteger; - } - - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - /** - * Get mapBoolean - * @return mapBoolean - */ - - @ApiModelProperty(value = "") - public Map getMapBoolean() { - return mapBoolean; - } - - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - /** - * Get mapArrayInteger - * @return mapArrayInteger - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - /** - * Get mapArrayAnytype - * @return mapArrayAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - /** - * Get mapMapString - * @return mapMapString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapString() { - return mapMapString; - } - - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - /** - * Get mapMapAnytype - * @return mapMapAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - */ - - @ApiModelProperty(value = "") - public Object getAnytype1() { - return anytype1; - } - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - */ - - @ApiModelProperty(value = "") - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @ApiModelProperty(value = "") - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index 989f88c0c63d..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index 32e7a118e940..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index a9f074c13f65..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index fcf049c6af9c..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index c15efd1d937b..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), -}) -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @ApiModelProperty(value = "") - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index aecbda603cb5..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index 194acd76a434..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index 8e8b948cac22..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @ApiModelProperty(value = "") - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index 4f3be6ed2259..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCatAllOf; -import org.openapitools.model.Cat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @ApiModelProperty(value = "") - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index dd13d7bdec4e..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @ApiModelProperty(value = "") - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index 57505b24226d..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @ApiModelProperty(value = "") - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @ApiModelProperty(value = "") - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @ApiModelProperty(value = "") - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @ApiModelProperty(value = "") - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @ApiModelProperty(value = "") - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @ApiModelProperty(value = "Name of the pet ") - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index b8976cec9e36..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.CatAllOf; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index f08bec554e28..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 96a6580d410a..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index 45154ca12c1d..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@ApiModel(description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index fce7506b0322..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @ApiModelProperty(value = "") - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 204603129979..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.DogAllOf; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index e752d7d851f7..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index 5c758075628f..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @ApiModelProperty(value = "") - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @ApiModelProperty(value = "") - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index 21a99583f0d2..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index 834d74556f35..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,327 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.OuterEnum; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @ApiModelProperty(value = "") - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @ApiModelProperty(value = "") - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @ApiModelProperty(value = "") - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index 35dca542482f..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@ApiModel(description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @ApiModelProperty(value = "Test capitalization") - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 77b8104b7a75..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @ApiModelProperty(value = "") - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @ApiModelProperty(value = "") - public List getFiles() { - return files; - } - - public void setFiles(List files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index 01d454756ee7..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,415 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @ApiModelProperty(value = "") - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @ApiModelProperty(value = "") - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @ApiModelProperty(value = "") - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @ApiModelProperty(value = "") - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @ApiModelProperty(value = "") - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @ApiModelProperty(value = "") - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @ApiModelProperty(value = "") - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @ApiModelProperty(required = true, value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index 3384df59d317..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index d23c0b96ca06..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,230 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @ApiModelProperty(value = "") - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @ApiModelProperty(value = "") - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap<>(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - */ - - @ApiModelProperty(value = "") - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index 0a91f59ff49b..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,148 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @ApiModelProperty(value = "") - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 5167914f6fd7..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@ApiModel(description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 19aae2715ecd..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @ApiModelProperty(value = "") - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @ApiModelProperty(value = "") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @ApiModelProperty(value = "") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index 851e9c831f80..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index e179538482eb..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @ApiModelProperty(value = "") - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index 8aa5465ad199..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@ApiModel(description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @ApiModelProperty(value = "") - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index d0980783d75b..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,156 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@ApiModel(description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @ApiModelProperty(value = "") - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index f52e43c1dd84..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 83e683e3d6ae..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,244 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @ApiModelProperty(value = "") - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @ApiModelProperty(value = "") - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @ApiModelProperty(value = "Order Status") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @ApiModelProperty(value = "") - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index 50e684f86e5c..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @ApiModelProperty(value = "") - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @ApiModelProperty(value = "") - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index cb8a02c1e184..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index db4c1ce0513c..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,267 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Pet - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private Set photoUrls = new LinkedHashSet<>(); - - @JsonProperty("tags") - @Valid - private List tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @ApiModelProperty(value = "") - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - if (this.photoUrls == null) { - this.photoUrls = new LinkedHashSet<>(); - } - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @ApiModelProperty(value = "") - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @ApiModelProperty(value = "pet status in the store") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index 6d313020ae9c..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @ApiModelProperty(value = "") - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index cbb43d463caf..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @ApiModelProperty(value = "") - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index 5c803770a210..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index ac0dd3265f79..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderDefault { - - @JsonProperty("string_item") - private String stringItem = "what"; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem = true; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); - } - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index b13b6e0d1d14..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,215 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderExample { - - @JsonProperty("string_item") - private String stringItem; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("float_item") - private Float floatItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(example = "what", required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - */ - @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") - public Float getFloatItem() { - return floatItem; - } - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(example = "true", required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); - } - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index cd278220668f..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @ApiModelProperty(value = "") - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @ApiModelProperty(value = "") - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @ApiModelProperty(value = "") - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @ApiModelProperty(value = "") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @ApiModelProperty(value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @ApiModelProperty(value = "") - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index cd6bf2b1a1d5..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,839 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class XmlItem { - - @JsonProperty("attribute_string") - private String attributeString; - - @JsonProperty("attribute_number") - private BigDecimal attributeNumber; - - @JsonProperty("attribute_integer") - private Integer attributeInteger; - - @JsonProperty("attribute_boolean") - private Boolean attributeBoolean; - - @JsonProperty("wrapped_array") - @Valid - private List wrappedArray = null; - - @JsonProperty("name_string") - private String nameString; - - @JsonProperty("name_number") - private BigDecimal nameNumber; - - @JsonProperty("name_integer") - private Integer nameInteger; - - @JsonProperty("name_boolean") - private Boolean nameBoolean; - - @JsonProperty("name_array") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - private List nameWrappedArray = null; - - @JsonProperty("prefix_string") - private String prefixString; - - @JsonProperty("prefix_number") - private BigDecimal prefixNumber; - - @JsonProperty("prefix_integer") - private Integer prefixInteger; - - @JsonProperty("prefix_boolean") - private Boolean prefixBoolean; - - @JsonProperty("prefix_array") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - private List prefixWrappedArray = null; - - @JsonProperty("namespace_string") - private String namespaceString; - - @JsonProperty("namespace_number") - private BigDecimal namespaceNumber; - - @JsonProperty("namespace_integer") - private Integer namespaceInteger; - - @JsonProperty("namespace_boolean") - private Boolean namespaceBoolean; - - @JsonProperty("namespace_array") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - private List namespaceWrappedArray = null; - - @JsonProperty("prefix_ns_string") - private String prefixNsString; - - @JsonProperty("prefix_ns_number") - private BigDecimal prefixNsNumber; - - @JsonProperty("prefix_ns_integer") - private Integer prefixNsInteger; - - @JsonProperty("prefix_ns_boolean") - private Boolean prefixNsBoolean; - - @JsonProperty("prefix_ns_array") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @ApiModelProperty(example = "string", value = "") - public String getAttributeString() { - return attributeString; - } - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getAttributeInteger() { - return attributeInteger; - } - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @ApiModelProperty(value = "") - public List getWrappedArray() { - return wrappedArray; - } - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNameString() { - return nameString; - } - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNameNumber() { - return nameNumber; - } - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNameInteger() { - return nameInteger; - } - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNameBoolean() { - return nameBoolean; - } - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @ApiModelProperty(value = "") - public List getNameArray() { - return nameArray; - } - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNameWrappedArray() { - return nameWrappedArray; - } - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixString() { - return prefixString; - } - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixInteger() { - return prefixInteger; - } - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @ApiModelProperty(value = "") - public List getPrefixArray() { - return prefixArray; - } - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNamespaceString() { - return namespaceString; - } - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceArray() { - return namespaceArray; - } - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixNsString() { - return prefixNsString; - } - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsArray() { - return prefixNsArray; - } - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/application.properties b/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/application.properties deleted file mode 100644 index 99ebf4d7c55e..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml deleted file mode 100644 index d02806b2d38c..000000000000 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml +++ /dev/null @@ -1,2264 +0,0 @@ -openapi: 3.0.1 -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:\ - \ \" \\" - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- url: http://petstore.swagger.io:80/v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /pet: - post: - operationId: addPet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - put: - operationId: updatePet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - "405": - content: {} - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - content: {} - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByTags: - get: - deprecated: true - description: "Multiple tags can be provided with comma separated strings. Use\ - \ tag1, tag2, tag3 for testing." - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - uniqueItems: true - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - description: successful operation - "400": - content: {} - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - responses: - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - "200": - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: store - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Find purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - format: int32 - type: integer - X-Expires-After: - description: date in UTC when token expires - schema: - format: date-time - type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Get user by user name - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - content: {} - description: Invalid user supplied - "404": - content: {} - description: User not found - summary: Updated user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - post: - description: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-contentType: application/xml - x-accepts: application/json - x-tags: - - tag: fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: $another-fake? - /fake/body-with-file-schema: - put: - description: "For this test, the body for this request much reference a schema\ - \ named `File`." - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: {} - description: Success - tags: - - fake - x-accepts: application/json - x-tags: - - tag: fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet -components: - schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - uniqueItems: true - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: "/[a-z]/i" - type: string - byte: - format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - BigDecimal: - format: number - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - 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 - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - type: object - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator-ignore b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/.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/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES deleted file mode 100644 index ac502713adb0..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES +++ /dev/null @@ -1,68 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java -src/main/java/org/openapitools/configuration/RFC3339DateFormat.java -src/main/java/org/openapitools/configuration/WebApplication.java -src/main/java/org/openapitools/configuration/WebMvcConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION deleted file mode 100644 index 5f68295fc196..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-spring-pageable/README.md b/samples/server/petstore/spring-mvc-spring-pageable/README.md deleted file mode 100644 index 5d3fb8923559..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# OpenAPI generated server - -Spring MVC Server - - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the Spring MVC framework. - -The underlying library integrating OpenAPI to Spring-MVC is [springfox](https://github.com/springfox/springfox) - -You can view the server in swagger-ui by pointing to -http://localhost:80/v2/ \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-spring-pageable/pom.xml b/samples/server/petstore/spring-mvc-spring-pageable/pom.xml deleted file mode 100644 index 7b02eec2ce64..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/pom.xml +++ /dev/null @@ -1,178 +0,0 @@ - - 4.0.0 - org.openapitools - spring-mvc-spring-pageable - jar - spring-mvc-spring-pageable - 1.0.0 - - src/main/java - - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty-version} - - - /v2 - - target/${project.artifactId}-${project.version} - 8079 - stopit - 10 - - 80 - 60000 - - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - - - - - start-jetty - pre-integration-test - - start - - - 0 - true - - - - stop-jetty - post-integration-test - - stop - - - - - - - - - org.slf4j - slf4j-log4j12 - ${slf4j-version} - - - - - org.springframework - spring-core - ${spring-version} - - - org.springframework - spring-webmvc - ${spring-version} - - - org.springframework - spring-web - ${spring-version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - - - jakarta.xml.bind - jakarta.xml.bind-api - ${jakarta.xml.bind-version} - - - - io.springfox - springfox-swagger2 - ${springfox-version} - - - com.fasterxml.jackson.core - jackson-annotations - - - - - io.springfox - springfox-swagger-ui - ${springfox-version} - - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - - junit - junit - ${junit-version} - test - - - jakarta.servlet - jakarta.servlet-api - ${servlet-api-version} - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - - org.springframework.data - spring-data-commons - 2.0.11.RELEASE - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - - - - 1.8 - ${java.version} - ${java.version} - 1.3.5 - 2.3.3 - 9.2.15.v20160210 - 1.7.21 - 4.13.1 - 4.0.4 - 2.9.2 - 2.9.9 - 2.8.4 - 2.0.2 - 4.3.20.RELEASE - 0.2.2 - 2.9.8 - 1.6.3 - - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index bbbc5c96bf77..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "another-fake", description = "the another-fake API") -public interface AnotherFakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "$another-fake?" }, - value = "To test special tags", - nickname = "call123testSpecialTags", - notes = "To test special tags and operation ID starting with number", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index 81dcb1da85e4..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final NativeWebRequest request; - - @Autowired - public AnotherFakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0ccf..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index a1e3a9409b88..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,586 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake", description = "the fake API") -public interface FakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "creates an XmlItem", - nickname = "createXmlItem", - notes = "this route creates an XmlItem" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/create_xml_item", - consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } - ) - default ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterBooleanSerialize", - notes = "Test serialization of outer boolean types", - response = Boolean.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterCompositeSerialize", - notes = "Test serialization of object with outer number type", - response = OuterComposite.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterNumberSerialize", - notes = "Test serialization of outer number types", - response = BigDecimal.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterStringSerialize", - notes = "Test serialization of outer string types", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithFileSchema", - notes = "For this test, the body for this request much reference a schema named `File`." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithQueryParams", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test \"client\" model", - nickname = "testClientModel", - notes = "To test \"client\" model", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", - nickname = "testEndpointParameters", - notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", - authorizations = { - @Authorization(value = "http_basic_test") - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test enum parameters", - nickname = "testEnumParameters", - notes = "To test enum parameters" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint to test group parameters (optional)", - nickname = "testGroupParameters", - notes = "Fake endpoint to test group parameters (optional)" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Someting wrong") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test inline additionalProperties", - nickname = "testInlineAdditionalProperties", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test json serialization of form data", - nickname = "testJsonFormData", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testQueryParameterCollectionFormat", - notes = "To test the collection format in query parameters" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image (required)", - nickname = "uploadFileWithRequiredFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index b81393d39d3b..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeApiController implements FakeApi { - - private final NativeWebRequest request; - - @Autowired - public FakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index 17ce875daaac..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") -public interface FakeClassnameTestApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake_classname_tags 123#$%^" }, - value = "To test class name in snake case", - nickname = "testClassname", - notes = "To test class name in snake case", - response = Client.class, - authorizations = { - @Authorization(value = "api_key_query") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 3f4a45e1f9fa..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final NativeWebRequest request; - - @Autowired - public FakeClassnameTestApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index 222c5398c8f5..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,396 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import springfox.documentation.annotations.ApiIgnore; -import org.openapitools.model.ModelApiResponse; -import org.springframework.data.domain.Pageable; -import org.openapitools.model.Pet; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "pet", description = "the pet API") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @ApiIgnore final Pageable pageable - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @ApiIgnore final Pageable pageable - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @ApiOperation( - tags = { "pet" }, - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet.class, - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index 57cbf21bde71..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class PetApiController implements PetApi { - - private final NativeWebRequest request; - - @Autowired - public PetApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 1292cf4edaa2..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "store", description = "the store API") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "store" }, - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Integer.class, - responseContainer = "Map", - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @ApiOperation( - tags = { "store" }, - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index a1f02f844bf3..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class StoreApiController implements StoreApi { - - private final NativeWebRequest request; - - @Autowired - public StoreApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 8b7791294a9b..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,285 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "user", description = "the user API") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index 8efc6418c2e8..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class UserApiController implements UserApi { - - private final NativeWebRequest request; - - @Autowired - public UserApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 25727830541b..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 4394c026e7fe..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("OpenAPI Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java deleted file mode 100644 index 682e77202d1e..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Bean; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.data.web.PageableHandlerMethodArgumentResolver; - -import java.util.List; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) -@EnableWebMvc -@PropertySource("classpath:application.properties") -@Import(OpenAPIDocumentationConfig.class) -public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter { - private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; - - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "classpath:/META-INF/resources/", "classpath:/resources/", - "classpath:/static/", "classpath:/public/" }; - - private static final String[] RESOURCE_LOCATIONS; - static { - RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length - + SERVLET_RESOURCE_LOCATIONS.length]; - System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0, - SERVLET_RESOURCE_LOCATIONS.length); - System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, - SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length); - } - - private static final String[] STATIC_INDEX_HTML_RESOURCES; - static { - STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length]; - for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) { - STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html"; - } - } - - @Override - public void addArgumentResolvers(List argumentResolvers) { - argumentResolvers.add(new PageableHandlerMethodArgumentResolver()); - super.addArgumentResolvers(argumentResolvers); - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - if (!registry.hasMappingForPattern("/webjars/**")) { - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); - } - } - - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Bean - public Jackson2ObjectMapperBuilder builder() { - return new Jackson2ObjectMapperBuilder() - .indentOutput(true) - .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .modulesToInstall(new JsonNullableModule()) - - .dateFormat(new RFC3339DateFormat()); - } - - @Override - public void configureMessageConverters(List> converters) { - converters.add(new MappingJackson2HttpMessageConverter(objectMapper())); - converters.add(new StringHttpMessageConverter()); - super.configureMessageConverters(converters); - } - - @Bean - public ObjectMapper objectMapper(){ - return builder().build(); - } -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java deleted file mode 100644 index 697c27391a5c..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebApplication.java deleted file mode 100644 index 8e9d7af82449..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebApplication.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { - - @Override - protected Class[] getRootConfigClasses() { - return new Class[] { OpenAPIUiConfiguration.class }; - } - - @Override - protected Class[] getServletConfigClasses() { - return new Class[] { WebMvcConfiguration.class }; - } - - @Override - protected String[] getServletMappings() { - return new String[] { "/" }; - } -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java deleted file mode 100644 index 691a5378ca49..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebMvcConfiguration extends WebMvcConfigurationSupport { - @Override - public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } -} diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index ea719cc4ad89..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index a4ec39252ebe..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index 47db34f7b504..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index 5851aa2c2498..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,400 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - private Map> mapMapAnytype = null; - - @JsonProperty("anytype_1") - private Object anytype1; - - @JsonProperty("anytype_2") - private Object anytype2; - - @JsonProperty("anytype_3") - private Object anytype3; - - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @ApiModelProperty(value = "") - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @ApiModelProperty(value = "") - public Map getMapNumber() { - return mapNumber; - } - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - /** - * Get mapInteger - * @return mapInteger - */ - - @ApiModelProperty(value = "") - public Map getMapInteger() { - return mapInteger; - } - - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - /** - * Get mapBoolean - * @return mapBoolean - */ - - @ApiModelProperty(value = "") - public Map getMapBoolean() { - return mapBoolean; - } - - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - /** - * Get mapArrayInteger - * @return mapArrayInteger - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - /** - * Get mapArrayAnytype - * @return mapArrayAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - /** - * Get mapMapString - * @return mapMapString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapString() { - return mapMapString; - } - - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - /** - * Get mapMapAnytype - * @return mapMapAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - */ - - @ApiModelProperty(value = "") - public Object getAnytype1() { - return anytype1; - } - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - */ - - @ApiModelProperty(value = "") - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @ApiModelProperty(value = "") - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index bba3dce1a55e..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index 5f48487e05d6..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index 40ca1af6ab4f..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index ddc76e27b19f..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index 1dc5fc69c61b..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), -}) -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @ApiModelProperty(value = "") - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 3859dcfdcc05..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index a90ce117c238..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index e8f37b16d5cb..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,162 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @ApiModelProperty(value = "") - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index 37c928a79482..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,204 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @ApiModelProperty(value = "") - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @ApiModelProperty(value = "") - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @ApiModelProperty(value = "") - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @ApiModelProperty(value = "") - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @ApiModelProperty(value = "") - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @ApiModelProperty(value = "Name of the pet ") - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index 9fb7bfef1800..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.CatAllOf; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index 7f699ced5842..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 8adf35c2fa00..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index 72e9288b53af..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@ApiModel(description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index 9891fe7dafce..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @ApiModelProperty(value = "") - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 3ee8ac596893..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.DogAllOf; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index c081b7517a47..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index b85ad3e155ec..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,190 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @ApiModelProperty(value = "") - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @ApiModelProperty(value = "") - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index c2abaaed4305..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index ba5b8c323a9a..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,328 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.OuterEnum; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @ApiModelProperty(value = "") - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @ApiModelProperty(value = "") - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @ApiModelProperty(value = "") - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index 685394664974..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@ApiModel(description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @ApiModelProperty(value = "Test capitalization") - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 01149ce8f6ae..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @ApiModelProperty(value = "") - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @ApiModelProperty(value = "") - public List getFiles() { - return files; - } - - public void setFiles(List files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index 153641cacd56..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,416 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @ApiModelProperty(value = "") - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @ApiModelProperty(value = "") - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @ApiModelProperty(value = "") - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @ApiModelProperty(value = "") - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @ApiModelProperty(value = "") - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @ApiModelProperty(value = "") - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @ApiModelProperty(value = "") - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @ApiModelProperty(required = true, value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index d235c68a51ff..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index 27e3cea8e6ed..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,231 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @ApiModelProperty(value = "") - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @ApiModelProperty(value = "") - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap<>(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - */ - - @ApiModelProperty(value = "") - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index e490e2a61ef7..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @ApiModelProperty(value = "") - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 56b222f4e45b..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@ApiModel(description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 131e671e9160..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,134 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @ApiModelProperty(value = "") - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @ApiModelProperty(value = "") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @ApiModelProperty(value = "") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be1..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index 7800a7d698f7..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @ApiModelProperty(value = "") - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index a933badc4910..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@ApiModel(description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @ApiModelProperty(value = "") - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index febe2115a665..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,157 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@ApiModel(description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @ApiModelProperty(value = "") - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index dcf5c5e801a6..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 6bd55e5a1548..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,245 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @ApiModelProperty(value = "") - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @ApiModelProperty(value = "") - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @ApiModelProperty(value = "Order Status") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @ApiModelProperty(value = "") - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index eca5e7cd4fa5..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @ApiModelProperty(value = "") - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @ApiModelProperty(value = "") - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 1f09d0a5d17a..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index e2ddfcdfcb17..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @ApiModelProperty(value = "") - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index cbc94826b926..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @ApiModelProperty(value = "") - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index 03b4ffcdadca..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 01e5d5f3fccd..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderDefault { - - @JsonProperty("string_item") - private String stringItem = "what"; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem = true; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index e907ad9c28e7..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,213 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderExample { - - @JsonProperty("string_item") - private String stringItem; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("float_item") - private Float floatItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(example = "what", required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - */ - @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") - public Float getFloatItem() { - return floatItem; - } - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(example = "true", required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index cff62427bf1a..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,252 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @ApiModelProperty(value = "") - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @ApiModelProperty(value = "") - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @ApiModelProperty(value = "") - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @ApiModelProperty(value = "") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @ApiModelProperty(value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @ApiModelProperty(value = "") - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 930edebcef74..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,840 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class XmlItem { - - @JsonProperty("attribute_string") - private String attributeString; - - @JsonProperty("attribute_number") - private BigDecimal attributeNumber; - - @JsonProperty("attribute_integer") - private Integer attributeInteger; - - @JsonProperty("attribute_boolean") - private Boolean attributeBoolean; - - @JsonProperty("wrapped_array") - @Valid - private List wrappedArray = null; - - @JsonProperty("name_string") - private String nameString; - - @JsonProperty("name_number") - private BigDecimal nameNumber; - - @JsonProperty("name_integer") - private Integer nameInteger; - - @JsonProperty("name_boolean") - private Boolean nameBoolean; - - @JsonProperty("name_array") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - private List nameWrappedArray = null; - - @JsonProperty("prefix_string") - private String prefixString; - - @JsonProperty("prefix_number") - private BigDecimal prefixNumber; - - @JsonProperty("prefix_integer") - private Integer prefixInteger; - - @JsonProperty("prefix_boolean") - private Boolean prefixBoolean; - - @JsonProperty("prefix_array") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - private List prefixWrappedArray = null; - - @JsonProperty("namespace_string") - private String namespaceString; - - @JsonProperty("namespace_number") - private BigDecimal namespaceNumber; - - @JsonProperty("namespace_integer") - private Integer namespaceInteger; - - @JsonProperty("namespace_boolean") - private Boolean namespaceBoolean; - - @JsonProperty("namespace_array") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - private List namespaceWrappedArray = null; - - @JsonProperty("prefix_ns_string") - private String prefixNsString; - - @JsonProperty("prefix_ns_number") - private BigDecimal prefixNsNumber; - - @JsonProperty("prefix_ns_integer") - private Integer prefixNsInteger; - - @JsonProperty("prefix_ns_boolean") - private Boolean prefixNsBoolean; - - @JsonProperty("prefix_ns_array") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @ApiModelProperty(example = "string", value = "") - public String getAttributeString() { - return attributeString; - } - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getAttributeInteger() { - return attributeInteger; - } - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @ApiModelProperty(value = "") - public List getWrappedArray() { - return wrappedArray; - } - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNameString() { - return nameString; - } - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNameNumber() { - return nameNumber; - } - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNameInteger() { - return nameInteger; - } - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNameBoolean() { - return nameBoolean; - } - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @ApiModelProperty(value = "") - public List getNameArray() { - return nameArray; - } - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNameWrappedArray() { - return nameWrappedArray; - } - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixString() { - return prefixString; - } - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixInteger() { - return prefixInteger; - } - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @ApiModelProperty(value = "") - public List getPrefixArray() { - return prefixArray; - } - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNamespaceString() { - return namespaceString; - } - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceArray() { - return namespaceArray; - } - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixNsString() { - return prefixNsString; - } - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsArray() { - return prefixNsArray; - } - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/application.properties b/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/application.properties deleted file mode 100644 index 99ebf4d7c55e..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml deleted file mode 100644 index cdceff13c4d8..000000000000 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml +++ /dev/null @@ -1,2248 +0,0 @@ -openapi: 3.0.1 -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:\ - \ \" \\" - license: - name: Apache-2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- url: http://petstore.swagger.io:80/v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /pet: - post: - operationId: addPet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - put: - operationId: updatePet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - "405": - content: {} - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - content: {} - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-spring-paginated: true - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByTags: - get: - deprecated: true - description: "Multiple tags can be provided with comma separated strings. Use\ - \ tag1, tag2, tag3 for testing." - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - content: {} - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-spring-paginated: true - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - responses: - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - "200": - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: store - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Find purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - format: int32 - type: integer - X-Expires-After: - description: date in UTC when token expires - schema: - format: date-time - type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Get user by user name - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - content: {} - description: Invalid user supplied - "404": - content: {} - description: User not found - summary: Updated user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - post: - description: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-contentType: application/xml - x-accepts: application/json - x-tags: - - tag: fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: $another-fake? - /fake/body-with-file-schema: - put: - description: "For this test, the body for this request much reference a schema\ - \ named `File`." - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: {} - description: Success - tags: - - fake - x-accepts: application/json - x-tags: - - tag: fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet -components: - schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: "/[a-z]/i" - type: string - byte: - format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - BigDecimal: - format: number - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - 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 - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc/.openapi-generator-ignore b/samples/server/petstore/spring-mvc/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/server/petstore/spring-mvc/.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/server/petstore/spring-mvc/.openapi-generator/FILES b/samples/server/petstore/spring-mvc/.openapi-generator/FILES deleted file mode 100644 index 97eae4aa8c7a..000000000000 --- a/samples/server/petstore/spring-mvc/.openapi-generator/FILES +++ /dev/null @@ -1,70 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java -src/main/java/org/openapitools/configuration/RFC3339DateFormat.java -src/main/java/org/openapitools/configuration/WebApplication.java -src/main/java/org/openapitools/configuration/WebMvcConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION deleted file mode 100644 index 5f68295fc196..000000000000 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/README.md b/samples/server/petstore/spring-mvc/README.md deleted file mode 100644 index 4d5e52bd8f88..000000000000 --- a/samples/server/petstore/spring-mvc/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# OpenAPI generated server - -Spring MVC Server - - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the Spring MVC framework. - -The underlying library integrating OpenAPI to Spring-MVC is [springfox](https://github.com/springfox/springfox) - -You can view the server in swagger-ui by pointing to -http://localhost:8002/v2/ \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/pom.xml b/samples/server/petstore/spring-mvc/pom.xml deleted file mode 100644 index fc26074fc742..000000000000 --- a/samples/server/petstore/spring-mvc/pom.xml +++ /dev/null @@ -1,178 +0,0 @@ - - 4.0.0 - org.openapitools - spring-mvc-server - jar - spring-mvc-server - 1.0.0 - - src/main/java - - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty-version} - - - /v2 - - target/${project.artifactId}-${project.version} - 8079 - stopit - 10 - - 8002 - 60000 - - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - - - - - start-jetty - pre-integration-test - - start - - - 0 - true - - - - stop-jetty - post-integration-test - - stop - - - - - - - - - org.slf4j - slf4j-log4j12 - ${slf4j-version} - - - - - org.springframework - spring-core - ${spring-version} - - - org.springframework - spring-webmvc - ${spring-version} - - - org.springframework - spring-web - ${spring-version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - - - jakarta.xml.bind - jakarta.xml.bind-api - ${jakarta.xml.bind-version} - - - - io.springfox - springfox-swagger2 - ${springfox-version} - - - com.fasterxml.jackson.core - jackson-annotations - - - - - io.springfox - springfox-swagger-ui - ${springfox-version} - - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - - junit - junit - ${junit-version} - test - - - jakarta.servlet - jakarta.servlet-api - ${servlet-api-version} - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - - org.springframework.data - spring-data-commons - 2.0.11.RELEASE - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - - - - 1.8 - ${java.version} - ${java.version} - 1.3.5 - 2.3.3 - 9.2.15.v20160210 - 1.7.21 - 4.13.1 - 4.0.4 - 2.9.2 - 2.9.9 - 2.8.4 - 2.0.2 - 4.3.20.RELEASE - 0.2.2 - 2.9.8 - 1.6.3 - - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index bbbc5c96bf77..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "another-fake", description = "the another-fake API") -public interface AnotherFakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "$another-fake?" }, - value = "To test special tags", - nickname = "call123testSpecialTags", - notes = "To test special tags and operation ID starting with number", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index 81dcb1da85e4..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final NativeWebRequest request; - - @Autowired - public AnotherFakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0ccf..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index 27ddf876c5ec..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,586 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake", description = "the fake API") -public interface FakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "creates an XmlItem", - nickname = "createXmlItem", - notes = "this route creates an XmlItem" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/create_xml_item", - consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } - ) - default ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterBooleanSerialize", - notes = "Test serialization of outer boolean types", - response = Boolean.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterCompositeSerialize", - notes = "Test serialization of object with outer number type", - response = OuterComposite.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterNumberSerialize", - notes = "Test serialization of outer number types", - response = BigDecimal.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "fakeOuterStringSerialize", - notes = "Test serialization of outer string types", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithFileSchema", - notes = "For this test, the body for this request much reference a schema named `File`." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testBodyWithQueryParams", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test \"client\" model", - nickname = "testClientModel", - notes = "To test \"client\" model", - response = Client.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - nickname = "testEndpointParameters", - notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - authorizations = { - @Authorization(value = "http_basic_test") - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @ApiOperation( - tags = { "fake" }, - value = "To test enum parameters", - nickname = "testEnumParameters", - notes = "To test enum parameters" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - */ - @ApiOperation( - tags = { "fake" }, - value = "Fake endpoint to test group parameters (optional)", - nickname = "testGroupParameters", - notes = "Fake endpoint to test group parameters (optional)" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Someting wrong") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test inline additionalProperties", - nickname = "testInlineAdditionalProperties", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "test json serialization of form data", - nickname = "testJsonFormData", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @ApiOperation( - tags = { "fake" }, - value = "", - nickname = "testQueryParameterCollectionFormat", - notes = "To test the collection format in query parameters" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image (required)", - nickname = "uploadFileWithRequiredFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index b81393d39d3b..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeApiController implements FakeApi { - - private final NativeWebRequest request; - - @Autowired - public FakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index 17ce875daaac..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") -public interface FakeClassnameTestApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "fake_classname_tags 123#$%^" }, - value = "To test class name in snake case", - nickname = "testClassname", - notes = "To test class name in snake case", - response = Client.class, - authorizations = { - @Authorization(value = "api_key_query") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 3f4a45e1f9fa..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final NativeWebRequest request; - - @Autowired - public FakeClassnameTestApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index 864173ded4fc..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "pet", description = "the pet API") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet.class, - responseContainer = "Set", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), - @ApiResponse(code = 400, message = "Invalid tag value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @ApiOperation( - tags = { "pet" }, - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet.class, - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index 57cbf21bde71..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class PetApiController implements PetApi { - - private final NativeWebRequest request; - - @Autowired - public PetApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 1292cf4edaa2..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "store", description = "the store API") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "store" }, - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Integer.class, - responseContainer = "Map", - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @ApiOperation( - tags = { "store" }, - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index a1f02f844bf3..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class StoreApiController implements StoreApi { - - private final NativeWebRequest request; - - @Autowired - public StoreApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 8b7791294a9b..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,285 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "user", description = "the user API") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index 8efc6418c2e8..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.api; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class UserApiController implements UserApi { - - private final NativeWebRequest request; - - @Autowired - public UserApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 25727830541b..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 3df5ef9f3c34..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("OpenAPI Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java deleted file mode 100644 index 682e77202d1e..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Bean; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.data.web.PageableHandlerMethodArgumentResolver; - -import java.util.List; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) -@EnableWebMvc -@PropertySource("classpath:application.properties") -@Import(OpenAPIDocumentationConfig.class) -public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter { - private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; - - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "classpath:/META-INF/resources/", "classpath:/resources/", - "classpath:/static/", "classpath:/public/" }; - - private static final String[] RESOURCE_LOCATIONS; - static { - RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length - + SERVLET_RESOURCE_LOCATIONS.length]; - System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0, - SERVLET_RESOURCE_LOCATIONS.length); - System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, - SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length); - } - - private static final String[] STATIC_INDEX_HTML_RESOURCES; - static { - STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length]; - for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) { - STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html"; - } - } - - @Override - public void addArgumentResolvers(List argumentResolvers) { - argumentResolvers.add(new PageableHandlerMethodArgumentResolver()); - super.addArgumentResolvers(argumentResolvers); - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - if (!registry.hasMappingForPattern("/webjars/**")) { - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); - } - } - - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - - @Bean - public Jackson2ObjectMapperBuilder builder() { - return new Jackson2ObjectMapperBuilder() - .indentOutput(true) - .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .modulesToInstall(new JsonNullableModule()) - - .dateFormat(new RFC3339DateFormat()); - } - - @Override - public void configureMessageConverters(List> converters) { - converters.add(new MappingJackson2HttpMessageConverter(objectMapper())); - converters.add(new StringHttpMessageConverter()); - super.configureMessageConverters(converters); - } - - @Bean - public ObjectMapper objectMapper(){ - return builder().build(); - } -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java deleted file mode 100644 index 697c27391a5c..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebApplication.java deleted file mode 100644 index 8e9d7af82449..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebApplication.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { - - @Override - protected Class[] getRootConfigClasses() { - return new Class[] { OpenAPIUiConfiguration.class }; - } - - @Override - protected Class[] getServletConfigClasses() { - return new Class[] { WebMvcConfiguration.class }; - } - - @Override - protected String[] getServletMappings() { - return new String[] { "/" }; - } -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java deleted file mode 100644 index 691a5378ca49..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class WebMvcConfiguration extends WebMvcConfigurationSupport { - @Override - public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } -} diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index f72d9b894ce0..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index 17d2e07868be..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index 5a89a239c7bb..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index e1c617b3a62e..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,402 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - private Map> mapMapAnytype = null; - - @JsonProperty("anytype_1") - private Object anytype1; - - @JsonProperty("anytype_2") - private Object anytype2; - - @JsonProperty("anytype_3") - private Object anytype3; - - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @ApiModelProperty(value = "") - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @ApiModelProperty(value = "") - public Map getMapNumber() { - return mapNumber; - } - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - /** - * Get mapInteger - * @return mapInteger - */ - - @ApiModelProperty(value = "") - public Map getMapInteger() { - return mapInteger; - } - - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - /** - * Get mapBoolean - * @return mapBoolean - */ - - @ApiModelProperty(value = "") - public Map getMapBoolean() { - return mapBoolean; - } - - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - /** - * Get mapArrayInteger - * @return mapArrayInteger - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - /** - * Get mapArrayAnytype - * @return mapArrayAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - /** - * Get mapMapString - * @return mapMapString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapString() { - return mapMapString; - } - - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - /** - * Get mapMapAnytype - * @return mapMapAnytype - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - */ - - @ApiModelProperty(value = "") - public Object getAnytype1() { - return anytype1; - } - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - */ - - @ApiModelProperty(value = "") - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @ApiModelProperty(value = "") - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index dc95c5c9454a..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index 7325cfa7dd1f..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index 7e8cab024670..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index d14290a194c1..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index aded2bae8cb8..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), -}) -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @ApiModelProperty(value = "") - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac0..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index f733f6d05d5b..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index 948967dfb0e3..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @ApiModelProperty(value = "") - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index e9c533969a90..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @ApiModelProperty(value = "") - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @ApiModelProperty(value = "") - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index 832369e9ff4e..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCatAllOf; -import org.openapitools.model.Cat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @ApiModelProperty(value = "") - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index 46157e727be0..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,129 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @ApiModelProperty(value = "") - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index 63572bf8e8e3..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @ApiModelProperty(value = "") - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @ApiModelProperty(value = "") - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @ApiModelProperty(value = "") - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @ApiModelProperty(value = "") - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @ApiModelProperty(value = "") - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @ApiModelProperty(value = "Name of the pet ") - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index 108e5c8b30a5..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.CatAllOf; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index 6cf7296ae696..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 1497947c1e7e..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index 359d871aa11b..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@ApiModel(description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index a7b07bf268c3..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @ApiModelProperty(value = "") - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 800b5daa10cf..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Animal; -import org.openapitools.model.DogAllOf; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index 140f7f8fb348..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index 816494968a44..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,194 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @ApiModelProperty(value = "") - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @ApiModelProperty(value = "") - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index acf588be02cd..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ -@com.fasterxml.jackson.annotation.JsonFormat - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index 758e4bf1fc39..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,334 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.OuterEnum; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @ApiModelProperty(value = "") - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @ApiModelProperty(value = "") - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @ApiModelProperty(value = "") - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index f0763ba3be83..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@ApiModel(description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @ApiModelProperty(value = "Test capitalization") - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index c85e7c28fb92..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,122 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @ApiModelProperty(value = "") - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @ApiModelProperty(value = "") - public List getFiles() { - return files; - } - - public void setFiles(List files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index 07efbb703101..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,418 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @ApiModelProperty(value = "") - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @ApiModelProperty(value = "") - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @ApiModelProperty(value = "") - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @ApiModelProperty(value = "") - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @ApiModelProperty(value = "") - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @ApiModelProperty(value = "") - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @ApiModelProperty(value = "") - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @ApiModelProperty(required = true, value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index b75cd19a6918..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index a67a2f842a80..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @ApiModelProperty(value = "") - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @ApiModelProperty(value = "") - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @ApiModelProperty(value = "") - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap<>(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - */ - - @ApiModelProperty(value = "") - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index 09ac3cd1254e..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @ApiModelProperty(value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @ApiModelProperty(value = "") - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index c49848888342..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@ApiModel(description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 5c89ae3304d4..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @ApiModelProperty(value = "") - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @ApiModelProperty(value = "") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @ApiModelProperty(value = "") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index 5d80627d2f27..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index dccafedeef3e..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @ApiModelProperty(value = "") - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index bce5d854f17e..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@ApiModel(description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @ApiModelProperty(value = "") - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index 9afeb6c3d0a7..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@ApiModel(description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @ApiModelProperty(value = "") - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @ApiModelProperty(readOnly = true, value = "") - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index e78ca1fb663d..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 05b93a9c0c79..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,248 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @ApiModelProperty(value = "") - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @ApiModelProperty(value = "") - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @ApiModelProperty(value = "Order Status") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @ApiModelProperty(value = "") - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index 6b6318d1e2c6..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @ApiModelProperty(value = "") - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @ApiModelProperty(value = "") - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @ApiModelProperty(value = "") - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 1adaf1da0cd6..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ -@com.fasterxml.jackson.annotation.JsonFormat - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index 07fb58bfa1f1..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,268 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Pet - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private Set photoUrls = new LinkedHashSet<>(); - - @JsonProperty("tags") - @Valid - private List tags = null; - - /** - * pet status in the store - */ - @com.fasterxml.jackson.annotation.JsonFormat -public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @ApiModelProperty(value = "") - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @ApiModelProperty(value = "") - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @ApiModelProperty(value = "pet status in the store") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index f54ba1923dc9..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @ApiModelProperty(readOnly = true, value = "") - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @ApiModelProperty(value = "") - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index 96e62ae0abce..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @ApiModelProperty(value = "") - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e223..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index ddc332d38703..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 42fd3375bfd1..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderDefault { - - @JsonProperty("string_item") - private String stringItem = "what"; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem = true; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index 48b53ae02b86..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,215 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderExample { - - @JsonProperty("string_item") - private String stringItem; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("float_item") - private Float floatItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @ApiModelProperty(example = "what", required = true, value = "") - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - */ - @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") - public Float getFloatItem() { - return floatItem; - } - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @ApiModelProperty(example = "true", required = true, value = "") - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index f889aba17b7e..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,254 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @ApiModelProperty(value = "") - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @ApiModelProperty(value = "") - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @ApiModelProperty(value = "") - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @ApiModelProperty(value = "") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @ApiModelProperty(value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @ApiModelProperty(value = "") - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 699a0dc85003..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,842 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class XmlItem { - - @JsonProperty("attribute_string") - private String attributeString; - - @JsonProperty("attribute_number") - private BigDecimal attributeNumber; - - @JsonProperty("attribute_integer") - private Integer attributeInteger; - - @JsonProperty("attribute_boolean") - private Boolean attributeBoolean; - - @JsonProperty("wrapped_array") - @Valid - private List wrappedArray = null; - - @JsonProperty("name_string") - private String nameString; - - @JsonProperty("name_number") - private BigDecimal nameNumber; - - @JsonProperty("name_integer") - private Integer nameInteger; - - @JsonProperty("name_boolean") - private Boolean nameBoolean; - - @JsonProperty("name_array") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - private List nameWrappedArray = null; - - @JsonProperty("prefix_string") - private String prefixString; - - @JsonProperty("prefix_number") - private BigDecimal prefixNumber; - - @JsonProperty("prefix_integer") - private Integer prefixInteger; - - @JsonProperty("prefix_boolean") - private Boolean prefixBoolean; - - @JsonProperty("prefix_array") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - private List prefixWrappedArray = null; - - @JsonProperty("namespace_string") - private String namespaceString; - - @JsonProperty("namespace_number") - private BigDecimal namespaceNumber; - - @JsonProperty("namespace_integer") - private Integer namespaceInteger; - - @JsonProperty("namespace_boolean") - private Boolean namespaceBoolean; - - @JsonProperty("namespace_array") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - private List namespaceWrappedArray = null; - - @JsonProperty("prefix_ns_string") - private String prefixNsString; - - @JsonProperty("prefix_ns_number") - private BigDecimal prefixNsNumber; - - @JsonProperty("prefix_ns_integer") - private Integer prefixNsInteger; - - @JsonProperty("prefix_ns_boolean") - private Boolean prefixNsBoolean; - - @JsonProperty("prefix_ns_array") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @ApiModelProperty(example = "string", value = "") - public String getAttributeString() { - return attributeString; - } - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getAttributeInteger() { - return attributeInteger; - } - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @ApiModelProperty(value = "") - public List getWrappedArray() { - return wrappedArray; - } - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNameString() { - return nameString; - } - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNameNumber() { - return nameNumber; - } - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNameInteger() { - return nameInteger; - } - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNameBoolean() { - return nameBoolean; - } - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @ApiModelProperty(value = "") - public List getNameArray() { - return nameArray; - } - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNameWrappedArray() { - return nameWrappedArray; - } - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixString() { - return prefixString; - } - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixInteger() { - return prefixInteger; - } - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @ApiModelProperty(value = "") - public List getPrefixArray() { - return prefixArray; - } - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - */ - - @ApiModelProperty(example = "string", value = "") - public String getNamespaceString() { - return namespaceString; - } - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceArray() { - return namespaceArray; - } - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @ApiModelProperty(value = "") - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - */ - - @ApiModelProperty(example = "string", value = "") - public String getPrefixNsString() { - return prefixNsString; - } - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - */ - @Valid - @ApiModelProperty(example = "1.234", value = "") - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - */ - - @ApiModelProperty(example = "-2", value = "") - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - */ - - @ApiModelProperty(example = "true", value = "") - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsArray() { - return prefixNsArray; - } - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @ApiModelProperty(value = "") - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-mvc/src/main/resources/application.properties b/samples/server/petstore/spring-mvc/src/main/resources/application.properties deleted file mode 100644 index 99ebf4d7c55e..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -springfox.documentation.swagger.v2.path=/api-docs diff --git a/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml deleted file mode 100644 index d02806b2d38c..000000000000 --- a/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml +++ /dev/null @@ -1,2264 +0,0 @@ -openapi: 3.0.1 -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:\ - \ \" \\" - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- url: http://petstore.swagger.io:80/v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /pet: - post: - operationId: addPet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - put: - operationId: updatePet - requestBody: - 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 - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - "405": - content: {} - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - content: {} - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/findByTags: - get: - deprecated: true - description: "Multiple tags can be provided with comma separated strings. Use\ - \ tag1, tag2, tag3 for testing." - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - uniqueItems: true - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - description: successful operation - "400": - content: {} - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - responses: - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - "200": - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: store - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Find purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - format: int32 - type: integer - X-Expires-After: - description: date in UTC when token expires - schema: - format: date-time - type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Get user by user name - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - content: {} - description: Invalid user supplied - "404": - content: {} - description: User not found - summary: Updated user - tags: - - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - post: - description: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-contentType: application/xml - x-accepts: application/json - x-tags: - - tag: fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: $another-fake? - /fake/body-with-file-schema: - put: - description: "For this test, the body for this request much reference a schema\ - \ named `File`." - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: {} - description: Success - tags: - - fake - x-accepts: application/json - x-tags: - - tag: fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - x-contentType: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet -components: - schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - uniqueItems: true - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: "/[a-z]/i" - type: string - byte: - format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - BigDecimal: - format: number - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - 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 - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - type: object - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES index 6d8d3656155a..32fdc6a9409b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -16,6 +16,7 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -66,3 +67,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/README.md b/samples/server/petstore/springboot-beanvalidation-no-nullable/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/README.md +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index af993bc1616c..4a7d0f15507c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -63,5 +73,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index c00e37f8afb5..000000000000 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - -} diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..1ebe51cb901d --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,17 @@ +package org.openapitools; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 425e530b93b1..000000000000 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("OpenAPI Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .directModelSubstitute(org.threeten.bp.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(org.threeten.bp.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java similarity index 95% rename from samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename to samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java index 589dd7dc5e7f..e05217a98f21 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -15,12 +15,13 @@ import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; +import javax.annotation.Generated; import javax.servlet.ServletContext; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @EnableSwagger2 -public class OpenAPIDocumentationConfig { +public class SpringFoxConfiguration { ApiInfo apiInfo() { return new ApiInfoBuilder() diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES index 6d8d3656155a..ff6da0b88a7c 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -16,6 +16,7 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -66,3 +67,4 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-beanvalidation/README.md b/samples/server/petstore/springboot-beanvalidation/README.md index 8b9e02180fec..ce826ea62754 100644 --- a/samples/server/petstore/springboot-beanvalidation/README.md +++ b/samples/server/petstore/springboot-beanvalidation/README.md @@ -2,17 +2,22 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ -Start your server as a simple java application +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. -You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ + +Start your server as a simple java application Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/pom.xml b/samples/server/petstore/springboot-beanvalidation/pom.xml index a9da2ec020fd..e7182452b390 100644 --- a/samples/server/petstore/springboot-beanvalidation/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation/pom.xml @@ -68,5 +68,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..707313504790 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,19 +1,13 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - /** * Home redirection to OpenAPI api documentation */ @Controller public class HomeController { - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java similarity index 95% rename from samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename to samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java index 589dd7dc5e7f..e05217a98f21 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -15,12 +15,13 @@ import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; +import javax.annotation.Generated; import javax.servlet.ServletContext; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @EnableSwagger2 -public class OpenAPIDocumentationConfig { +public class SpringFoxConfiguration { ApiInfo apiInfo() { return new ApiInfoBuilder() diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/application.properties b/samples/server/petstore/springboot-beanvalidation/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-beanvalidation/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-beanvalidation/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES index bd5a0e2c0574..84b7f1df792d 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -22,6 +22,7 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -72,3 +73,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-delegate-j8/README.md b/samples/server/petstore/springboot-delegate-j8/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-delegate-j8/README.md +++ b/samples/server/petstore/springboot-delegate-j8/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/pom.xml b/samples/server/petstore/springboot-delegate-j8/pom.xml index 4dc9b6f1c579..5666ce3546c1 100644 --- a/samples/server/petstore/springboot-delegate-j8/pom.xml +++ b/samples/server/petstore/springboot-delegate-j8/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java similarity index 95% rename from samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename to samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java index 589dd7dc5e7f..e05217a98f21 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -15,12 +15,13 @@ import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; +import javax.annotation.Generated; import javax.servlet.ServletContext; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @EnableSwagger2 -public class OpenAPIDocumentationConfig { +public class SpringFoxConfiguration { ApiInfo apiInfo() { return new ApiInfoBuilder() diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/application.properties b/samples/server/petstore/springboot-delegate-j8/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-delegate-j8/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-delegate-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-delegate-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES index bd5a0e2c0574..84b7f1df792d 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -22,6 +22,7 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -72,3 +73,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-delegate/README.md b/samples/server/petstore/springboot-delegate/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-delegate/README.md +++ b/samples/server/petstore/springboot-delegate/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/pom.xml b/samples/server/petstore/springboot-delegate/pom.xml index 4e8cd4a140ea..d4270a30845d 100644 --- a/samples/server/petstore/springboot-delegate/pom.xml +++ b/samples/server/petstore/springboot-delegate/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java similarity index 95% rename from samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename to samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java index 589dd7dc5e7f..e05217a98f21 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -15,12 +15,13 @@ import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; +import javax.annotation.Generated; import javax.servlet.ServletContext; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @EnableSwagger2 -public class OpenAPIDocumentationConfig { +public class SpringFoxConfiguration { ApiInfo apiInfo() { return new ApiInfoBuilder() diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/application.properties b/samples/server/petstore/springboot-delegate/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-delegate/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-delegate/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-delegate/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 6d8d3656155a..32fdc6a9409b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -16,6 +16,7 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -66,3 +67,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-implicitHeaders/README.md b/samples/server/petstore/springboot-implicitHeaders/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/README.md +++ b/samples/server/petstore/springboot-implicitHeaders/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/pom.xml b/samples/server/petstore/springboot-implicitHeaders/pom.xml index 28802bac5446..4eb9521783fb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/server/petstore/springboot-implicitHeaders/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java new file mode 100644 index 000000000000..e05217a98f21 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -0,0 +1,71 @@ +package org.openapitools.configuration; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import org.springframework.web.util.UriComponentsBuilder; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.paths.Paths; +import springfox.documentation.spring.web.paths.RelativePathProvider; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import javax.annotation.Generated; +import javax.servlet.ServletContext; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Configuration +@EnableSwagger2 +public class SpringFoxConfiguration { + + ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("OpenAPI Petstore") + .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: \" \\") + .license("Apache-2.0") + .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") + .termsOfServiceUrl("") + .version("1.0.0") + .contact(new Contact("","", "")) + .build(); + } + + @Bean + public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) + .build() + .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) + .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) + .apiInfo(apiInfo()); + } + + class BasePathAwareRelativePathProvider extends RelativePathProvider { + private String basePath; + + public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { + super(servletContext); + this.basePath = basePath; + } + + @Override + protected String applicationPath() { + return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); + } + + @Override + public String getOperationPath(String operationPath) { + UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); + return Paths.removeAdjacentForwardSlashes( + uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); + } + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES index bd5a0e2c0574..b552438ed416 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -72,3 +72,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-reactive/README.md b/samples/server/petstore/springboot-reactive/README.md index b890fea09364..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-reactive/README.md +++ b/samples/server/petstore/springboot-reactive/README.md @@ -2,14 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application +You can view the api documentation in swagger-ui by pointing to +http://localhost:80/swagger-ui.html + Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/pom.xml b/samples/server/petstore/springboot-reactive/pom.xml index d543d7100354..82331f68fade 100644 --- a/samples/server/petstore/springboot-reactive/pom.xml +++ b/samples/server/petstore/springboot-reactive/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index a7a2c4e7dc40..000000000000 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.reactive.config.CorsRegistry; -import org.springframework.web.reactive.config.WebFluxConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebFluxConfigurer webConfigurer() { - return new WebFluxConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java index 60a69461eb5e..f8f80d182c2d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,11 +1,12 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.reactive.function.server.RouterFunction; import org.springframework.web.reactive.function.server.ServerResponse; - import java.net.URI; import static org.springframework.web.reactive.function.server.RequestPredicates.GET; @@ -17,6 +18,14 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @Bean RouterFunction index() { return route( @@ -25,5 +34,4 @@ RouterFunction index() { ); } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/application.properties b/samples/server/petstore/springboot-reactive/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-reactive/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-reactive/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-reactive/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES index e5358dc21c32..cfad6877d8e0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -22,6 +22,7 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -70,3 +71,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/README.md b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/README.md +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml index 89983aadb0cb..b2370f3735bd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 92b110be6b43..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("OpenAPI Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .directModelSubstitute(org.threeten.bp.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(org.threeten.bp.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java similarity index 95% rename from samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename to samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java index 9699acc41f4a..ae31b200b2d6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -15,12 +15,13 @@ import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; +import javax.annotation.Generated; import javax.servlet.ServletContext; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @EnableSwagger2 -public class OpenAPIDocumentationConfig { +public class SpringFoxConfiguration { ApiInfo apiInfo() { return new ApiInfoBuilder() diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/application.properties b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES index e5358dc21c32..cfad6877d8e0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -22,6 +22,7 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -70,3 +71,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/README.md b/samples/server/petstore/springboot-spring-pageable-delegatePattern/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/README.md +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml index a5ac06132f25..4f5bf99caac8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java similarity index 95% rename from samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename to samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java index 9699acc41f4a..ae31b200b2d6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -15,12 +15,13 @@ import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; +import javax.annotation.Generated; import javax.servlet.ServletContext; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @EnableSwagger2 -public class OpenAPIDocumentationConfig { +public class SpringFoxConfiguration { ApiInfo apiInfo() { return new ApiInfoBuilder() diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/application.properties b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES index 2218b36d761c..2696c0211eb9 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -16,6 +16,7 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +65,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/README.md b/samples/server/petstore/springboot-spring-pageable-without-j8/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/README.md +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml index 286b606d5e3e..867882c6ffb4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 92b110be6b43..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("OpenAPI Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .directModelSubstitute(org.threeten.bp.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(org.threeten.bp.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java new file mode 100644 index 000000000000..ae31b200b2d6 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -0,0 +1,71 @@ +package org.openapitools.configuration; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import org.springframework.web.util.UriComponentsBuilder; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.paths.Paths; +import springfox.documentation.spring.web.paths.RelativePathProvider; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import javax.annotation.Generated; +import javax.servlet.ServletContext; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Configuration +@EnableSwagger2 +public class SpringFoxConfiguration { + + ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("OpenAPI Petstore") + .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: \" \\") + .license("Apache-2.0") + .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") + .termsOfServiceUrl("") + .version("1.0.0") + .contact(new Contact("","", "")) + .build(); + } + + @Bean + public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) + .build() + .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) + .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) + .apiInfo(apiInfo()); + } + + class BasePathAwareRelativePathProvider extends RelativePathProvider { + private String basePath; + + public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { + super(servletContext); + this.basePath = basePath; + } + + @Override + protected String applicationPath() { + return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); + } + + @Override + public String getOperationPath(String operationPath) { + UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); + return Paths.removeAdjacentForwardSlashes( + uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); + } + } + +} diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/application.properties b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES index 2218b36d761c..2696c0211eb9 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -16,6 +16,7 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +65,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-spring-pageable/README.md b/samples/server/petstore/springboot-spring-pageable/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-spring-pageable/README.md +++ b/samples/server/petstore/springboot-spring-pageable/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable/pom.xml b/samples/server/petstore/springboot-spring-pageable/pom.xml index d0b710969509..1730c842d41d 100644 --- a/samples/server/petstore/springboot-spring-pageable/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java new file mode 100644 index 000000000000..ae31b200b2d6 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -0,0 +1,71 @@ +package org.openapitools.configuration; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import org.springframework.web.util.UriComponentsBuilder; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.paths.Paths; +import springfox.documentation.spring.web.paths.RelativePathProvider; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import javax.annotation.Generated; +import javax.servlet.ServletContext; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Configuration +@EnableSwagger2 +public class SpringFoxConfiguration { + + ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("OpenAPI Petstore") + .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: \" \\") + .license("Apache-2.0") + .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") + .termsOfServiceUrl("") + .version("1.0.0") + .contact(new Contact("","", "")) + .build(); + } + + @Bean + public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) + .build() + .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) + .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) + .apiInfo(apiInfo()); + } + + class BasePathAwareRelativePathProvider extends RelativePathProvider { + private String basePath; + + public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { + super(servletContext); + this.basePath = basePath; + } + + @Override + protected String applicationPath() { + return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); + } + + @Override + public String getOperationPath(String operationPath) { + UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); + return Paths.removeAdjacentForwardSlashes( + uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); + } + } + +} diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/resources/application.properties b/samples/server/petstore/springboot-spring-pageable/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-spring-pageable/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-spring-pageable/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-spring-pageable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-spring-pageable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES index 6d8d3656155a..32fdc6a9409b 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -16,6 +16,7 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -66,3 +67,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-useoptional/README.md b/samples/server/petstore/springboot-useoptional/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot-useoptional/README.md +++ b/samples/server/petstore/springboot-useoptional/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/pom.xml b/samples/server/petstore/springboot-useoptional/pom.xml index 947ef54fb7eb..9fe155a89ef6 100644 --- a/samples/server/petstore/springboot-useoptional/pom.xml +++ b/samples/server/petstore/springboot-useoptional/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java similarity index 95% rename from samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename to samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java index f5a755245da8..77674f29d63f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -16,12 +16,13 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.util.Optional; +import javax.annotation.Generated; import javax.servlet.ServletContext; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @EnableSwagger2 -public class OpenAPIDocumentationConfig { +public class SpringFoxConfiguration { ApiInfo apiInfo() { return new ApiInfoBuilder() diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/application.properties b/samples/server/petstore/springboot-useoptional/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-useoptional/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES index e8f7235942a3..b0c2d3753d48 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES @@ -1,8 +1,9 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java src/main/java/org/openapitools/virtualan/api/ApiUtil.java @@ -66,3 +67,5 @@ src/main/java/org/openapitools/virtualan/model/User.java src/main/java/org/openapitools/virtualan/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-virtualan/README.md b/samples/server/petstore/springboot-virtualan/README.md index 0fb4c3ae6dd0..c32bb08d6e9c 100644 --- a/samples/server/petstore/springboot-virtualan/README.md +++ b/samples/server/petstore/springboot-virtualan/README.md @@ -2,18 +2,27 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties diff --git a/samples/server/petstore/springboot-virtualan/pom.xml b/samples/server/petstore/springboot-virtualan/pom.xml index dd52e11911b6..a4ef47f47a25 100644 --- a/samples/server/petstore/springboot-virtualan/pom.xml +++ b/samples/server/petstore/springboot-virtualan/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -81,5 +91,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index e1b26241e6fa..000000000000 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.virtualan.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..2610b90e6393 --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.virtualan.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java similarity index 95% rename from samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java rename to samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java index 7bdd11028aaf..7fd7bc22fdaa 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -15,12 +15,13 @@ import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; +import javax.annotation.Generated; import javax.servlet.ServletContext; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @EnableSwagger2 -public class OpenAPIDocumentationConfig { +public class SpringFoxConfiguration { ApiInfo apiInfo() { return new ApiInfoBuilder() diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/application.properties b/samples/server/petstore/springboot-virtualan/src/main/resources/application.properties index 64073b52f1eb..6b2d0e49e76e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-virtualan/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot-virtualan/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-virtualan/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES index 6d8d3656155a..32fdc6a9409b 100644 --- a/samples/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/server/petstore/springboot/.openapi-generator/FILES @@ -1,6 +1,6 @@ README.md pom.xml -src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -16,6 +16,7 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -66,3 +67,5 @@ src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot/README.md b/samples/server/petstore/springboot/README.md index 8b9e02180fec..6721bbc28ca4 100644 --- a/samples/server/petstore/springboot/README.md +++ b/samples/server/petstore/springboot/README.md @@ -2,17 +2,26 @@ Spring Boot Server - ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to -http://localhost:80/ +http://localhost:80/swagger-ui.html Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot/pom.xml b/samples/server/petstore/springboot/pom.xml index 2388f8831b10..8f13b41001d1 100644 --- a/samples/server/petstore/springboot/pom.xml +++ b/samples/server/petstore/springboot/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.9.2 + 4.4.1-1 org.springframework.boot @@ -40,6 +41,15 @@ springfox-swagger2 ${springfox.version} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + com.google.code.findbugs @@ -68,5 +78,10 @@ com.fasterxml.jackson.core jackson-databind + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java deleted file mode 100644 index 7cad28eed8ac..000000000000 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@SpringBootApplication -@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) -public class OpenAPI2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(OpenAPI2SpringBoot.class).run(args); - } - - static class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } - - @Bean - public WebMvcConfigurer webConfigurer() { - return new WebMvcConfigurer() { - /*@Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("Content-Type"); - }*/ - }; - } - - @Bean - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f62fd6d91797 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,23 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java index 25727830541b..e390f86f5b73 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,10 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; /** * Home redirection to OpenAPI api documentation @@ -10,10 +12,17 @@ @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; } - -} +} \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java deleted file mode 100644 index 589dd7dc5e7f..000000000000 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import org.springframework.web.util.UriComponentsBuilder; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.paths.Paths; -import springfox.documentation.spring.web.paths.RelativePathProvider; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.servlet.ServletContext; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Configuration -@EnableSwagger2 -public class OpenAPIDocumentationConfig { - - ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("OpenAPI Petstore") - .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: \" \\") - .license("Apache-2.0") - .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") - .termsOfServiceUrl("") - .version("1.0.0") - .contact(new Contact("","", "")) - .build(); - } - - @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) - .build() - .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) - .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) - .apiInfo(apiInfo()); - } - - class BasePathAwareRelativePathProvider extends RelativePathProvider { - private String basePath; - - public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { - super(servletContext); - this.basePath = basePath; - } - - @Override - protected String applicationPath() { - return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); - } - - @Override - public String getOperationPath(String operationPath) { - UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); - return Paths.removeAdjacentForwardSlashes( - uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); - } - } - -} diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java new file mode 100644 index 000000000000..e05217a98f21 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -0,0 +1,71 @@ +package org.openapitools.configuration; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import org.springframework.web.util.UriComponentsBuilder; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.paths.Paths; +import springfox.documentation.spring.web.paths.RelativePathProvider; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import javax.annotation.Generated; +import javax.servlet.ServletContext; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Configuration +@EnableSwagger2 +public class SpringFoxConfiguration { + + ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("OpenAPI Petstore") + .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: \" \\") + .license("Apache-2.0") + .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") + .termsOfServiceUrl("") + .version("1.0.0") + .contact(new Contact("","", "")) + .build(); + } + + @Bean + public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) + .build() + .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) + .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) + .apiInfo(apiInfo()); + } + + class BasePathAwareRelativePathProvider extends RelativePathProvider { + private String basePath; + + public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { + super(servletContext); + this.basePath = basePath; + } + + @Override + protected String applicationPath() { + return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); + } + + @Override + public String getOperationPath(String operationPath) { + UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); + return Paths.removeAdjacentForwardSlashes( + uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); + } + } + +} diff --git a/samples/server/petstore/springboot/src/main/resources/application.properties b/samples/server/petstore/springboot/src/main/resources/application.properties index ceca4a9e0d05..9d06609db665 100644 --- a/samples/server/petstore/springboot/src/main/resources/application.properties +++ b/samples/server/petstore/springboot/src/main/resources/application.properties @@ -1,4 +1,3 @@ -springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file From cefe7fb56073d0e79d83826e7255b9ca1c99add7 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 12 Feb 2022 17:43:10 +0800 Subject: [PATCH 046/111] [Scala] test Scala clients, servers in GitHub workflow (#11592) * add samples/server/petstore/spring-boot-nullable-set to github workflow * add github workflow to test scala clients and servers * trigger build * remove module * trigger build * test with jdk8 * trigger build * test with jdk11 * clean up pom.xml * remove groovy from pom.xml * update samples --- .github/workflows/samples-scala.yaml | 44 ++++++++++++++++++++++++++++ pom.xml | 20 ------------- 2 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/samples-scala.yaml diff --git a/.github/workflows/samples-scala.yaml b/.github/workflows/samples-scala.yaml new file mode 100644 index 000000000000..ca908a8e8427 --- /dev/null +++ b/.github/workflows/samples-scala.yaml @@ -0,0 +1,44 @@ +name: Samples Scala + +on: + push: + paths: + - 'samples/client/petstore/scala**' + - 'samples/server/petstore/scala**' + pull_request: + paths: + - 'samples/client/petstore/scala**' + - 'samples/server/petstore/scala**' +jobs: + build: + name: Build Scala client, servers + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/client/petstore/scalaz + # servers + - samples/server/petstore/scala-lagom-server + - samples/server/petstore/scala-play-server + - samples/server/petstore/scala-akka-http-server + - samples/server/petstore/scalatra + - samples/server/petstore/scala-finch # cannot be tested with jdk11 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 8 + - name: Cache maven dependencies + uses: actions/cache@v2.1.7 + env: + cache-name: maven-repository + with: + path: | + ~/.ivy2 + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/build.sbt') }} + - name: Build and test + working-directory: ${{ matrix.sample }} + run: sbt -v +test diff --git a/pom.xml b/pom.xml index d719aa806de4..f3100a44e1a5 100644 --- a/pom.xml +++ b/pom.xml @@ -1084,18 +1084,6 @@ samples/server/petstore/springboot-virtualan - - scalatra-server - - - env - java - - - - samples/server/petstore/scalatra - - java-inflector @@ -1228,11 +1216,6 @@ samples/server/petstore/jaxrs-cxf-cdi-default-value samples/server/petstore/jaxrs-cxf-non-spring-app samples/server/petstore/java-msf4j - samples/server/petstore/scala-lagom-server - samples/server/petstore/scala-play-server - samples/server/petstore/scala-akka-http-server - samples/server/petstore/scalatra - samples/server/petstore/scala-finch @@ -1318,12 +1301,9 @@ - samples/client/petstore/scala-akka samples/client/petstore/scala-sttp samples/client/petstore/scala-httpclient - samples/client/petstore/scalaz samples/client/petstore/clojure samples/client/petstore/java/feign samples/client/petstore/java/jersey1 From 51a75c5481260ce0ef15b8f094ec256c68ac1dfa Mon Sep 17 00:00:00 2001 From: Akhil Nair <36164259+the-akhil-nair@users.noreply.github.com> Date: Sun, 13 Feb 2022 14:20:27 +0530 Subject: [PATCH 047/111] [go_pbv_pbr_issue] (#11466) There was a difference in logic for Unmarshalling the JSON. The new logic is re-used here. --- .../src/main/resources/go/model_simple.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/go/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache index feeefee88752..187abbffe9ff 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -314,7 +314,7 @@ func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { {{#deprecated}} // Deprecated {{/deprecated}} - {{name}} {{^required}}{{^isNullable}}*{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` + {{name}} {{^required}}{{^isNullable}}{{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` {{/vars}} } From d481aa3af42c65d786550685c26f7f6ffa0100ba Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 13 Feb 2022 19:23:11 +0800 Subject: [PATCH 048/111] Test Java Play framework in Github action (#11598) * test play framework in github action * trigger build * add pom.xml * revert readme --- .../samples-java-play-framework.yaml | 47 +++++++++++++++++++ pom.xml | 9 ---- .../java-play-framework-async/pom.xml | 46 ++++++++++++++++++ .../pom.xml | 46 ++++++++++++++++++ .../java-play-framework-no-nullable/pom.xml | 46 ++++++++++++++++++ 5 files changed, 185 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/samples-java-play-framework.yaml create mode 100644 samples/server/petstore/java-play-framework-async/pom.xml create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints-with-security/pom.xml create mode 100644 samples/server/petstore/java-play-framework-no-nullable/pom.xml diff --git a/.github/workflows/samples-java-play-framework.yaml b/.github/workflows/samples-java-play-framework.yaml new file mode 100644 index 000000000000..cd4f4ec9c26a --- /dev/null +++ b/.github/workflows/samples-java-play-framework.yaml @@ -0,0 +1,47 @@ +name: Samples Java Play Framework + +on: + push: + paths: + - 'samples/server/petstore/java-play-framework**' + pull_request: + paths: + - 'samples/server/petstore/java-play-framework**' +jobs: + build: + name: Build Java Play Framework + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # servers + - samples/server/petstore/java-play-framework + - samples/server/petstore/java-play-framework-api-package-override + - samples/server/petstore/java-play-framework-async + - samples/server/petstore/java-play-framework-controller-only + - samples/server/petstore/java-play-framework-fake-endpoints + - samples/server/petstore/java-play-framework-fake-endpoints-with-security + - samples/server/petstore/java-play-framework-no-bean-validation + - samples/server/petstore/java-play-framework-no-exception-handling + - samples/server/petstore/java-play-framework-no-interface + - samples/server/petstore/java-play-framework-no-nullable + - samples/server/petstore/java-play-framework-no-swagger-ui + - samples/server/petstore/java-play-framework-no-wrap-calls + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 11 + - name: Cache maven dependencies + uses: actions/cache@v2.1.7 + env: + cache-name: maven-repository + with: + path: | + ~/.m2 + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Build + working-directory: ${{ matrix.sample }} + run: mvn clean package diff --git a/pom.xml b/pom.xml index f3100a44e1a5..ea7314f1dc48 100644 --- a/pom.xml +++ b/pom.xml @@ -1171,15 +1171,6 @@ samples/server/petstore/java-vertx-web samples/server/petstore/java-inflector samples/server/petstore/java-pkmst - samples/server/petstore/java-play-framework - samples/server/petstore/java-play-framework-no-wrap-calls - samples/server/petstore/java-play-framework-no-swagger-ui - samples/server/petstore/java-play-framework-no-interface - samples/server/petstore/java-play-framework-no-exception-handling - samples/server/petstore/java-play-framework-no-bean-validation - samples/server/petstore/java-play-framework-fake-endpoints - samples/server/petstore/java-play-framework-controller-only - samples/server/petstore/java-play-framework-api-package-override samples/server/petstore/java-undertow samples/server/petstore/jaxrs/jersey1 samples/server/petstore/jaxrs/jersey1-useTags diff --git a/samples/server/petstore/java-play-framework-async/pom.xml b/samples/server/petstore/java-play-framework-async/pom.xml new file mode 100644 index 000000000000..4cc96145a593 --- /dev/null +++ b/samples/server/petstore/java-play-framework-async/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PlayServerTests-async + pom + 1.0-SNAPSHOT + java-play-framework-async + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + Play Test + integration-test + + exec + + + sbt + + test + + + + + + + + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints-with-security/pom.xml b/samples/server/petstore/java-play-framework-fake-endpoints-with-security/pom.xml new file mode 100644 index 000000000000..bb67ed9ca392 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints-with-security/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PlayServerTests-with-security + pom + 1.0-SNAPSHOT + java-play-framework-with-security Project + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + Play Test + integration-test + + exec + + + sbt + + test + + + + + + + + diff --git a/samples/server/petstore/java-play-framework-no-nullable/pom.xml b/samples/server/petstore/java-play-framework-no-nullable/pom.xml new file mode 100644 index 000000000000..f67248a335ea --- /dev/null +++ b/samples/server/petstore/java-play-framework-no-nullable/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PlayServerTests-no-nullable + pom + 1.0-SNAPSHOT + java-play-framework-no-nullable Project + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + Play Test + integration-test + + exec + + + gradle + + test + + + + + + + + From 896504de517daeb6d2af37ce64a891dc2281e5ae Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 13 Feb 2022 19:23:57 +0800 Subject: [PATCH 049/111] Test Java (native) client in JDK 11 (#11599) * test java native client in jdk11 * test java natvie async * remove java native from pom.xml * revert changes --- .../workflows/samples-java-client-jdk11.yaml | 37 +++++++++++++++++++ pom.xml | 14 ------- 2 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/samples-java-client-jdk11.yaml diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml new file mode 100644 index 000000000000..ba45ec604483 --- /dev/null +++ b/.github/workflows/samples-java-client-jdk11.yaml @@ -0,0 +1,37 @@ +name: Samples Java Client JDK11 + +on: + push: + paths: + - 'samples/client/petstore/java/native**' + pull_request: + paths: + - 'samples/client/petstore/java/native**' +jobs: + build: + name: Build Java Client JDK11 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/client/petstore/java/native + - samples/client/petstore/java/native-async + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 11 + - name: Cache maven dependencies + uses: actions/cache@v2.1.7 + env: + cache-name: maven-repository + with: + path: | + ~/.m2 + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Build + working-directory: ${{ matrix.sample }} + run: mvn clean package diff --git a/pom.xml b/pom.xml index ea7314f1dc48..fb5c330ba433 100644 --- a/pom.xml +++ b/pom.xml @@ -1357,20 +1357,6 @@ - - - samples.droneio - - - env - samples.droneio - - - - - samples/client/petstore/java/native - - samples.misc From 2584c9d99d2c09e3d7ee70e3908cbdca9d1568a2 Mon Sep 17 00:00:00 2001 From: upachler Date: Mon, 14 Feb 2022 03:54:32 +0100 Subject: [PATCH 050/111] add fromString() method to enums as required by JAX RS spec (#7494) --- .../resources/JavaJaxRS/spec/enumClass.mustache | 15 +++++++++++++++ .../JavaJaxRS/spec/enumOuterClass.mustache | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache index 4b1114571539..c19448afb85d 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache @@ -21,6 +21,21 @@ return String.valueOf(value); } + /** + * Convert a String into {{dataType}}, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static {{datatypeWithEnum}} fromString(String s) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected string value '" + s + "'");{{/isNullable}} + } + @JsonCreator public static {{datatypeWithEnum}} fromValue({{dataType}} value) { for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache index 66f6745ff9fd..9489711c57c6 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache @@ -25,6 +25,21 @@ import com.fasterxml.jackson.annotation.JsonValue; this.value = value; } + /** + * Convert a String into {{dataType}}, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromString(String s) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected string value '" + s + "'");{{/isNullable}} + } + @Override @JsonValue public String toString() { From 73ed74381894d9173e5d3978fa3eb6b95ee0b57e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 14 Feb 2022 10:57:13 +0800 Subject: [PATCH 051/111] update samples --- .../java/org/openapitools/model/BigCat.java | 15 +++++ .../org/openapitools/model/BigCatAllOf.java | 15 +++++ .../org/openapitools/model/EnumArrays.java | 30 ++++++++++ .../org/openapitools/model/EnumClass.java | 15 +++++ .../java/org/openapitools/model/EnumTest.java | 60 +++++++++++++++++++ .../java/org/openapitools/model/MapTest.java | 15 +++++ .../java/org/openapitools/model/Order.java | 15 +++++ .../org/openapitools/model/OuterEnum.java | 15 +++++ .../gen/java/org/openapitools/model/Pet.java | 15 +++++ .../java/org/openapitools/model/BigCat.java | 15 +++++ .../org/openapitools/model/BigCatAllOf.java | 15 +++++ .../org/openapitools/model/EnumArrays.java | 30 ++++++++++ .../org/openapitools/model/EnumClass.java | 15 +++++ .../java/org/openapitools/model/EnumTest.java | 60 +++++++++++++++++++ .../java/org/openapitools/model/MapTest.java | 15 +++++ .../java/org/openapitools/model/Order.java | 15 +++++ .../org/openapitools/model/OuterEnum.java | 15 +++++ .../gen/java/org/openapitools/model/Pet.java | 15 +++++ 18 files changed, 390 insertions(+) diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java index 483c60b3d06e..38fc63872812 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java @@ -42,6 +42,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static KindEnum fromString(String s) { + for (KindEnum b : KindEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static KindEnum fromValue(String value) { for (KindEnum b : KindEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java index 7ba1d7c23fcb..e40f222f1675 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -41,6 +41,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static KindEnum fromString(String s) { + for (KindEnum b : KindEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static KindEnum fromValue(String value) { for (KindEnum b : KindEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java index 502d24d9bce4..81e5bfed4780 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java @@ -42,6 +42,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static JustSymbolEnum fromString(String s) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { @@ -76,6 +91,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static ArrayEnumEnum fromString(String s) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumClass.java index 64c669177148..778c1dfb9524 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumClass.java @@ -24,6 +24,21 @@ public enum EnumClass { this.value = value; } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumClass fromString(String s) { + for (EnumClass b : EnumClass.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @Override @JsonValue public String toString() { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java index af7ac236efe4..881e2503a6df 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java @@ -42,6 +42,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringEnum fromString(String s) { + for (EnumStringEnum b : EnumStringEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { @@ -76,6 +91,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringRequiredEnum fromString(String s) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { @@ -110,6 +140,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumIntegerEnum fromString(String s) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { @@ -144,6 +189,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into Double, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumNumberEnum fromString(String s) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java index 8d5dece7fbba..9687a74280e6 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java @@ -44,6 +44,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static InnerEnum fromString(String s) { + for (InnerEnum b : InnerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Order.java index e67d3772f9de..2e4317801c05 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Order.java @@ -45,6 +45,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/OuterEnum.java index fbd86c9bdbe1..131a96d2ceba 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/OuterEnum.java @@ -24,6 +24,21 @@ public enum OuterEnum { this.value = value; } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnum fromString(String s) { + for (OuterEnum b : OuterEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @Override @JsonValue public String toString() { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java index 8ec79b936c8d..bbefddb2c48d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java @@ -52,6 +52,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java index 483c60b3d06e..38fc63872812 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java @@ -42,6 +42,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static KindEnum fromString(String s) { + for (KindEnum b : KindEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static KindEnum fromValue(String value) { for (KindEnum b : KindEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java index 7ba1d7c23fcb..e40f222f1675 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -41,6 +41,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static KindEnum fromString(String s) { + for (KindEnum b : KindEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static KindEnum fromValue(String value) { for (KindEnum b : KindEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java index 502d24d9bce4..81e5bfed4780 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java @@ -42,6 +42,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static JustSymbolEnum fromString(String s) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { @@ -76,6 +91,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static ArrayEnumEnum fromString(String s) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumClass.java index 64c669177148..778c1dfb9524 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumClass.java @@ -24,6 +24,21 @@ public enum EnumClass { this.value = value; } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumClass fromString(String s) { + for (EnumClass b : EnumClass.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @Override @JsonValue public String toString() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java index af7ac236efe4..881e2503a6df 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java @@ -42,6 +42,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringEnum fromString(String s) { + for (EnumStringEnum b : EnumStringEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { @@ -76,6 +91,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringRequiredEnum fromString(String s) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { @@ -110,6 +140,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumIntegerEnum fromString(String s) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { @@ -144,6 +189,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into Double, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumNumberEnum fromString(String s) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java index 8d5dece7fbba..9687a74280e6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java @@ -44,6 +44,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static InnerEnum fromString(String s) { + for (InnerEnum b : InnerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Order.java index e67d3772f9de..2e4317801c05 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Order.java @@ -45,6 +45,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java index fbd86c9bdbe1..131a96d2ceba 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java @@ -24,6 +24,21 @@ public enum OuterEnum { this.value = value; } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnum fromString(String s) { + for (OuterEnum b : OuterEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @Override @JsonValue public String toString() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java index 8ec79b936c8d..bbefddb2c48d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java @@ -52,6 +52,21 @@ public String toString() { return String.valueOf(value); } + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + @JsonCreator public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { From c937bae8881d205966508fb1a30669ec7ed151a1 Mon Sep 17 00:00:00 2001 From: Marek Hudik Date: Mon, 14 Feb 2022 03:59:11 +0100 Subject: [PATCH 052/111] fixes #11579: Java RestTemplate Mustache template doesn't use reserved words for local variables (#11583) * fixes #11579: Java RestTemplate Mustache template doesn't use reserved words for local variables * fixes #11579: Java RestTemplate samples Co-authored-by: Marek Hudik --- .../Java/libraries/resttemplate/api.mustache | 28 +- .../client/api/AnotherFakeApi.java | 20 +- .../org/openapitools/client/api/FakeApi.java | 352 +++++++++--------- .../client/api/FakeClassnameTags123Api.java | 20 +- .../org/openapitools/client/api/PetApi.java | 198 +++++----- .../org/openapitools/client/api/StoreApi.java | 80 ++-- .../org/openapitools/client/api/UserApi.java | 164 ++++---- .../client/api/AnotherFakeApi.java | 20 +- .../org/openapitools/client/api/FakeApi.java | 352 +++++++++--------- .../client/api/FakeClassnameTags123Api.java | 20 +- .../org/openapitools/client/api/PetApi.java | 198 +++++----- .../org/openapitools/client/api/StoreApi.java | 80 ++-- .../org/openapitools/client/api/UserApi.java | 164 ++++---- 13 files changed, 848 insertions(+), 848 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index cc207bd1b564..234288394ab0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -106,7 +106,7 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public ResponseEntity<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { - Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { @@ -117,39 +117,39 @@ public class {{classname}} { final Map uriVariables = new HashMap();{{#pathParams}} uriVariables.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase()), {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}});{{/pathParams}}{{/hasPathParams}} - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap();{{#hasQueryParams}} + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap();{{#hasQueryParams}} - {{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}} + {{#queryParams}}localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}} {{/-last}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} {{#headerParams}}if ({{paramName}} != null) - headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + localVarHeaderParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} {{/-last}}{{/headerParams}}{{/hasHeaderParams}}{{#hasCookieParams}} {{#cookieParams}}if ({{paramName}} != null) - cookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + localVarCookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} {{/-last}}{{/cookieParams}}{{/hasCookieParams}}{{#hasFormParams}} {{#formParams}}if ({{paramName}} != null) - formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{^-last}} + localVarFormParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{^-last}} {{/-last}}{{/formParams}}{{/hasFormParams}} final String[] localVarAccepts = { {{#hasProduces}} {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} {{/hasProduces}} }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { {{#hasConsumes}} + final String[] localVarContentTypes = { {{#hasConsumes}} {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} {{/hasConsumes}} }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - {{#returnType}}ParameterizedTypeReference<{{{returnType}}}> returnType = new ParameterizedTypeReference<{{{returnType}}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};{{/returnType}} - return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.emptyMap(){{/hasPathParams}}, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + {{#returnType}}ParameterizedTypeReference<{{{returnType}}}> localReturnType = new ParameterizedTypeReference<{{{returnType}}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};{{/returnType}} + return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.emptyMap(){{/hasPathParams}}, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } {{/operation}} } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 4d2183737b57..67aa8844f17b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -68,7 +68,7 @@ public Client call123testSpecialTags(Client body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity call123testSpecialTagsWithHttpInfo(Client body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -76,23 +76,23 @@ public ResponseEntity call123testSpecialTagsWithHttpInfo(Client body) th } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index d82e43ff8754..1fcb8328c73c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -75,7 +75,7 @@ public void createXmlItem(XmlItem xmlItem) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity createXmlItemWithHttpInfo(XmlItem xmlItem) throws RestClientException { - Object postBody = xmlItem; + Object localVarPostBody = xmlItem; // verify the required parameter 'xmlItem' is set if (xmlItem == null) { @@ -83,22 +83,22 @@ public ResponseEntity createXmlItemWithHttpInfo(XmlItem xmlItem) throws Re } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/create_xml_item", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/create_xml_item", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -121,25 +121,25 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientExceptio * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "*/*" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -162,25 +162,25 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Re * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "*/*" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -203,25 +203,25 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientExc * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "*/*" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -244,25 +244,25 @@ public String fakeOuterStringSerialize(String body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity fakeOuterStringSerializeWithHttpInfo(String body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "*/*" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -284,7 +284,7 @@ public void testBodyWithFileSchema(FileSchemaTestClass body) throws RestClientEx * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -292,22 +292,22 @@ public ResponseEntity testBodyWithFileSchemaWithHttpInfo(FileSchemaTestCla } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -331,7 +331,7 @@ public void testBodyWithQueryParams(String query, User body) throws RestClientEx * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testBodyWithQueryParamsWithHttpInfo(String query, User body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'query' is set if (query == null) { @@ -344,24 +344,24 @@ public ResponseEntity testBodyWithQueryParamsWithHttpInfo(String query, Us } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * To test \"client\" model @@ -384,7 +384,7 @@ public Client testClientModel(Client body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testClientModelWithHttpInfo(Client body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -392,24 +392,24 @@ public ResponseEntity testClientModelWithHttpInfo(Client body) throws Re } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake", HttpMethod.PATCH, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake", HttpMethod.PATCH, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -459,7 +459,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -482,51 +482,51 @@ public ResponseEntity testEndpointParametersWithHttpInfo(BigDecimal number } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (integer != null) - formParams.add("integer", integer); + localVarFormParams.add("integer", integer); if (int32 != null) - formParams.add("int32", int32); + localVarFormParams.add("int32", int32); if (int64 != null) - formParams.add("int64", int64); + localVarFormParams.add("int64", int64); if (number != null) - formParams.add("number", number); + localVarFormParams.add("number", number); if (_float != null) - formParams.add("float", _float); + localVarFormParams.add("float", _float); if (_double != null) - formParams.add("double", _double); + localVarFormParams.add("double", _double); if (string != null) - formParams.add("string", string); + localVarFormParams.add("string", string); if (patternWithoutDelimiter != null) - formParams.add("pattern_without_delimiter", patternWithoutDelimiter); + localVarFormParams.add("pattern_without_delimiter", patternWithoutDelimiter); if (_byte != null) - formParams.add("byte", _byte); + localVarFormParams.add("byte", _byte); if (binary != null) - formParams.add("binary", new FileSystemResource(binary)); + localVarFormParams.add("binary", new FileSystemResource(binary)); if (date != null) - formParams.add("date", date); + localVarFormParams.add("date", date); if (dateTime != null) - formParams.add("dateTime", dateTime); + localVarFormParams.add("dateTime", dateTime); if (password != null) - formParams.add("password", password); + localVarFormParams.add("password", password); if (paramCallback != null) - formParams.add("callback", paramCallback); + localVarFormParams.add("callback", paramCallback); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "http_basic_test" }; + String[] localVarAuthNames = new String[] { "http_basic_test" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * To test enum parameters @@ -564,40 +564,40 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "enum_query_string_array", enumQueryStringArray)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_double", enumQueryDouble)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_double", enumQueryDouble)); if (enumHeaderStringArray != null) - headerParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); + localVarHeaderParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); if (enumHeaderString != null) - headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); + localVarHeaderParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); if (enumFormStringArray != null) - formParams.addAll("enum_form_string_array", enumFormStringArray); + localVarFormParams.addAll("enum_form_string_array", enumFormStringArray); if (enumFormString != null) - formParams.add("enum_form_string", enumFormString); + localVarFormParams.add("enum_form_string", enumFormString); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Fake endpoint to test group parameters (optional) @@ -629,7 +629,7 @@ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBoo * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -647,30 +647,30 @@ public ResponseEntity testGroupParametersWithHttpInfo(Integer requiredStri } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_string_group", requiredStringGroup)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_int64_group", requiredInt64Group)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "string_group", stringGroup)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "int64_group", int64Group)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_string_group", requiredStringGroup)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_int64_group", requiredInt64Group)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "string_group", stringGroup)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "int64_group", int64Group)); if (requiredBooleanGroup != null) - headerParams.add("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + localVarHeaderParams.add("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); if (booleanGroup != null) - headerParams.add("boolean_group", apiClient.parameterToString(booleanGroup)); + localVarHeaderParams.add("boolean_group", apiClient.parameterToString(booleanGroup)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake", HttpMethod.DELETE, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake", HttpMethod.DELETE, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * test inline additionalProperties @@ -692,7 +692,7 @@ public void testInlineAdditionalProperties(Map param) throws Res * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testInlineAdditionalPropertiesWithHttpInfo(Map param) throws RestClientException { - Object postBody = param; + Object localVarPostBody = param; // verify the required parameter 'param' is set if (param == null) { @@ -700,22 +700,22 @@ public ResponseEntity testInlineAdditionalPropertiesWithHttpInfo(Map queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * test json serialization of form data @@ -739,7 +739,7 @@ public void testJsonFormData(String param, String param2) throws RestClientExcep * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testJsonFormDataWithHttpInfo(String param, String param2) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -752,27 +752,27 @@ public ResponseEntity testJsonFormDataWithHttpInfo(String param, String pa } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (param != null) - formParams.add("param", param); + localVarFormParams.add("param", param); if (param2 != null) - formParams.add("param2", param2); + localVarFormParams.add("param2", param2); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -802,7 +802,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'pipe' is set if (pipe == null) { @@ -830,25 +830,25 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/test-query-parameters", HttpMethod.PUT, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/test-query-parameters", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 90564f107af7..eebf656bb5c1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -68,7 +68,7 @@ public Client testClassname(Client body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testClassnameWithHttpInfo(Client body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -76,23 +76,23 @@ public ResponseEntity testClassnameWithHttpInfo(Client body) throws Rest } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "api_key_query" }; + String[] localVarAuthNames = new String[] { "api_key_query" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java index 00ad400d64bc..2d26052eb288 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java @@ -72,7 +72,7 @@ public void addPet(Pet body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity addPetWithHttpInfo(Pet body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -80,22 +80,22 @@ public ResponseEntity addPetWithHttpInfo(Pet body) throws RestClientExcept } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json", "application/xml" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Deletes a pet @@ -121,7 +121,7 @@ public void deletePet(Long petId, String apiKey) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity deletePetWithHttpInfo(Long petId, String apiKey) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -132,23 +132,23 @@ public ResponseEntity deletePetWithHttpInfo(Long petId, String apiKey) thr final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (apiKey != null) - headerParams.add("api_key", apiClient.parameterToString(apiKey)); + localVarHeaderParams.add("api_key", apiClient.parameterToString(apiKey)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Finds Pets by status @@ -173,7 +173,7 @@ public List findPetsByStatus(List status) throws RestClientExceptio * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity> findPetsByStatusWithHttpInfo(List status) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -181,24 +181,24 @@ public ResponseEntity> findPetsByStatusWithHttpInfo(List statu } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference> localReturnType = new ParameterizedTypeReference>() {}; + return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Finds Pets by tags @@ -227,7 +227,7 @@ public Set findPetsByTags(Set tags) throws RestClientException { */ @Deprecated public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -235,24 +235,24 @@ public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) thr } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference> localReturnType = new ParameterizedTypeReference>() {}; + return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Find pet by ID @@ -279,7 +279,7 @@ public Pet getPetById(Long petId) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -290,22 +290,22 @@ public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws RestClientE final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "api_key" }; + String[] localVarAuthNames = new String[] { "api_key" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Update an existing pet @@ -333,7 +333,7 @@ public void updatePet(Pet body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity updatePetWithHttpInfo(Pet body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -341,22 +341,22 @@ public ResponseEntity updatePetWithHttpInfo(Pet body) throws RestClientExc } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json", "application/xml" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet", HttpMethod.PUT, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Updates a pet in the store with form data @@ -382,7 +382,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Res * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -393,27 +393,27 @@ public ResponseEntity updatePetWithFormWithHttpInfo(Long petId, String nam final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (name != null) - formParams.add("name", name); + localVarFormParams.add("name", name); if (status != null) - formParams.add("status", status); + localVarFormParams.add("status", status); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * uploads an image @@ -440,7 +440,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _ * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -451,29 +451,29 @@ public ResponseEntity uploadFileWithHttpInfo(Long petId, Strin final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (additionalMetadata != null) - formParams.add("additionalMetadata", additionalMetadata); + localVarFormParams.add("additionalMetadata", additionalMetadata); if (_file != null) - formParams.add("file", new FileSystemResource(_file)); + localVarFormParams.add("file", new FileSystemResource(_file)); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "multipart/form-data" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * uploads an image (required) @@ -500,7 +500,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -516,28 +516,28 @@ public ResponseEntity uploadFileWithRequiredFileWithHttpInfo(L final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (additionalMetadata != null) - formParams.add("additionalMetadata", additionalMetadata); + localVarFormParams.add("additionalMetadata", additionalMetadata); if (requiredFile != null) - formParams.add("requiredFile", new FileSystemResource(requiredFile)); + localVarFormParams.add("requiredFile", new FileSystemResource(requiredFile)); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "multipart/form-data" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java index fc78288cdd36..51afdd6c2d43 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java @@ -69,7 +69,7 @@ public void deleteOrder(String orderId) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity deleteOrderWithHttpInfo(String orderId) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -80,20 +80,20 @@ public ResponseEntity deleteOrderWithHttpInfo(String orderId) throws RestC final Map uriVariables = new HashMap(); uriVariables.put("order_id", orderId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Returns pet inventories by status @@ -114,25 +114,25 @@ public Map getInventory() throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity> getInventoryWithHttpInfo() throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "api_key" }; + String[] localVarAuthNames = new String[] { "api_key" }; - ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference> localReturnType = new ParameterizedTypeReference>() {}; + return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Find purchase order by ID @@ -159,7 +159,7 @@ public Order getOrderById(Long orderId) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity getOrderByIdWithHttpInfo(Long orderId) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -170,22 +170,22 @@ public ResponseEntity getOrderByIdWithHttpInfo(Long orderId) throws RestC final Map uriVariables = new HashMap(); uriVariables.put("order_id", orderId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Place an order for a pet @@ -210,7 +210,7 @@ public Order placeOrder(Order body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity placeOrderWithHttpInfo(Order body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -218,21 +218,21 @@ public ResponseEntity placeOrderWithHttpInfo(Order body) throws RestClien } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/store/order", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/store/order", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java index 066744bc489e..55369257c1ee 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java @@ -68,7 +68,7 @@ public void createUser(User body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity createUserWithHttpInfo(User body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -76,20 +76,20 @@ public ResponseEntity createUserWithHttpInfo(User body) throws RestClientE } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Creates list of users with given input array @@ -111,7 +111,7 @@ public void createUsersWithArrayInput(List body) throws RestClientExceptio * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity createUsersWithArrayInputWithHttpInfo(List body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -119,20 +119,20 @@ public ResponseEntity createUsersWithArrayInputWithHttpInfo(List bod } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Creates list of users with given input array @@ -154,7 +154,7 @@ public void createUsersWithListInput(List body) throws RestClientException * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity createUsersWithListInputWithHttpInfo(List body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -162,20 +162,20 @@ public ResponseEntity createUsersWithListInputWithHttpInfo(List body } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Delete user @@ -199,7 +199,7 @@ public void deleteUser(String username) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity deleteUserWithHttpInfo(String username) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -210,20 +210,20 @@ public ResponseEntity deleteUserWithHttpInfo(String username) throws RestC final Map uriVariables = new HashMap(); uriVariables.put("username", username); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Get user by user name @@ -250,7 +250,7 @@ public User getUserByName(String username) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity getUserByNameWithHttpInfo(String username) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -261,22 +261,22 @@ public ResponseEntity getUserByNameWithHttpInfo(String username) throws Re final Map uriVariables = new HashMap(); uriVariables.put("username", username); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Logs user into the system @@ -303,7 +303,7 @@ public String loginUser(String username, String password) throws RestClientExcep * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity loginUserWithHttpInfo(String username, String password) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -316,25 +316,25 @@ public ResponseEntity loginUserWithHttpInfo(String username, String pass } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/login", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/login", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Logs out current logged in user session @@ -354,23 +354,23 @@ public void logoutUser() throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity logoutUserWithHttpInfo() throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/logout", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/logout", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Updated user @@ -396,7 +396,7 @@ public void updateUser(String username, User body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity updateUserWithHttpInfo(String username, User body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'username' is set if (username == null) { @@ -412,19 +412,19 @@ public ResponseEntity updateUserWithHttpInfo(String username, User body) t final Map uriVariables = new HashMap(); uriVariables.put("username", username); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 4d2183737b57..67aa8844f17b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -68,7 +68,7 @@ public Client call123testSpecialTags(Client body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity call123testSpecialTagsWithHttpInfo(Client body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -76,23 +76,23 @@ public ResponseEntity call123testSpecialTagsWithHttpInfo(Client body) th } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index d82e43ff8754..1fcb8328c73c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -75,7 +75,7 @@ public void createXmlItem(XmlItem xmlItem) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity createXmlItemWithHttpInfo(XmlItem xmlItem) throws RestClientException { - Object postBody = xmlItem; + Object localVarPostBody = xmlItem; // verify the required parameter 'xmlItem' is set if (xmlItem == null) { @@ -83,22 +83,22 @@ public ResponseEntity createXmlItemWithHttpInfo(XmlItem xmlItem) throws Re } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/create_xml_item", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/create_xml_item", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -121,25 +121,25 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientExceptio * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "*/*" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -162,25 +162,25 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Re * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "*/*" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -203,25 +203,25 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientExc * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "*/*" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -244,25 +244,25 @@ public String fakeOuterStringSerialize(String body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity fakeOuterStringSerializeWithHttpInfo(String body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "*/*" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -284,7 +284,7 @@ public void testBodyWithFileSchema(FileSchemaTestClass body) throws RestClientEx * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -292,22 +292,22 @@ public ResponseEntity testBodyWithFileSchemaWithHttpInfo(FileSchemaTestCla } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -331,7 +331,7 @@ public void testBodyWithQueryParams(String query, User body) throws RestClientEx * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testBodyWithQueryParamsWithHttpInfo(String query, User body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'query' is set if (query == null) { @@ -344,24 +344,24 @@ public ResponseEntity testBodyWithQueryParamsWithHttpInfo(String query, Us } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * To test \"client\" model @@ -384,7 +384,7 @@ public Client testClientModel(Client body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testClientModelWithHttpInfo(Client body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -392,24 +392,24 @@ public ResponseEntity testClientModelWithHttpInfo(Client body) throws Re } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake", HttpMethod.PATCH, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake", HttpMethod.PATCH, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -459,7 +459,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -482,51 +482,51 @@ public ResponseEntity testEndpointParametersWithHttpInfo(BigDecimal number } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (integer != null) - formParams.add("integer", integer); + localVarFormParams.add("integer", integer); if (int32 != null) - formParams.add("int32", int32); + localVarFormParams.add("int32", int32); if (int64 != null) - formParams.add("int64", int64); + localVarFormParams.add("int64", int64); if (number != null) - formParams.add("number", number); + localVarFormParams.add("number", number); if (_float != null) - formParams.add("float", _float); + localVarFormParams.add("float", _float); if (_double != null) - formParams.add("double", _double); + localVarFormParams.add("double", _double); if (string != null) - formParams.add("string", string); + localVarFormParams.add("string", string); if (patternWithoutDelimiter != null) - formParams.add("pattern_without_delimiter", patternWithoutDelimiter); + localVarFormParams.add("pattern_without_delimiter", patternWithoutDelimiter); if (_byte != null) - formParams.add("byte", _byte); + localVarFormParams.add("byte", _byte); if (binary != null) - formParams.add("binary", new FileSystemResource(binary)); + localVarFormParams.add("binary", new FileSystemResource(binary)); if (date != null) - formParams.add("date", date); + localVarFormParams.add("date", date); if (dateTime != null) - formParams.add("dateTime", dateTime); + localVarFormParams.add("dateTime", dateTime); if (password != null) - formParams.add("password", password); + localVarFormParams.add("password", password); if (paramCallback != null) - formParams.add("callback", paramCallback); + localVarFormParams.add("callback", paramCallback); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "http_basic_test" }; + String[] localVarAuthNames = new String[] { "http_basic_test" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * To test enum parameters @@ -564,40 +564,40 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "enum_query_string_array", enumQueryStringArray)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_double", enumQueryDouble)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_double", enumQueryDouble)); if (enumHeaderStringArray != null) - headerParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); + localVarHeaderParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); if (enumHeaderString != null) - headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); + localVarHeaderParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); if (enumFormStringArray != null) - formParams.addAll("enum_form_string_array", enumFormStringArray); + localVarFormParams.addAll("enum_form_string_array", enumFormStringArray); if (enumFormString != null) - formParams.add("enum_form_string", enumFormString); + localVarFormParams.add("enum_form_string", enumFormString); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Fake endpoint to test group parameters (optional) @@ -629,7 +629,7 @@ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBoo * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -647,30 +647,30 @@ public ResponseEntity testGroupParametersWithHttpInfo(Integer requiredStri } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_string_group", requiredStringGroup)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_int64_group", requiredInt64Group)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "string_group", stringGroup)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "int64_group", int64Group)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_string_group", requiredStringGroup)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_int64_group", requiredInt64Group)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "string_group", stringGroup)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "int64_group", int64Group)); if (requiredBooleanGroup != null) - headerParams.add("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + localVarHeaderParams.add("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); if (booleanGroup != null) - headerParams.add("boolean_group", apiClient.parameterToString(booleanGroup)); + localVarHeaderParams.add("boolean_group", apiClient.parameterToString(booleanGroup)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake", HttpMethod.DELETE, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake", HttpMethod.DELETE, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * test inline additionalProperties @@ -692,7 +692,7 @@ public void testInlineAdditionalProperties(Map param) throws Res * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testInlineAdditionalPropertiesWithHttpInfo(Map param) throws RestClientException { - Object postBody = param; + Object localVarPostBody = param; // verify the required parameter 'param' is set if (param == null) { @@ -700,22 +700,22 @@ public ResponseEntity testInlineAdditionalPropertiesWithHttpInfo(Map queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * test json serialization of form data @@ -739,7 +739,7 @@ public void testJsonFormData(String param, String param2) throws RestClientExcep * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testJsonFormDataWithHttpInfo(String param, String param2) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -752,27 +752,27 @@ public ResponseEntity testJsonFormDataWithHttpInfo(String param, String pa } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (param != null) - formParams.add("param", param); + localVarFormParams.add("param", param); if (param2 != null) - formParams.add("param2", param2); + localVarFormParams.add("param2", param2); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * @@ -802,7 +802,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'pipe' is set if (pipe == null) { @@ -830,25 +830,25 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/test-query-parameters", HttpMethod.PUT, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/test-query-parameters", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 90564f107af7..eebf656bb5c1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -68,7 +68,7 @@ public Client testClassname(Client body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity testClassnameWithHttpInfo(Client body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -76,23 +76,23 @@ public ResponseEntity testClassnameWithHttpInfo(Client body) throws Rest } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "api_key_query" }; + String[] localVarAuthNames = new String[] { "api_key_query" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java index 00ad400d64bc..2d26052eb288 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java @@ -72,7 +72,7 @@ public void addPet(Pet body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity addPetWithHttpInfo(Pet body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -80,22 +80,22 @@ public ResponseEntity addPetWithHttpInfo(Pet body) throws RestClientExcept } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json", "application/xml" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Deletes a pet @@ -121,7 +121,7 @@ public void deletePet(Long petId, String apiKey) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity deletePetWithHttpInfo(Long petId, String apiKey) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -132,23 +132,23 @@ public ResponseEntity deletePetWithHttpInfo(Long petId, String apiKey) thr final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (apiKey != null) - headerParams.add("api_key", apiClient.parameterToString(apiKey)); + localVarHeaderParams.add("api_key", apiClient.parameterToString(apiKey)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Finds Pets by status @@ -173,7 +173,7 @@ public List findPetsByStatus(List status) throws RestClientExceptio * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity> findPetsByStatusWithHttpInfo(List status) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -181,24 +181,24 @@ public ResponseEntity> findPetsByStatusWithHttpInfo(List statu } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference> localReturnType = new ParameterizedTypeReference>() {}; + return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Finds Pets by tags @@ -227,7 +227,7 @@ public Set findPetsByTags(Set tags) throws RestClientException { */ @Deprecated public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -235,24 +235,24 @@ public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) thr } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference> localReturnType = new ParameterizedTypeReference>() {}; + return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Find pet by ID @@ -279,7 +279,7 @@ public Pet getPetById(Long petId) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -290,22 +290,22 @@ public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws RestClientE final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "api_key" }; + String[] localVarAuthNames = new String[] { "api_key" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Update an existing pet @@ -333,7 +333,7 @@ public void updatePet(Pet body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity updatePetWithHttpInfo(Pet body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -341,22 +341,22 @@ public ResponseEntity updatePetWithHttpInfo(Pet body) throws RestClientExc } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/json", "application/xml" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet", HttpMethod.PUT, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Updates a pet in the store with form data @@ -382,7 +382,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Res * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -393,27 +393,27 @@ public ResponseEntity updatePetWithFormWithHttpInfo(Long petId, String nam final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (name != null) - formParams.add("name", name); + localVarFormParams.add("name", name); if (status != null) - formParams.add("status", status); + localVarFormParams.add("status", status); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * uploads an image @@ -440,7 +440,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _ * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -451,29 +451,29 @@ public ResponseEntity uploadFileWithHttpInfo(Long petId, Strin final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (additionalMetadata != null) - formParams.add("additionalMetadata", additionalMetadata); + localVarFormParams.add("additionalMetadata", additionalMetadata); if (_file != null) - formParams.add("file", new FileSystemResource(_file)); + localVarFormParams.add("file", new FileSystemResource(_file)); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "multipart/form-data" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * uploads an image (required) @@ -500,7 +500,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -516,28 +516,28 @@ public ResponseEntity uploadFileWithRequiredFileWithHttpInfo(L final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); if (additionalMetadata != null) - formParams.add("additionalMetadata", additionalMetadata); + localVarFormParams.add("additionalMetadata", additionalMetadata); if (requiredFile != null) - formParams.add("requiredFile", new FileSystemResource(requiredFile)); + localVarFormParams.add("requiredFile", new FileSystemResource(requiredFile)); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { + final String[] localVarContentTypes = { "multipart/form-data" }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java index fc78288cdd36..51afdd6c2d43 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java @@ -69,7 +69,7 @@ public void deleteOrder(String orderId) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity deleteOrderWithHttpInfo(String orderId) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -80,20 +80,20 @@ public ResponseEntity deleteOrderWithHttpInfo(String orderId) throws RestC final Map uriVariables = new HashMap(); uriVariables.put("order_id", orderId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Returns pet inventories by status @@ -114,25 +114,25 @@ public Map getInventory() throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity> getInventoryWithHttpInfo() throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { "api_key" }; + String[] localVarAuthNames = new String[] { "api_key" }; - ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference> localReturnType = new ParameterizedTypeReference>() {}; + return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Find purchase order by ID @@ -159,7 +159,7 @@ public Order getOrderById(Long orderId) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity getOrderByIdWithHttpInfo(Long orderId) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -170,22 +170,22 @@ public ResponseEntity getOrderByIdWithHttpInfo(Long orderId) throws RestC final Map uriVariables = new HashMap(); uriVariables.put("order_id", orderId); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Place an order for a pet @@ -210,7 +210,7 @@ public Order placeOrder(Order body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity placeOrderWithHttpInfo(Order body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -218,21 +218,21 @@ public ResponseEntity placeOrderWithHttpInfo(Order body) throws RestClien } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/store/order", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/store/order", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java index 066744bc489e..55369257c1ee 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java @@ -68,7 +68,7 @@ public void createUser(User body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity createUserWithHttpInfo(User body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -76,20 +76,20 @@ public ResponseEntity createUserWithHttpInfo(User body) throws RestClientE } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Creates list of users with given input array @@ -111,7 +111,7 @@ public void createUsersWithArrayInput(List body) throws RestClientExceptio * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity createUsersWithArrayInputWithHttpInfo(List body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -119,20 +119,20 @@ public ResponseEntity createUsersWithArrayInputWithHttpInfo(List bod } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Creates list of users with given input array @@ -154,7 +154,7 @@ public void createUsersWithListInput(List body) throws RestClientException * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity createUsersWithListInputWithHttpInfo(List body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { @@ -162,20 +162,20 @@ public ResponseEntity createUsersWithListInputWithHttpInfo(List body } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Delete user @@ -199,7 +199,7 @@ public void deleteUser(String username) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity deleteUserWithHttpInfo(String username) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -210,20 +210,20 @@ public ResponseEntity deleteUserWithHttpInfo(String username) throws RestC final Map uriVariables = new HashMap(); uriVariables.put("username", username); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Get user by user name @@ -250,7 +250,7 @@ public User getUserByName(String username) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity getUserByNameWithHttpInfo(String username) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -261,22 +261,22 @@ public ResponseEntity getUserByNameWithHttpInfo(String username) throws Re final Map uriVariables = new HashMap(); uriVariables.put("username", username); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Logs user into the system @@ -303,7 +303,7 @@ public String loginUser(String username, String password) throws RestClientExcep * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity loginUserWithHttpInfo(String username, String password) throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -316,25 +316,25 @@ public ResponseEntity loginUserWithHttpInfo(String username, String pass } - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); - queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); final String[] localVarAccepts = { "application/xml", "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/login", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/login", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Logs out current logged in user session @@ -354,23 +354,23 @@ public void logoutUser() throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity logoutUserWithHttpInfo() throws RestClientException { - Object postBody = null; + Object localVarPostBody = null; - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/logout", HttpMethod.GET, Collections.emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/logout", HttpMethod.GET, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } /** * Updated user @@ -396,7 +396,7 @@ public void updateUser(String username, User body) throws RestClientException { * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity updateUserWithHttpInfo(String username, User body) throws RestClientException { - Object postBody = body; + Object localVarPostBody = body; // verify the required parameter 'username' is set if (username == null) { @@ -412,19 +412,19 @@ public ResponseEntity updateUserWithHttpInfo(String username, User body) t final Map uriVariables = new HashMap(); uriVariables.put("username", username); - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { }; + String[] localVarAuthNames = new String[] { }; - ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } } From 140f633655224ca8360f2e765b26da356c1d930e Mon Sep 17 00:00:00 2001 From: devhl-labs Date: Sun, 13 Feb 2022 22:08:40 -0500 Subject: [PATCH 053/111] [csharp-netcore] Nrt (nullableReferenceTypes) refactor (#11452) * refactor nrt annotation * enable nrt by default in .net6.0+ * use shorter nrt annotation * build samples * removed debugging lines --- docs/generators/csharp-netcore.md | 2 +- .../languages/AbstractCSharpCodegen.java | 13 +++- .../languages/CSharpNetCoreClientCodegen.java | 16 +++-- .../generichost/ApiException.mustache | 6 +- .../generichost/ApiKeyToken.mustache | 4 +- .../generichost/ApiResponse`1.mustache | 6 +- .../libraries/generichost/BasicToken.mustache | 2 +- .../generichost/BearerToken.mustache | 2 +- .../generichost/ClientUtils.mustache | 2 +- .../generichost/HostConfiguration.mustache | 4 +- .../HttpSigningConfiguration.mustache | 36 +++++------ .../generichost/HttpSigningToken.mustache | 2 +- .../libraries/generichost/IApi.mustache | 2 +- .../libraries/generichost/OAuthToken.mustache | 2 +- .../libraries/generichost/README.mustache | 2 +- .../generichost/RateLimitProvider`1.mustache | 2 +- .../libraries/generichost/TokenBase.mustache | 4 +- .../generichost/TokenContainer`1.mustache | 2 +- .../generichost/TokenProvider`1.mustache | 2 +- .../libraries/generichost/api.mustache | 64 +++++++++---------- .../csharp-netcore/netcore_project.mustache | 6 +- .../netcore_testproject.mustache | 4 +- 22 files changed, 98 insertions(+), 87 deletions(-) diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 6e4a146c8944..b1d67360295c 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| |netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| |nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| -|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer.| |false| +|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer. Starting in .NET 6.0 the default is true.| |false| |optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true| |optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false| |optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index f0874648f652..359101c3556b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -369,8 +369,6 @@ public void processOpts() { if (additionalProperties.containsKey(CodegenConstants.NULLABLE_REFERENCE_TYPES)) { setNullableReferenceTypes(convertPropertyToBooleanAndWriteBack(CodegenConstants.NULLABLE_REFERENCE_TYPES)); - } else { - additionalProperties.put(CodegenConstants.NULLABLE_REFERENCE_TYPES, nullReferenceTypesFlag); } if (additionalProperties.containsKey(CodegenConstants.INTERFACE_PREFIX)) { @@ -1165,8 +1163,17 @@ public String getInterfacePrefix() { public void setNullableReferenceTypes(final Boolean nullReferenceTypesFlag){ this.nullReferenceTypesFlag = nullReferenceTypesFlag; - if (nullReferenceTypesFlag == true){ + additionalProperties.put("nullableReferenceTypes", nullReferenceTypesFlag); + additionalProperties.put("nrt", nullReferenceTypesFlag); + + if (nullReferenceTypesFlag){ this.nullableType.add("string"); + additionalProperties.put("nrt?", "?"); + additionalProperties.put("nrt!", "!"); + } else { + this.nullableType.remove("string"); + additionalProperties.remove("nrt?"); + additionalProperties.remove("nrt!"); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index 1e882ca18191..12d8ec68770b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -240,7 +240,7 @@ public CSharpNetCoreClientCodegen() { // CLI Switches addSwitch(CodegenConstants.NULLABLE_REFERENCE_TYPES, - CodegenConstants.NULLABLE_REFERENCE_TYPES_DESC, + CodegenConstants.NULLABLE_REFERENCE_TYPES_DESC + " Starting in .NET 6.0 the default is true.", this.nullReferenceTypesFlag); addSwitch(CodegenConstants.HIDE_GENERATION_TIMESTAMP, @@ -655,11 +655,17 @@ public void processOpts() { if (!netStandard) { setNetCoreProjectFileFlag(true); - } - if (additionalProperties.containsKey(CodegenConstants.GENERATE_PROPERTY_CHANGED)) { - LOGGER.warn("{} is not supported in the .NET Standard generator.", CodegenConstants.GENERATE_PROPERTY_CHANGED); - additionalProperties.remove(CodegenConstants.GENERATE_PROPERTY_CHANGED); + if (!additionalProperties.containsKey(CodegenConstants.NULLABLE_REFERENCE_TYPES) && !strategies.stream().anyMatch(s -> + s.equals(FrameworkStrategy.NETCOREAPP_2_0) || + s.equals(FrameworkStrategy.NETCOREAPP_2_1) || + s.equals(FrameworkStrategy.NETCOREAPP_3_0) || + s.equals(FrameworkStrategy.NETCOREAPP_3_1) || + s.equals(FrameworkStrategy.NET_5_0) || + s.equals(FrameworkStrategy.NETFRAMEWORK_4_7))) { + // starting in .net 6.0, NRT is enabled by default. If not specified, lets enable NRT to match the framework's default + setNullableReferenceTypes(true); + } } final AtomicReference excludeTests = new AtomicReference<>(); diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiException.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiException.mustache index 77e95ca3d144..0a7d36f90b28 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiException.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiException.mustache @@ -1,6 +1,6 @@ // {{>partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; @@ -14,7 +14,7 @@ namespace {{packageName}}.Client /// /// The reason the api request failed /// - public string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ReasonPhrase { get; } + public string{{nrt?}} ReasonPhrase { get; } /// /// The HttpStatusCode @@ -32,7 +32,7 @@ namespace {{packageName}}.Client /// /// /// - public ApiException(string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + public ApiException(string{{nrt?}} reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) { ReasonPhrase = reasonPhrase; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiKeyToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiKeyToken.mustache index 98434c3b25a2..542a137edf12 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiKeyToken.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiKeyToken.mustache @@ -1,6 +1,6 @@ // {{partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; @@ -53,7 +53,7 @@ namespace {{packageName}}.Client /// public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString, string parameterName) { - parseQueryString[parameterName] = Uri.EscapeDataString(_raw).ToString(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}; + parseQueryString[parameterName] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; } } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponse`1.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponse`1.mustache index ce8b308e9caf..4aa977913dc1 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponse`1.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponse`1.mustache @@ -1,6 +1,6 @@ // {{>partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace {{packageName}}.Client /// The deserialized content /// {{! .net 3.1 does not support unconstrained nullable T }} - public T{{#nullableReferenceTypes}}{{^netcoreapp3.1}}?{{/netcoreapp3.1}}{{/nullableReferenceTypes}} Content { get; set; } + public T{{#nrt}}{{^netcoreapp3.1}}?{{/netcoreapp3.1}}{{/nrt}} Content { get; set; } /// /// Gets or sets the status code (HTTP status code) @@ -71,7 +71,7 @@ namespace {{packageName}}.Client /// /// The reason phrase contained in the api response /// - public string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ReasonPhrase { get; } + public string{{nrt?}} ReasonPhrase { get; } /// /// The headers contained in the api response diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BasicToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BasicToken.mustache index 78fce754c171..17bd5c3658cd 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BasicToken.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BasicToken.mustache @@ -1,6 +1,6 @@ // {{partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; using System.Linq; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BearerToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BearerToken.mustache index 0e6a8dbdf231..5abcc7eb97ea 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BearerToken.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BearerToken.mustache @@ -1,6 +1,6 @@ // {{partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; using System.Linq; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache index b3b398425e43..fa3db528f1b9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache @@ -81,7 +81,7 @@ namespace {{packageName}}.Client /// The parameter (header, path, query, form). /// The DateTime serialization format. /// Formatted string. - public static string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ParameterToString(object obj, string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} format = ISO8601_DATETIME_FORMAT) + public static string{{nrt?}} ParameterToString(object obj, string{{nrt?}} format = ISO8601_DATETIME_FORMAT) { if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HostConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HostConfiguration.mustache index 24530537f967..d8dfd3108ccb 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HostConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HostConfiguration.mustache @@ -35,7 +35,7 @@ namespace {{packageName}}.Client /// public HostConfiguration Add{{apiName}}HttpClients<{{#apiInfo}}{{#apis}}T{{classname}}{{^-last}}, {{/-last}}{{/apis}}> ( - Action{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} client = null, Action{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} builder = null){{#apis}} + Action{{nrt?}} client = null, Action{{nrt?}} builder = null){{#apis}} where T{{classname}} : class, {{interfacePrefix}}{{classname}}{{/apis}} { if (client == null) @@ -61,7 +61,7 @@ namespace {{packageName}}.Client /// /// public HostConfiguration Add{{apiName}}HttpClients( - Action{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} client = null, Action{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} builder = null) + Action{{nrt?}} client = null, Action{{nrt?}} builder = null) { Add{{apiName}}HttpClients<{{#apiInfo}}{{#apis}}{{classname}}{{^-last}}, {{/-last}}{{/apis}}{{/apiInfo}}>(client, builder); diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningConfiguration.mustache index 23b2d9149a1d..537015a0e7db 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningConfiguration.mustache @@ -1,6 +1,6 @@ // {{>partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; using System.Collections.Generic; @@ -22,7 +22,7 @@ namespace {{packageName}}.Client /// /// Create an instance /// - public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString{{nrt?}} keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) { KeyId = keyId; KeyFilePath = keyFilePath; @@ -48,7 +48,7 @@ namespace {{packageName}}.Client /// /// Gets the key pass phrase for password protected key /// - public SecureString{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} KeyPassPhrase { get; set; } + public SecureString{{nrt?}} KeyPassPhrase { get; set; } /// /// Gets the HTTP signing header @@ -118,7 +118,7 @@ namespace {{packageName}}.Client //Hash table to store singed headers var HttpSignedRequestHeader = new Dictionary(); - var httpSignatureHeader = new Dictionary(); + var httpSignatureHeader = new Dictionary(); if (HttpSigningHeader.Count == 0) HttpSigningHeader.Add("(created)"); @@ -191,7 +191,7 @@ namespace {{packageName}}.Client //Concatinate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); - string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} headerSignatureStr = null; + string{{nrt?}} headerSignatureStr = null; var keyType = GetKeyType(KeyFilePath); if (keyType == PrivateKeyType.RSA) @@ -241,7 +241,7 @@ namespace {{packageName}}.Client if (KeyPassPhrase == null) throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); - RSA{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + RSA{{nrt?}} rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); if (rsa == null) return string.Empty; @@ -363,12 +363,12 @@ namespace {{packageName}}.Client return derBytes.ToArray(); } - private RSACryptoServiceProvider{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} GetRSAProviderFromPemFile(String pemfile, SecureString{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} keyPassPharse = null) + private RSACryptoServiceProvider{{nrt?}} GetRSAProviderFromPemFile(String pemfile, SecureString{{nrt?}} keyPassPharse = null) { const String pempubheader = "-----BEGIN PUBLIC KEY-----"; const String pempubfooter = "-----END PUBLIC KEY-----"; bool isPrivateKeyFile = true; - byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} pemkey = null; + byte[]{{nrt?}} pemkey = null; if (!File.Exists(pemfile)) throw new Exception("private key file does not exist."); @@ -390,7 +390,7 @@ namespace {{packageName}}.Client return null; } - private byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ConvertPrivateKeyToBytes(String instr, SecureString{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} keyPassPharse = null) + private byte[]{{nrt?}} ConvertPrivateKeyToBytes(String instr, SecureString{{nrt?}} keyPassPharse = null) { const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; @@ -415,10 +415,10 @@ namespace {{packageName}}.Client StringReader str = new StringReader(pvkstr); //-------- read PEM encryption info. lines and extract salt ----- - if (!str.ReadLine(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + if (!str.ReadLine(){{nrt!}}.StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? return null; - String saltline = str.ReadLine(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}; // TODO: what do we do here if ReadLine is null? + String saltline = str.ReadLine(){{nrt!}}; // TODO: what do we do here if ReadLine is null? if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) return null; @@ -443,18 +443,18 @@ namespace {{packageName}}.Client } // TODO: what do we do here if keyPassPharse is null? - byte[] deskey = GetEncryptedKey(salt, keyPassPharse{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + byte[] deskey = GetEncryptedKey(salt, keyPassPharse{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes if (deskey == null) return null; //------ Decrypt the encrypted 3des-encrypted RSA private key ------ - byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + byte[]{{nrt?}} rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV return rsakey; } } - private RSACryptoServiceProvider{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} DecodeRSAPrivateKey(byte[] privkey) + private RSACryptoServiceProvider{{nrt?}} DecodeRSAPrivateKey(byte[] privkey) { byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; @@ -583,7 +583,7 @@ namespace {{packageName}}.Client // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- MD5 md5 = new MD5CryptoServiceProvider(); - byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} result = null; + byte[]{{nrt?}} result = null; byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget for (int j = 0; j < miter; j++) @@ -593,7 +593,7 @@ namespace {{packageName}}.Client result = data00; //initialize else { - Array.Copy(result{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}, hashtarget, result{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.Length); // TODO: what do we do if result is null here? + Array.Copy(result{{nrt!}}, hashtarget, result{{nrt!}}.Length); // TODO: what do we do if result is null here? Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); result = hashtarget; } @@ -608,13 +608,13 @@ namespace {{packageName}}.Client Array.Clear(psbytes, 0, psbytes.Length); Array.Clear(data00, 0, data00.Length); - Array.Clear(result{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}, 0, result{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.Length); // TODO: what do we do if result is null here? + Array.Clear(result{{nrt!}}, 0, result{{nrt!}}.Length); // TODO: what do we do if result is null here? Array.Clear(hashtarget, 0, hashtarget.Length); Array.Clear(keymaterial, 0, keymaterial.Length); return deskey; } - private byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + private byte[]{{nrt?}} DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) { MemoryStream memst = new MemoryStream(); TripleDES alg = TripleDES.Create(); diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningToken.mustache index ca47cca24da3..2322c1e19880 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningToken.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningToken.mustache @@ -1,6 +1,6 @@ // {{partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; using System.Linq; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/IApi.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/IApi.mustache index 78856d47816c..019132830fcb 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/IApi.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/IApi.mustache @@ -16,6 +16,6 @@ namespace {{packageName}}.Client /// An event to track the health of the server. /// If you store these event args, be sure to purge old event args to prevent a memory leak. /// - event ClientUtils.EventHandler{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ApiResponded; + event ClientUtils.EventHandler{{nrt?}} ApiResponded; } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OAuthToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OAuthToken.mustache index d15a01cf9d3f..ace461e7daeb 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OAuthToken.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OAuthToken.mustache @@ -1,6 +1,6 @@ // {{partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; using System.Linq; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/README.mustache index 608e3fa8654c..e82c6b4e365f 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/README.mustache @@ -62,7 +62,7 @@ namespace YourProject { var host = CreateHostBuilder(args).Build();{{#apiInfo}}{{#apis}}{{#-first}} var api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>();{{#operations}}{{#-first}}{{#operation}}{{#-first}} - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> foo = await api.{{operationId}}WithHttpInfoAsync("todo");{{/-first}}{{/operation}}{{/-first}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> foo = await api.{{operationId}}WithHttpInfoAsync("todo");{{/-first}}{{/operation}}{{/-first}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/RateLimitProvider`1.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/RateLimitProvider`1.mustache index 3a778c0aeec9..a52f377e2025 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/RateLimitProvider`1.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/RateLimitProvider`1.mustache @@ -1,6 +1,6 @@ // {{>partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System;{{^netStandard}} using System.Threading.Channels;{{/netStandard}}{{#netStandard}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenBase.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenBase.mustache index 0b8db5d10ae1..94a326694654 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenBase.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenBase.mustache @@ -1,6 +1,6 @@ // {{partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; @@ -18,7 +18,7 @@ namespace {{packageName}}.Client internal TimeSpan? Timeout { get; set; } internal delegate void TokenBecameAvailableEventHandler(object sender); - internal event TokenBecameAvailableEventHandler{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} TokenBecameAvailable; + internal event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable; /// diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenContainer`1.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenContainer`1.mustache index 113f9206fd19..63c4a0898d25 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenContainer`1.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenContainer`1.mustache @@ -1,6 +1,6 @@ // {{partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System.Linq; using System.Collections.Generic; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenProvider`1.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenProvider`1.mustache index d8b467a30bf7..c62f0d1f2c92 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenProvider`1.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenProvider`1.mustache @@ -1,6 +1,6 @@ // {{>partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; using System.Linq; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache index 880952325e61..8a5bc255e33f 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache @@ -1,6 +1,6 @@ // {{>partial_header}} -{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} +{{#nrt}}#nullable enable{{/nrt}} using System; using System.Collections.Generic; @@ -34,8 +34,8 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task<ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}>> - Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null); + /// Task<ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>> + Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null); /// /// {{summary}} @@ -49,7 +49,7 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} /// Cancellation Token to cancel the request. /// Task of ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}> - Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null);{{#nullableReferenceTypes}} + Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null);{{#nrt}} /// /// {{summary}} @@ -62,7 +62,7 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} /// Cancellation Token to cancel the request. /// Task of ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}?> - Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null);{{/nullableReferenceTypes}}{{^-last}} + Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null);{{/nrt}}{{^-last}} {{/-last}}{{/operation}} } @@ -76,7 +76,7 @@ namespace {{packageName}}.{{apiPackage}} /// An event to track the health of the server. /// If you store these event args, be sure to purge old event args to prevent a memory leak. /// - public event ClientUtils.EventHandler{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ApiResponded; + public event ClientUtils.EventHandler{{nrt?}} ApiResponded; /// /// The logger @@ -143,17 +143,17 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} /// Cancellation Token to cancel the request. /// <> - public async Task<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + public async Task<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); - {{^nullableReferenceTypes}}{{#returnTypeIsPrimitive}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - {{/returnTypeIsPrimitive}}{{/nullableReferenceTypes}}if (result.Content == null){{^nullableReferenceTypes}}{{#returnTypeIsPrimitive}} - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/returnTypeIsPrimitive}}{{/nullableReferenceTypes}} + {{^nrt}}{{#returnTypeIsPrimitive}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + {{/returnTypeIsPrimitive}}{{/nrt}}if (result.Content == null){{^nrt}}{{#returnTypeIsPrimitive}} + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/returnTypeIsPrimitive}}{{/nrt}} throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); return result.Content; - }{{#nullableReferenceTypes}} + }{{#nrt}} /// /// {{summary}} {{notes}} @@ -164,9 +164,9 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} /// Cancellation Token to cancel the request. /// <> - public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}>{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} result = null; + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>{{nrt?}} result = null; try { result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); @@ -178,7 +178,7 @@ namespace {{packageName}}.{{apiPackage}} return result != null && result.IsSuccessStatusCode ? result.Content : null; - }{{/nullableReferenceTypes}}{{^nullableReferenceTypes}}{{^returnTypeIsPrimitive}} + }{{/nrt}}{{^nrt}}{{^returnTypeIsPrimitive}} {{! Note that this method is a copy paste of above due to NRT complexities }} /// /// {{summary}} {{notes}} @@ -189,9 +189,9 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} /// Cancellation Token to cancel the request. /// <> - public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}>{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} result = null; + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>{{nrt?}} result = null; try { result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); @@ -204,7 +204,7 @@ namespace {{packageName}}.{{apiPackage}} ? result.Content : null; } - {{/returnTypeIsPrimitive}}{{/nullableReferenceTypes}} + {{/returnTypeIsPrimitive}}{{/nrt}} /// /// {{summary}} {{notes}} @@ -215,24 +215,24 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} /// Cancellation Token to cancel the request. /// <> where T : - public async Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + public async Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) { try { - {{#hasRequiredParams}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/hasRequiredParams}}{{#allParams}}{{#required}}{{#nullableReferenceTypes}} + {{#hasRequiredParams}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/hasRequiredParams}}{{#allParams}}{{#required}}{{#nrt}} if ({{paramName}} == null) - throw new ArgumentNullException(nameof({{paramName}}));{{/nullableReferenceTypes}}{{^nullableReferenceTypes}}{{^vendorExtensions.x-csharp-value-type}} + throw new ArgumentNullException(nameof({{paramName}}));{{/nrt}}{{^nrt}}{{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} == null) - throw new ArgumentNullException(nameof({{paramName}}));{{/vendorExtensions.x-csharp-value-type}}{{/nullableReferenceTypes}}{{/required}}{{/allParams}}{{#hasRequiredParams}} + throw new ArgumentNullException(nameof({{paramName}}));{{/vendorExtensions.x-csharp-value-type}}{{/nrt}}{{/required}}{{/allParams}}{{#hasRequiredParams}} #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' {{/hasRequiredParams}}using (HttpRequestMessage request = new HttpRequestMessage()) { UriBuilder uriBuilder = new UriBuilder(); - uriBuilder.Host = HttpClient.BaseAddress{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.Host; + uriBuilder.Host = HttpClient.BaseAddress{{nrt!}}.Host; uriBuilder.Scheme = ClientUtils.SCHEME; uriBuilder.Path = ClientUtils.CONTEXT_PATH + "{{path}}";{{#pathParams}}{{#required}} uriBuilder.Path = uriBuilder.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString()));{{/required}}{{^required}} @@ -246,10 +246,10 @@ namespace {{packageName}}.{{apiPackage}} System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/queryParams}}{{#queryParams}}{{#required}}{{#-first}} {{! all the redundant tags here are to get the spacing just right }} - {{/-first}}{{/required}}{{/queryParams}}{{#queryParams}}{{#required}}parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}); + {{/-first}}{{/required}}{{/queryParams}}{{#queryParams}}{{#required}}parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{nrt!}}); {{/required}}{{/queryParams}}{{#queryParams}}{{#-first}} {{/-first}}{{/queryParams}}{{#queryParams}}{{^required}}if ({{paramName}} != null) - parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}); + parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{nrt!}}); {{/required}}{{#-last}}uriBuilder.Query = parseQueryString.ToString();{{/-last}}{{/queryParams}}{{#headerParams}}{{#required}} @@ -262,14 +262,14 @@ namespace {{packageName}}.{{apiPackage}} request.Content = multipartContent; - List> formParams = new List>(); + List> formParams = new List>(); multipartContent.Add(new FormUrlEncodedContent(formParams));{{/-first}}{{^isFile}}{{#required}} - formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{^required}} + formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{^required}} if ({{paramName}} != null) - formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{/isFile}}{{#isFile}}{{#required}} + formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{/isFile}}{{#isFile}}{{#required}} multipartContent.Add(new StreamContent({{paramName}}));{{/required}}{{^required}} @@ -322,7 +322,7 @@ namespace {{packageName}}.{{apiPackage}} tokens.Add(signatureToken); - string requestBody = await request.Content{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); + string requestBody = await request.Content{{nrt!}}.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); signatureToken.UseInHeader(request, requestBody, cancellationToken);{{/isHttpSignature}}{{/authMethods}}{{#consumes}}{{#-first}} @@ -331,7 +331,7 @@ namespace {{packageName}}.{{apiPackage}} {{/-last}}{{#-last}} };{{/-last}}{{/consumes}}{{#consumes}}{{#-first}} - string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string{{nrt?}} contentType = ClientUtils.SelectHeaderContentType(contentTypes); if (contentType != null) request.Content.Headers.Add("ContentType", contentType);{{/-first}}{{/consumes}}{{#produces}}{{#-first}} @@ -341,7 +341,7 @@ namespace {{packageName}}.{{apiPackage}} {{/-last}}{{/produces}}{{#produces}}{{#-last}} };{{/-last}}{{/produces}}{{#produces}}{{#-first}} - string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} accept = ClientUtils.SelectHeaderAccept(accepts); + string{{nrt?}} accept = ClientUtils.SelectHeaderAccept(accepts); if (accept != null) request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); @@ -367,7 +367,7 @@ namespace {{packageName}}.{{apiPackage}} } } - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> apiResponse = new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}>(responseMessage, responseContent); + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> apiResponse = new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>(responseMessage, responseContent); if (apiResponse.IsSuccessStatusCode) apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);{{#authMethods}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index 1a544ad8bb1e..6cca9a0d1a2e 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -19,10 +19,8 @@ https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git git{{#releaseNote}} {{.}}{{/releaseNote}}{{#packageTags}} - {{{.}}}{{/packageTags}} - {{#nullableReferenceTypes}} - annotations - {{/nullableReferenceTypes}} + {{{.}}}{{/packageTags}}{{#nrt}} + annotations{{/nrt}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache index d01627884333..3e0c54f8f0d1 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache @@ -4,8 +4,8 @@ {{testPackageName}} {{testPackageName}} {{testTargetFramework}} - false{{#nullableReferenceTypes}} - annotations{{/nullableReferenceTypes}} + false{{#nrt}} + annotations{{/nrt}} From dce8b80af71550840ecbc7cfdfdb4ecb4a9c75ae Mon Sep 17 00:00:00 2001 From: jiangyuan Date: Mon, 14 Feb 2022 11:27:13 +0800 Subject: [PATCH 054/111] [Python] fix api file name & api var name (#11051) * fix api filename * fix PythonCodeGen toApiVarName * add samples change --- .../languages/AbstractPythonCodegen.java | 10 +- .../AbstractPythonConnexionServerCodegen.java | 5 +- .../python-asyncio/.openapi-generator/FILES | 2 +- .../python-asyncio/petstore_api/__init__.py | 2 +- .../petstore_api/api/__init__.py | 2 +- .../api/fake_classname_tags123_api.py | 180 ++++++++++++++++++ .../test/test_fake_classname_tags123_api.py | 40 ++++ .../python-legacy/.openapi-generator/FILES | 2 +- .../python-legacy/petstore_api/__init__.py | 2 +- .../petstore_api/api/__init__.py | 2 +- .../api/fake_classname_tags123_api.py | 180 ++++++++++++++++++ .../test/test_fake_classname_tags123_api.py | 40 ++++ .../python-tornado/.openapi-generator/FILES | 2 +- .../python-tornado/petstore_api/__init__.py | 2 +- .../petstore_api/api/__init__.py | 2 +- .../api/fake_classname_tags123_api.py | 180 ++++++++++++++++++ .../test/test_fake_classname_tags123_api.py | 40 ++++ .../petstore/python/.openapi-generator/FILES | 2 +- .../python/docs/FakeClassnameTags123Api.md | 4 +- .../api/fake_classname_tags123_api.py | 161 ++++++++++++++++ .../python/petstore_api/apis/__init__.py | 2 +- .../test/test_fake_classname_tags123_api.py | 35 ++++ .../.openapi-generator/FILES | 2 +- .../docs/FakeClassnameTags123Api.md | 4 +- .../api/fake_classname_tags123_api.py | 161 ++++++++++++++++ .../petstore_api/apis/__init__.py | 2 +- .../test/test_fake_classname_tags123_api.py | 35 ++++ .../python-legacy/.openapi-generator/FILES | 2 +- .../python-legacy/petstore_api/__init__.py | 2 +- .../petstore_api/api/__init__.py | 2 +- .../api/fake_classname_tags123_api.py | 180 ++++++++++++++++++ .../test/test_fake_classname_tags123_api.py | 40 ++++ .../petstore/python/.openapi-generator/FILES | 2 +- .../python/docs/FakeClassnameTags123Api.md | 4 +- .../api/fake_classname_tags123_api.py | 161 ++++++++++++++++ .../python/petstore_api/apis/__init__.py | 2 +- .../test/test_fake_classname_tags123_api.py | 35 ++++ 37 files changed, 1495 insertions(+), 36 deletions(-) create mode 100644 samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py create mode 100644 samples/client/petstore/python-asyncio/test/test_fake_classname_tags123_api.py create mode 100644 samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py create mode 100644 samples/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py create mode 100644 samples/client/petstore/python-tornado/test/test_fake_classname_tags123_api.py create mode 100644 samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py create mode 100644 samples/client/petstore/python/test/test_fake_classname_tags123_api.py create mode 100644 samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py create mode 100644 samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py create mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py create mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py create mode 100644 samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py create mode 100644 samples/openapi3/client/petstore/python/test/test_fake_classname_tags123_api.py diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index 97344f4cbcb3..65b1a202f52b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -677,11 +677,8 @@ public String toModelTestFilename(String name) { @Override public String toApiFilename(String name) { - // replace - with _ e.g. created-at => created_at - name = name.replaceAll("-", "_"); - // e.g. PhoneNumberApi.py => phone_number_api.py - return underscore(name + "_" + apiNameSuffix); + return underscore(toApiName(name)); } @Override @@ -696,10 +693,7 @@ public String toApiName(String name) { @Override public String toApiVarName(String name) { - if (name.length() == 0) { - return "default_api"; - } - return underscore(name + "_" + apiNameSuffix); + return underscore(toApiName(name)); } protected static String dropDots(String str) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java index 400e417a85b3..b9ddac1fecd0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java @@ -297,10 +297,7 @@ public String toApiName(String name) { return camelize(name, false) + "Controller"; } - @Override - public String toApiFilename(String name) { - return underscore(toApiName(name)); - } + @Override public String toApiTestFilename(String name) { diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/FILES b/samples/client/petstore/python-asyncio/.openapi-generator/FILES index 4beeb0e176e3..5835827fb98f 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/FILES +++ b/samples/client/petstore/python-asyncio/.openapi-generator/FILES @@ -61,7 +61,7 @@ petstore_api/__init__.py petstore_api/api/__init__.py petstore_api/api/another_fake_api.py petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/fake_classname_tags123_api.py petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py diff --git a/samples/client/petstore/python-asyncio/petstore_api/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/__init__.py index b9fdaf07ac19..62a0d6bb97f5 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/__init__.py +++ b/samples/client/petstore/python-asyncio/petstore_api/__init__.py @@ -19,7 +19,7 @@ # import apis into sdk package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py index 74496adb5a2b..ea4a9e3acb7d 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py @@ -5,7 +5,7 @@ # import apis into api package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py new file mode 100644 index 000000000000..2b46147fed58 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_classname(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + :param body: client model (required) + :type body: Client + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: Client + """ + kwargs['_return_http_data_only'] = True + return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 + + def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: client model (required) + :type body: Client + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_classname" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key_query'] # noqa: E501 + + response_types_map = { + 200: "Client", + } + + return self.api_client.call_api( + '/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-asyncio/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-asyncio/test/test_fake_classname_tags123_api.py new file mode 100644 index 000000000000..f54e0d06644f --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_fake_classname_tags123_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-legacy/.openapi-generator/FILES b/samples/client/petstore/python-legacy/.openapi-generator/FILES index 4beeb0e176e3..5835827fb98f 100644 --- a/samples/client/petstore/python-legacy/.openapi-generator/FILES +++ b/samples/client/petstore/python-legacy/.openapi-generator/FILES @@ -61,7 +61,7 @@ petstore_api/__init__.py petstore_api/api/__init__.py petstore_api/api/another_fake_api.py petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/fake_classname_tags123_api.py petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py diff --git a/samples/client/petstore/python-legacy/petstore_api/__init__.py b/samples/client/petstore/python-legacy/petstore_api/__init__.py index b9fdaf07ac19..62a0d6bb97f5 100644 --- a/samples/client/petstore/python-legacy/petstore_api/__init__.py +++ b/samples/client/petstore/python-legacy/petstore_api/__init__.py @@ -19,7 +19,7 @@ # import apis into sdk package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-legacy/petstore_api/api/__init__.py b/samples/client/petstore/python-legacy/petstore_api/api/__init__.py index 74496adb5a2b..ea4a9e3acb7d 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/__init__.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/__init__.py @@ -5,7 +5,7 @@ # import apis into api package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py new file mode 100644 index 000000000000..2b46147fed58 --- /dev/null +++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_classname(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + :param body: client model (required) + :type body: Client + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: Client + """ + kwargs['_return_http_data_only'] = True + return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 + + def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: client model (required) + :type body: Client + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_classname" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key_query'] # noqa: E501 + + response_types_map = { + 200: "Client", + } + + return self.api_client.call_api( + '/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py new file mode 100644 index 000000000000..f54e0d06644f --- /dev/null +++ b/samples/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/.openapi-generator/FILES b/samples/client/petstore/python-tornado/.openapi-generator/FILES index 4beeb0e176e3..5835827fb98f 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/FILES +++ b/samples/client/petstore/python-tornado/.openapi-generator/FILES @@ -61,7 +61,7 @@ petstore_api/__init__.py petstore_api/api/__init__.py petstore_api/api/another_fake_api.py petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/fake_classname_tags123_api.py petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py diff --git a/samples/client/petstore/python-tornado/petstore_api/__init__.py b/samples/client/petstore/python-tornado/petstore_api/__init__.py index b9fdaf07ac19..62a0d6bb97f5 100644 --- a/samples/client/petstore/python-tornado/petstore_api/__init__.py +++ b/samples/client/petstore/python-tornado/petstore_api/__init__.py @@ -19,7 +19,7 @@ # import apis into sdk package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-tornado/petstore_api/api/__init__.py b/samples/client/petstore/python-tornado/petstore_api/api/__init__.py index 74496adb5a2b..ea4a9e3acb7d 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/__init__.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/__init__.py @@ -5,7 +5,7 @@ # import apis into api package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py new file mode 100644 index 000000000000..2b46147fed58 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_classname(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + :param body: client model (required) + :type body: Client + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: Client + """ + kwargs['_return_http_data_only'] = True + return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 + + def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: client model (required) + :type body: Client + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_classname" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key_query'] # noqa: E501 + + response_types_map = { + 200: "Client", + } + + return self.api_client.call_api( + '/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/client/petstore/python-tornado/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-tornado/test/test_fake_classname_tags123_api.py new file mode 100644 index 000000000000..f54e0d06644f --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_fake_classname_tags123_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/.openapi-generator/FILES b/samples/client/petstore/python/.openapi-generator/FILES index a5adeaaddc68..417028fbd1f8 100644 --- a/samples/client/petstore/python/.openapi-generator/FILES +++ b/samples/client/petstore/python/.openapi-generator/FILES @@ -76,7 +76,7 @@ petstore_api/__init__.py petstore_api/api/__init__.py petstore_api/api/another_fake_api.py petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/fake_classname_tags123_api.py petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py diff --git a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md index af671645dd65..411d4bb4b745 100644 --- a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -21,7 +21,7 @@ To test class name in snake case ```python import time import petstore_api -from petstore_api.api import fake_classname_tags_123_api +from petstore_api.api import fake_classname_tags123_api from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 @@ -44,7 +44,7 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) + api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) body = Client( client="client_example", ) # Client | client model diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py new file mode 100644 index 000000000000..76e35824fbe1 --- /dev/null +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -0,0 +1,161 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.api_client import ApiClient, Endpoint as _Endpoint +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from petstore_api.model.client import Client + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.test_classname_endpoint = _Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [ + 'api_key_query' + ], + 'endpoint_path': '/fake_classname_test', + 'operation_id': 'test_classname', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def test_classname( + self, + body, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.test_classname_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python/petstore_api/apis/__init__.py b/samples/client/petstore/python/petstore_api/apis/__init__.py index e4c52458a0c2..302dcf25c447 100644 --- a/samples/client/petstore/python/petstore_api/apis/__init__.py +++ b/samples/client/petstore/python/petstore_api/apis/__init__.py @@ -16,7 +16,7 @@ # Import APIs into API package: from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python/test/test_fake_classname_tags123_api.py new file mode 100644 index 000000000000..cf77b62fab70 --- /dev/null +++ b/samples/client/petstore/python/test/test_fake_classname_tags123_api.py @@ -0,0 +1,35 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES index a5adeaaddc68..417028fbd1f8 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES @@ -76,7 +76,7 @@ petstore_api/__init__.py petstore_api/api/__init__.py petstore_api/api/another_fake_api.py petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/fake_classname_tags123_api.py petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md index af671645dd65..411d4bb4b745 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md @@ -21,7 +21,7 @@ To test class name in snake case ```python import time import petstore_api -from petstore_api.api import fake_classname_tags_123_api +from petstore_api.api import fake_classname_tags123_api from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 @@ -44,7 +44,7 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) + api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) body = Client( client="client_example", ) # Client | client model diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py new file mode 100644 index 000000000000..76e35824fbe1 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py @@ -0,0 +1,161 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.api_client import ApiClient, Endpoint as _Endpoint +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from petstore_api.model.client import Client + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.test_classname_endpoint = _Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [ + 'api_key_query' + ], + 'endpoint_path': '/fake_classname_test', + 'operation_id': 'test_classname', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def test_classname( + self, + body, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.test_classname_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py index e4c52458a0c2..302dcf25c447 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py @@ -16,7 +16,7 @@ # Import APIs into API package: from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py new file mode 100644 index 000000000000..cf77b62fab70 --- /dev/null +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py @@ -0,0 +1,35 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES index b6fc57881bd3..4b8573e41171 100755 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES @@ -61,7 +61,7 @@ petstore_api/api/__init__.py petstore_api/api/another_fake_api.py petstore_api/api/default_api.py petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/fake_classname_tags123_api.py petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py index c5b730adc53d..420638f92939 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py @@ -20,7 +20,7 @@ from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.default_api import DefaultApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py index fa4e54a80091..bc45197c40f0 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/__init__.py @@ -6,7 +6,7 @@ from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.default_api import DefaultApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py new file mode 100644 index 000000000000..1dd90624e719 --- /dev/null +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_classname(self, client, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(client, async_req=True) + >>> result = thread.get() + + :param client: client model (required) + :type client: Client + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: Client + """ + kwargs['_return_http_data_only'] = True + return self.test_classname_with_http_info(client, **kwargs) # noqa: E501 + + def test_classname_with_http_info(self, client, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname_with_http_info(client, async_req=True) + >>> result = thread.get() + + :param client: client model (required) + :type client: Client + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'client' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_classname" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'client' is set + if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501 + local_var_params['client'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `client` when calling `test_classname`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'client' in local_var_params: + body_params = local_var_params['client'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key_query'] # noqa: E501 + + response_types_map = { + 200: "Client", + } + + return self.api_client.call_api( + '/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py new file mode 100644 index 000000000000..f54e0d06644f --- /dev/null +++ b/samples/openapi3/client/petstore/python-legacy/test/test_fake_classname_tags123_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index 68c32cfe7066..ce697552769f 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -111,7 +111,7 @@ petstore_api/api/__init__.py petstore_api/api/another_fake_api.py petstore_api/api/default_api.py petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/fake_classname_tags123_api.py petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py diff --git a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md index a83c7e539499..57b52cf8fdad 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -21,7 +21,7 @@ To test class name in snake case ```python import time import petstore_api -from petstore_api.api import fake_classname_tags_123_api +from petstore_api.api import fake_classname_tags123_api from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 @@ -44,7 +44,7 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) + api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) client = Client( client="client_example", ) # Client | client model diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py new file mode 100644 index 000000000000..0284c348b363 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -0,0 +1,161 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.api_client import ApiClient, Endpoint as _Endpoint +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from petstore_api.model.client import Client + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.test_classname_endpoint = _Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [ + 'api_key_query' + ], + 'endpoint_path': '/fake_classname_test', + 'operation_id': 'test_classname', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'client', + ], + 'required': [ + 'client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client': + (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def test_classname( + self, + client, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(client, async_req=True) + >>> result = thread.get() + + Args: + client (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['client'] = \ + client + return self.test_classname_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py index 24c40abbed0e..2fec461eafed 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py @@ -17,7 +17,7 @@ from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.default_api import DefaultApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/test/test_fake_classname_tags123_api.py new file mode 100644 index 000000000000..cf77b62fab70 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_fake_classname_tags123_api.py @@ -0,0 +1,35 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() From 5346d0b6b7562bf7b4168c57d5e296e01c16ce3f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 14 Feb 2022 11:45:12 +0800 Subject: [PATCH 055/111] update samples --- .../README.md | 4 +- .../api/fake_classname_tags123_api.py | 5 +- .../api/fake_classname_tags123_api.py | 5 +- .../api/fake_classname_tags123_api.py | 5 +- .../api/fake_classname_tags123_api.py | 7 + .../api/fake_classname_tags123_api.py | 7 + .../.openapi-generator/FILES | 3 +- .../docs/FakeClassnameTags123Api.md | 4 +- .../api/fake_classname_tags123_api.py | 25 +++ .../classname.py | 170 ++++++++++++++++++ .../petstore_api/apis/__init__.py | 2 +- .../test/test_fake_classname_tags123_api.py | 36 ++++ .../api/fake_classname_tags123_api.py | 5 +- .../api/fake_classname_tags123_api.py | 7 + 14 files changed, 271 insertions(+), 14 deletions(-) create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api_endpoints/classname.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags123_api.py diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/README.md index 58766deeff22..0026fcb3f1a1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/README.md @@ -8,7 +8,7 @@ $properties = @( 'apiName=Api', 'targetFramework=netstandard2.0', 'validatable=true', - 'nullableReferenceTypes=false', + 'nullableReferenceTypes=', 'hideGenerationTimestamp=true', 'packageVersion=1.0.0', 'packageAuthors=OpenAPI', @@ -232,7 +232,7 @@ Authentication schemes defined for the API: - modelPropertyNaming: - netCoreProjectFile: false - nonPublicApi: false -- nullableReferenceTypes: false +- nullableReferenceTypes: - optionalAssemblyInfo: - optionalEmitDefaultValues: false - optionalMethodArgument: true diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py index 2b46147fed58..b5cd8cd22c94 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py @@ -114,7 +114,8 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py index 2b46147fed58..b5cd8cd22c94 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py @@ -114,7 +114,8 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py index 2b46147fed58..b5cd8cd22c94 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py @@ -114,7 +114,8 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index 76e35824fbe1..70b4a535a815 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -121,6 +121,10 @@ def test_classname( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -152,6 +156,9 @@ def test_classname( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py index 76e35824fbe1..70b4a535a815 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py @@ -121,6 +121,10 @@ def test_classname( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -152,6 +156,9 @@ def test_classname( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES index 48127260f213..c44ad090edd2 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -134,7 +134,7 @@ petstore_api/api/__init__.py petstore_api/api/another_fake_api.py petstore_api/api/default_api.py petstore_api/api/fake_api.py -petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/fake_classname_tags123_api.py petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py @@ -271,4 +271,5 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_fake_classname_tags123_api.py tox.ini diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 6d5c732f70e0..f5ddd9538973 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -18,7 +18,7 @@ To test class name in snake case * Api Key Authentication (api_key_query): ```python import petstore_api -from petstore_api.api import fake_classname_tags_123_api +from petstore_api.api import fake_classname_tags123_api from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 @@ -40,7 +40,7 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) + api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) # example passing only required values which don't have defaults set body = Client( diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api.py new file mode 100644 index 000000000000..ce7cfd29f70e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from petstore_api.api_client import ApiClient +from petstore_api.api.fake_classname_tags123_api_endpoints.classname import Classname + + +class FakeClassnameTags123Api( + Classname, + ApiClient, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api_endpoints/classname.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api_endpoints/classname.py new file mode 100644 index 000000000000..d4839bb9b699 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api_endpoints/classname.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.client import Client + +# body param +SchemaForRequestBodyApplicationJson = Client + + +request_body_client = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/fake_classname_test' +_method = 'PATCH' +_auth = [ + 'api_key_query', +] +SchemaFor200ResponseBodyApplicationJson = Client + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class Classname(api_client.Api): + + def classname( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + To test class name in snake case + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_client.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py index 5a98862bba09..6b58c42daa6f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py @@ -18,7 +18,7 @@ from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.default_api import DefaultApi from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags123_api.py new file mode 100644 index 000000000000..705fd1fc9cdf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags123_api.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api # noqa: E501 + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_classname(self): + """Test case for classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py index 1dd90624e719..05c1c8a0e4ff 100644 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py @@ -114,7 +114,8 @@ def test_classname_with_http_info(self, client, **kwargs): # noqa: E501 '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ def test_classname_with_http_info(self, client, **kwargs): # noqa: E501 query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index 0284c348b363..a6c187b02518 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -121,6 +121,10 @@ def test_classname( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -152,6 +156,9 @@ def test_classname( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') From ec51e9cd0b1b2b75fa42596ac8abac7ff85ed22e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 14 Feb 2022 12:54:26 +0800 Subject: [PATCH 056/111] update samples --- .../client/petstore/python-experimental/.openapi-generator/FILES | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES index c44ad090edd2..9a12a513393b 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -271,5 +271,4 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_fake_classname_tags123_api.py tox.ini From 905e59c238c5648fdfd4cfdc40f487a8b7210586 Mon Sep 17 00:00:00 2001 From: Juan Treminio Date: Mon, 14 Feb 2022 03:38:16 -0600 Subject: [PATCH 057/111] [PHP] Allows passing filename to deserialize (#11582) * Allows passing filename to deserialize * Code review changes --- .../src/main/resources/php/ObjectSerializer.mustache | 3 +++ .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 3 +++ .../php/OpenAPIClient-php/tests/ObjectSerializerTest.php | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index 7d48d3557c34..61b146fd9d92 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -20,6 +20,7 @@ namespace {{invokerPackage}}; use {{modelPackage}}\ModelInterface; +use GuzzleHttp\Psr7\Utils; /** * ObjectSerializer Class Doc Comment @@ -337,6 +338,8 @@ class ObjectSerializer } if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 840e4d934149..9bd27f580625 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -29,6 +29,7 @@ namespace OpenAPI\Client; use OpenAPI\Client\Model\ModelInterface; +use GuzzleHttp\Psr7\Utils; /** * ObjectSerializer Class Doc Comment @@ -346,6 +347,8 @@ public static function deserialize($data, $class, $httpHeaders = null) } if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php index 9c4e86d5bf1e..bb919ffaa668 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php @@ -4,7 +4,6 @@ use GuzzleHttp\Psr7\Utils; use PHPUnit\Framework\TestCase; -use Psr\Http\Message\StreamInterface; // test object serializer class ObjectSerializerTest extends TestCase @@ -34,7 +33,7 @@ public function testSanitizeFilename() * @covers ObjectSerializer::serialize * @dataProvider provideFileStreams */ - public function testDeserializeFile(StreamInterface $stream, ?array $httpHeaders = null, ?string $expectedFilename = null): void + public function testDeserializeFile($stream, ?array $httpHeaders = null, ?string $expectedFilename = null): void { $s = new ObjectSerializer(); @@ -62,6 +61,11 @@ public function provideFileStreams() ['Content-Disposition' => 'inline; filename=\'foobar.php\''], 'foobar.php', ], + 'File path' => [ + __FILE__, + null, + null, + ], ]; } From 380aaa55a187b90c800e7d6c0ac44d43e5d1cf14 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 14 Feb 2022 17:54:31 +0800 Subject: [PATCH 058/111] Remove JDK7 support from Java Spring generators (#11561) * remove jdk8 support from spring generators * update tests, remove commented code in AbstractJavaCodegen * add back implementation * add back import * generate code for non reactive --- .../languages/AbstractJavaCodegen.java | 14 +- .../codegen/languages/SpringCodegen.java | 55 +-- .../main/resources/JavaSpring/api.mustache | 2 +- .../JavaSpring/apiController.mustache | 45 +-- .../resources/JavaSpring/apiDelegate.mustache | 13 +- .../resources/JavaSpring/methodBody.mustache | 23 +- .../main/resources/JavaSpring/model.mustache | 2 - .../java/spring/SpringCodegenTest.java | 19 +- .../openapitools/api/PetApiController.java | 242 +++++++++++- .../openapitools/api/StoreApiController.java | 119 +++++- .../openapitools/api/UserApiController.java | 167 ++++++++- .../org/openapitools/api/AnotherFakeApi.java | 24 +- .../api/AnotherFakeApiController.java | 28 +- .../java/org/openapitools/api/FakeApi.java | 140 +++++-- .../openapitools/api/FakeApiController.java | 56 +-- .../api/FakeClassnameTestApi.java | 24 +- .../api/FakeClassnameTestApiController.java | 28 +- .../java/org/openapitools/api/PetApi.java | 115 +++++- .../openapitools/api/PetApiController.java | 100 ++--- .../java/org/openapitools/api/StoreApi.java | 64 +++- .../openapitools/api/StoreApiController.java | 62 +-- .../java/org/openapitools/api/UserApi.java | 78 +++- .../openapitools/api/UserApiController.java | 38 +- .../model/AdditionalPropertiesAnyType.java | 1 + .../model/AdditionalPropertiesArray.java | 1 + .../model/AdditionalPropertiesBoolean.java | 1 + .../model/AdditionalPropertiesClass.java | 1 + .../model/AdditionalPropertiesInteger.java | 1 + .../model/AdditionalPropertiesNumber.java | 1 + .../model/AdditionalPropertiesObject.java | 1 + .../model/AdditionalPropertiesString.java | 1 + .../java/org/openapitools/model/Animal.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../openapitools/model/ArrayOfNumberOnly.java | 1 + .../org/openapitools/model/ArrayTest.java | 1 + .../java/org/openapitools/model/BigCat.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../openapitools/model/Capitalization.java | 1 + .../main/java/org/openapitools/model/Cat.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ClassModel.java | 1 + .../java/org/openapitools/model/Client.java | 1 + .../main/java/org/openapitools/model/Dog.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../org/openapitools/model/EnumArrays.java | 1 + .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../java/org/openapitools/model/File.java | 1 + .../model/FileSchemaTestClass.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../java/org/openapitools/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NumberOnly.java | 1 + .../java/org/openapitools/model/Order.java | 1 + .../openapitools/model/OuterComposite.java | 1 + .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../org/openapitools/model/ReadOnlyFirst.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../main/java/org/openapitools/model/Tag.java | 1 + .../openapitools/model/TypeHolderDefault.java | 1 + .../openapitools/model/TypeHolderExample.java | 1 + .../java/org/openapitools/model/User.java | 1 + .../java/org/openapitools/model/XmlItem.java | 1 + .../api/AnotherFakeApiController.java | 42 ++- .../openapitools/api/FakeApiController.java | 312 ++++++++++++++- .../api/FakeClassnameTestApiController.java | 42 ++- .../openapitools/api/PetApiController.java | 157 +++++++- .../openapitools/api/StoreApiController.java | 87 ++++- .../openapitools/api/UserApiController.java | 145 ++++++- .../api/AnotherFakeApiController.java | 52 ++- .../openapitools/api/FakeApiController.java | 346 ++++++++++++++++- .../api/FakeClassnameTestApiController.java | 52 ++- .../openapitools/api/PetApiController.java | 214 ++++++++++- .../openapitools/api/StoreApiController.java | 119 +++++- .../openapitools/api/UserApiController.java | 167 ++++++++- .../api/AnotherFakeApiController.java | 28 +- .../openapitools/api/FakeApiController.java | 38 +- .../api/FakeClassnameTestApiController.java | 28 +- .../openapitools/api/PetApiController.java | 30 +- .../openapitools/api/StoreApiController.java | 29 +- .../openapitools/api/UserApiController.java | 30 +- .../openapitools/api/PetApiController.java | 235 +++++++++++- .../openapitools/api/StoreApiController.java | 112 +++++- .../openapitools/api/UserApiController.java | 160 +++++++- .../api/AnotherFakeApiController.java | 52 ++- .../openapitools/api/FakeApiController.java | 354 +++++++++++++++++- .../api/FakeClassnameTestApiController.java | 52 ++- .../openapitools/api/PetApiController.java | 216 ++++++++++- .../openapitools/api/StoreApiController.java | 119 +++++- .../openapitools/api/UserApiController.java | 167 ++++++++- .../openapitools/api/PetApiController.java | 242 +++++++++++- .../openapitools/api/StoreApiController.java | 119 +++++- .../openapitools/api/UserApiController.java | 167 ++++++++- .../org/openapitools/api/AnotherFakeApi.java | 24 +- .../api/AnotherFakeApiController.java | 28 +- .../java/org/openapitools/api/FakeApi.java | 140 +++++-- .../openapitools/api/FakeApiController.java | 56 ++- .../api/FakeClassnameTestApi.java | 24 +- .../api/FakeClassnameTestApiController.java | 28 +- .../java/org/openapitools/api/PetApi.java | 115 +++++- .../openapitools/api/PetApiController.java | 100 +++-- .../java/org/openapitools/api/StoreApi.java | 64 +++- .../openapitools/api/StoreApiController.java | 62 +-- .../java/org/openapitools/api/UserApi.java | 78 +++- .../openapitools/api/UserApiController.java | 38 +- .../model/AdditionalPropertiesAnyType.java | 1 + .../model/AdditionalPropertiesArray.java | 1 + .../model/AdditionalPropertiesBoolean.java | 1 + .../model/AdditionalPropertiesClass.java | 1 + .../model/AdditionalPropertiesInteger.java | 1 + .../model/AdditionalPropertiesNumber.java | 1 + .../model/AdditionalPropertiesObject.java | 1 + .../model/AdditionalPropertiesString.java | 1 + .../java/org/openapitools/model/Animal.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../openapitools/model/ArrayOfNumberOnly.java | 1 + .../org/openapitools/model/ArrayTest.java | 1 + .../java/org/openapitools/model/BigCat.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../openapitools/model/Capitalization.java | 1 + .../main/java/org/openapitools/model/Cat.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ClassModel.java | 1 + .../java/org/openapitools/model/Client.java | 1 + .../main/java/org/openapitools/model/Dog.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../org/openapitools/model/EnumArrays.java | 1 + .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../java/org/openapitools/model/File.java | 1 + .../model/FileSchemaTestClass.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../java/org/openapitools/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NumberOnly.java | 1 + .../java/org/openapitools/model/Order.java | 1 + .../openapitools/model/OuterComposite.java | 1 + .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../org/openapitools/model/ReadOnlyFirst.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../main/java/org/openapitools/model/Tag.java | 1 + .../openapitools/model/TypeHolderDefault.java | 1 + .../openapitools/model/TypeHolderExample.java | 1 + .../java/org/openapitools/model/User.java | 1 + .../java/org/openapitools/model/XmlItem.java | 1 + .../api/AnotherFakeApiController.java | 46 ++- .../openapitools/api/FakeApiController.java | 348 ++++++++++++++++- .../api/FakeClassnameTestApiController.java | 46 ++- .../openapitools/api/PetApiController.java | 210 ++++++++++- .../openapitools/api/StoreApiController.java | 113 +++++- .../openapitools/api/UserApiController.java | 161 +++++++- .../api/AnotherFakeApiController.java | 36 +- .../openapitools/api/FakeApiController.java | 306 ++++++++++++++- .../api/FakeClassnameTestApiController.java | 36 +- .../openapitools/api/PetApiController.java | 151 +++++++- .../openapitools/api/StoreApiController.java | 81 +++- .../openapitools/api/UserApiController.java | 139 ++++++- .../api/AnotherFakeApiController.java | 36 +- .../openapitools/api/FakeApiController.java | 306 ++++++++++++++- .../api/FakeClassnameTestApiController.java | 36 +- .../openapitools/api/PetApiController.java | 151 +++++++- .../openapitools/api/StoreApiController.java | 81 +++- .../openapitools/api/UserApiController.java | 139 ++++++- .../api/AnotherFakeApiController.java | 46 ++- .../openapitools/api/FakeApiController.java | 340 ++++++++++++++++- .../api/FakeClassnameTestApiController.java | 46 ++- .../openapitools/api/PetApiController.java | 208 +++++++++- .../openapitools/api/StoreApiController.java | 113 +++++- .../openapitools/api/UserApiController.java | 161 +++++++- .../api/AnotherFakeApiController.java | 23 +- .../openapitools/api/FakeApiController.java | 33 +- .../api/FakeClassnameTestApiController.java | 23 +- .../openapitools/api/PetApiController.java | 25 +- .../openapitools/api/StoreApiController.java | 24 +- .../openapitools/api/UserApiController.java | 25 +- .../org/openapitools/model/ModelFile.java | 85 ----- .../org/openapitools/api/AnotherFakeApi.java | 10 +- .../api/AnotherFakeApiController.java | 14 +- .../api/AnotherFakeApiDelegate.java | 22 +- .../java/org/openapitools/api/FakeApi.java | 94 +++-- .../openapitools/api/FakeApiController.java | 14 +- .../org/openapitools/api/FakeApiDelegate.java | 124 ++++-- .../api/FakeClassnameTestApi.java | 10 +- .../api/FakeClassnameTestApiController.java | 14 +- .../api/FakeClassnameTestApiDelegate.java | 22 +- .../java/org/openapitools/api/PetApi.java | 52 ++- .../openapitools/api/PetApiController.java | 14 +- .../org/openapitools/api/PetApiDelegate.java | 105 +++++- .../java/org/openapitools/api/StoreApi.java | 28 +- .../openapitools/api/StoreApiController.java | 14 +- .../openapitools/api/StoreApiDelegate.java | 56 ++- .../java/org/openapitools/api/UserApi.java | 52 ++- .../openapitools/api/UserApiController.java | 14 +- .../org/openapitools/api/UserApiDelegate.java | 66 +++- .../model/AdditionalPropertiesAnyType.java | 1 + .../model/AdditionalPropertiesArray.java | 1 + .../model/AdditionalPropertiesBoolean.java | 1 + .../model/AdditionalPropertiesClass.java | 1 + .../model/AdditionalPropertiesInteger.java | 1 + .../model/AdditionalPropertiesNumber.java | 1 + .../model/AdditionalPropertiesObject.java | 1 + .../model/AdditionalPropertiesString.java | 1 + .../java/org/openapitools/model/Animal.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../openapitools/model/ArrayOfNumberOnly.java | 1 + .../org/openapitools/model/ArrayTest.java | 1 + .../openapitools/model/Capitalization.java | 1 + .../main/java/org/openapitools/model/Cat.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ClassModel.java | 1 + .../java/org/openapitools/model/Client.java | 1 + .../main/java/org/openapitools/model/Dog.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../org/openapitools/model/EnumArrays.java | 1 + .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../java/org/openapitools/model/File.java | 1 + .../model/FileSchemaTestClass.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../java/org/openapitools/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NumberOnly.java | 1 + .../java/org/openapitools/model/Order.java | 1 + .../openapitools/model/OuterComposite.java | 1 + .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../org/openapitools/model/ReadOnlyFirst.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../main/java/org/openapitools/model/Tag.java | 1 + .../openapitools/model/TypeHolderDefault.java | 1 + .../openapitools/model/TypeHolderExample.java | 1 + .../java/org/openapitools/model/User.java | 1 + .../java/org/openapitools/model/XmlItem.java | 1 + .../api/AnotherFakeApiController.java | 36 +- .../openapitools/api/FakeApiController.java | 306 ++++++++++++++- .../api/FakeClassnameTestApiController.java | 36 +- .../openapitools/api/PetApiController.java | 154 +++++++- .../openapitools/api/StoreApiController.java | 81 +++- .../openapitools/api/UserApiController.java | 139 ++++++- .../org/openapitools/api/AnotherFakeApi.java | 24 +- .../api/AnotherFakeApiController.java | 28 +- .../java/org/openapitools/api/FakeApi.java | 140 +++++-- .../openapitools/api/FakeApiController.java | 56 ++- .../api/FakeClassnameTestApi.java | 24 +- .../api/FakeClassnameTestApiController.java | 28 +- .../java/org/openapitools/api/PetApi.java | 115 +++++- .../openapitools/api/PetApiController.java | 100 +++-- .../java/org/openapitools/api/StoreApi.java | 64 +++- .../openapitools/api/StoreApiController.java | 62 +-- .../java/org/openapitools/api/UserApi.java | 78 +++- .../openapitools/api/UserApiController.java | 38 +- .../model/AdditionalPropertiesAnyType.java | 1 + .../model/AdditionalPropertiesArray.java | 1 + .../model/AdditionalPropertiesBoolean.java | 1 + .../model/AdditionalPropertiesClass.java | 1 + .../model/AdditionalPropertiesInteger.java | 1 + .../model/AdditionalPropertiesNumber.java | 1 + .../model/AdditionalPropertiesObject.java | 1 + .../model/AdditionalPropertiesString.java | 1 + .../java/org/openapitools/model/Animal.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../openapitools/model/ArrayOfNumberOnly.java | 1 + .../org/openapitools/model/ArrayTest.java | 1 + .../openapitools/model/Capitalization.java | 1 + .../main/java/org/openapitools/model/Cat.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ClassModel.java | 1 + .../java/org/openapitools/model/Client.java | 1 + .../main/java/org/openapitools/model/Dog.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../org/openapitools/model/EnumArrays.java | 1 + .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../java/org/openapitools/model/File.java | 1 + .../model/FileSchemaTestClass.java | 1 + .../org/openapitools/model/FormatTest.java | 1 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../java/org/openapitools/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelList.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NumberOnly.java | 1 + .../java/org/openapitools/model/Order.java | 1 + .../openapitools/model/OuterComposite.java | 1 + .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../org/openapitools/model/ReadOnlyFirst.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../main/java/org/openapitools/model/Tag.java | 1 + .../openapitools/model/TypeHolderDefault.java | 1 + .../openapitools/model/TypeHolderExample.java | 1 + .../java/org/openapitools/model/User.java | 1 + .../java/org/openapitools/model/XmlItem.java | 1 + .../api/AnotherFakeApiController.java | 46 ++- .../openapitools/api/FakeApiController.java | 348 ++++++++++++++++- .../api/FakeClassnameTestApiController.java | 46 ++- .../openapitools/api/PetApiController.java | 213 ++++++++++- .../openapitools/api/StoreApiController.java | 113 +++++- .../openapitools/api/UserApiController.java | 161 +++++++- .../api/AnotherFakeApiController.java | 46 ++- .../openapitools/api/FakeApiController.java | 348 ++++++++++++++++- .../api/FakeClassnameTestApiController.java | 46 ++- .../openapitools/api/PetApiController.java | 210 ++++++++++- .../openapitools/api/StoreApiController.java | 113 +++++- .../openapitools/api/UserApiController.java | 161 +++++++- .../api/AnotherFakeApiController.java | 46 ++- .../virtualan/api/FakeApiController.java | 348 ++++++++++++++++- .../api/FakeClassnameTestApiController.java | 46 ++- .../virtualan/api/PetApiController.java | 210 ++++++++++- .../virtualan/api/StoreApiController.java | 113 +++++- .../virtualan/api/UserApiController.java | 161 +++++++- .../api/AnotherFakeApiController.java | 46 ++- .../openapitools/api/FakeApiController.java | 348 ++++++++++++++++- .../api/FakeClassnameTestApiController.java | 46 ++- .../openapitools/api/PetApiController.java | 210 ++++++++++- .../openapitools/api/StoreApiController.java | 113 +++++- .../openapitools/api/UserApiController.java | 161 +++++++- 344 files changed, 14807 insertions(+), 1016 deletions(-) delete mode 100644 samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 350e8c765fe2..a99db97e96af 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -884,13 +884,7 @@ public String toDefaultValue(Schema schema) { pattern = "new " + arrInstantiationType + "<%s>()"; } - Schema items = getSchemaItems((ArraySchema) schema); - - // comment out below for JDK7 - //String typeDeclaration = getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, items)); - String typeDeclaration = ""; - - return String.format(Locale.ROOT, pattern, typeDeclaration); + return String.format(Locale.ROOT, pattern, ""); } else if (ModelUtils.isMapSchema(schema) && !(schema instanceof ComposedSchema)) { if (schema.getProperties() != null && schema.getProperties().size() > 0) { // object is complex object with free-form additional properties @@ -907,11 +901,7 @@ public String toDefaultValue(Schema schema) { return null; } - // comment out below for JDK7 - //String typeDeclaration = String.format(Locale.ROOT, "String, %s", getTypeDeclaration(getAdditionalProperties(schema))); - String typeDeclaration = ""; - - return String.format(Locale.ROOT, pattern, typeDeclaration); + return String.format(Locale.ROOT, pattern, ""); } else if (ModelUtils.isIntegerSchema(schema)) { if (schema.getDefault() != null) { if (SchemaTypeUtil.INTEGER64_FORMAT.equals(schema.getFormat())) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 93cb9dcf0ccf..0ed2ddcec8f4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -79,7 +79,6 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String VIRTUAL_SERVICE = "virtualService"; public static final String SKIP_DEFAULT_INTERFACE = "skipDefaultInterface"; - public static final String JAVA_8 = "java8"; public static final String ASYNC = "async"; public static final String REACTIVE = "reactive"; public static final String RESPONSE_WRAPPER = "responseWrapper"; @@ -103,7 +102,6 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean delegatePattern = false; protected boolean delegateMethod = false; protected boolean singleContentTypes = false; - protected boolean java8 = true; protected boolean async = false; protected boolean reactive = false; protected String responseWrapper = ""; @@ -274,13 +272,7 @@ public void processOpts() { // Process java8 option before common java ones to change the default // dateLibrary to java8. LOGGER.info("----------------------------------"); - if (additionalProperties.containsKey(JAVA_8)) { - this.setJava8(Boolean.parseBoolean(additionalProperties.get(JAVA_8).toString())); - additionalProperties.put(JAVA_8, java8); - LOGGER.warn( - "java8 option has been deprecated as it's set to true by default (JDK7 support has been deprecated)"); - } - if (java8 && !additionalProperties.containsKey(DATE_LIBRARY)) { + if (!additionalProperties.containsKey(DATE_LIBRARY)) { setDateLibrary("java8"); } @@ -425,14 +417,8 @@ public void processOpts() { } if (interfaceOnly && delegatePattern) { - if (java8) { - delegateMethod = true; - additionalProperties.put("delegate-method", true); - } else { - throw new IllegalArgumentException( - String.format(Locale.ROOT, "Can not generate code with `%s` and `%s` true while `%s` is false.", - DELEGATE_PATTERN, INTERFACE_ONLY, JAVA_8)); - } + delegateMethod = true; + additionalProperties.put("delegate-method", true); } supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); @@ -499,7 +485,7 @@ public void processOpts() { } } - if ((!delegatePattern && java8) || delegateMethod) { + if (!delegatePattern || delegateMethod) { additionalProperties.put("jdk8-no-delegate", true); } @@ -508,27 +494,22 @@ public void processOpts() { apiTemplateFiles.put("apiDelegate.mustache", "Delegate.java"); } - if (java8) { - additionalProperties.put("javaVersion", "1.8"); - if (SPRING_CLOUD_LIBRARY.equals(library)) { - additionalProperties.put("jdk8-default-interface", false); - } else { - additionalProperties.put("jdk8-default-interface", !skipDefaultInterface); - } - additionalProperties.put("jdk8", true); - if (async) { - additionalProperties.put(RESPONSE_WRAPPER, "CompletableFuture"); - } - if (reactive) { - additionalProperties.put(RESPONSE_WRAPPER, "Mono"); - } - } else if (async) { - additionalProperties.put(RESPONSE_WRAPPER, "Callable"); + additionalProperties.put("javaVersion", "1.8"); + if (SPRING_CLOUD_LIBRARY.equals(library)) { + additionalProperties.put("jdk8-default-interface", false); + } else { + additionalProperties.put("jdk8-default-interface", !skipDefaultInterface); + } + + if (async) { + additionalProperties.put(RESPONSE_WRAPPER, "CompletableFuture"); + } + if (reactive) { + additionalProperties.put(RESPONSE_WRAPPER, "Mono"); } // Some well-known Spring or Spring-Cloud response wrappers if (isNotEmpty(responseWrapper)) { - additionalProperties.put("jdk8", false); additionalProperties.put("jdk8-default-interface", false); switch (responseWrapper) { case "Future": @@ -846,10 +827,6 @@ public void setSkipDefaultInterface(boolean skipDefaultInterface) { this.skipDefaultInterface = skipDefaultInterface; } - public void setJava8(boolean java8) { - this.java8 = java8; - } - public void setVirtualService(boolean virtualService) { this.virtualService = virtualService; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index 284c23118ed8..07b5818dc318 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -64,7 +64,7 @@ import java.util.Optional; {{/useOptional}} {{/jdk8-no-delegate}} {{#async}} -import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture{{/jdk8}}; +import java.util.concurrent.CompletableFuture; {{/async}} import javax.annotation.Generated; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache index 374fe9eaa8c9..babbfd3db810 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache @@ -1,8 +1,8 @@ package {{package}}; -{{^jdk8}} {{#imports}}import {{import}}; {{/imports}} + {{#swagger2AnnotationLibrary}} import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -12,52 +12,35 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; {{/swagger2AnnotationLibrary}} -{{^swagger1AnnotationLibrary}} +{{#swagger1AnnotationLibrary}} import io.swagger.annotations.*; {{/swagger1AnnotationLibrary}} + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -{{/jdk8}} import org.springframework.stereotype.Controller; -{{^jdk8}} import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; -{{/jdk8}} import org.springframework.web.bind.annotation.RequestMapping; -{{^jdk8}} import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -{{/jdk8}} -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.multipart.MultipartFile; {{^isDelegate}} import org.springframework.web.context.request.NativeWebRequest; {{/isDelegate}} -{{^jdk8}} -import org.springframework.web.multipart.MultipartFile; {{#useBeanValidation}} import javax.validation.constraints.*; import javax.validation.Valid; {{/useBeanValidation}} -{{/jdk8}} -{{#jdk8}} -import java.util.Optional; -{{/jdk8}} -{{^jdk8}} -{{#useOptional}} -import java.util.Optional; -{{/useOptional}} -{{/jdk8}} -{{^jdk8}} + import java.util.List; import java.util.Map; -{{#async}} -import java.util.concurrent.Callable; -{{/async}} -{{/jdk8}} +import java.util.Optional; import javax.annotation.Generated; {{>generatedAnnotation}} @@ -72,7 +55,6 @@ public class {{classname}}Controller implements {{classname}} { private final {{classname}}Delegate delegate; public {{classname}}Controller(@Autowired(required = false) {{classname}}Delegate delegate) { - {{#jdk8}} this.delegate = Optional.ofNullable(delegate).orElse(new {{classname}}Delegate() {}); } @@ -80,34 +62,25 @@ public class {{classname}}Controller implements {{classname}} { public {{classname}}Delegate getDelegate() { return delegate; } - {{/jdk8}} - {{^jdk8}} - this.delegate = delegate; - } - {{/jdk8}} {{/isDelegate}} {{^isDelegate}} {{^reactive}} - {{^jdk8}} - {{/jdk8}} private final NativeWebRequest request; @Autowired public {{classname}}Controller(NativeWebRequest request) { this.request = request; } - {{#jdk8}} @Override public Optional getRequest() { return Optional.ofNullable(request); } - {{/jdk8}} {{/reactive}} {{/isDelegate}} -{{^jdk8}} +{{^reactive}} {{#operation}} /** * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}} @@ -153,6 +126,6 @@ public class {{classname}}Controller implements {{classname}} { } {{/operation}} -{{/jdk8}} +{{/reactive}} } {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache index 4272dd2f0be5..de880d27c7a8 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache @@ -2,14 +2,10 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -{{#jdk8}} import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -{{/jdk8}} import org.springframework.http.ResponseEntity; -{{#jdk8}} import org.springframework.web.context.request.NativeWebRequest; -{{/jdk8}} import org.springframework.web.multipart.MultipartFile; {{#reactive}} import org.springframework.web.server.ServerWebExchange; @@ -20,16 +16,9 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; -{{#jdk8}} import java.util.Optional; -{{/jdk8}} -{{^jdk8}} - {{#useOptional}} -import java.util.Optional; - {{/useOptional}} -{{/jdk8}} {{#async}} -import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture{{/jdk8}}; +import java.util.concurrent.CompletableFuture; {{/async}} import javax.annotation.Generated; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache index b2f8edeb8084..28a6ea60ac03 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache @@ -1,32 +1,27 @@ {{^reactive}} {{#examples}} {{#-first}} - {{#jdk8}} {{#async}} return CompletableFuture.supplyAsync(()-> { {{/async}}getRequest().ifPresent(request -> { -{{#async}} {{/async}} {{/jdk8}}for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { +{{#async}} {{/async}} for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { {{/-first}} -{{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) { -{{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} String exampleString = {{>exampleString}}; -{{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} ApiUtil.setExampleResponse(request, "{{{contentType}}}", exampleString); -{{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} break; -{{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} } +{{#async}} {{/async}}{{^async}} {{/async}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) { +{{#async}} {{/async}}{{^async}} {{/async}} String exampleString = {{>exampleString}}; +{{#async}} {{/async}}{{^async}} {{/async}} ApiUtil.setExampleResponse(request, "{{{contentType}}}", exampleString); +{{#async}} {{/async}}{{^async}} {{/async}} break; +{{#async}} {{/async}}{{^async}} {{/async}} } {{#-last}} -{{#async}} {{/async}}{{^async}}{{#jdk8}} {{/jdk8}}{{/async}} } - {{#jdk8}} +{{#async}} {{/async}}{{^async}} {{/async}} } {{#async}} {{/async}} }); - {{/jdk8}} {{#async}} {{/async}} return new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); - {{#jdk8}} {{#async}} }, Runnable::run); {{/async}} - {{/jdk8}} {{/-last}} {{/examples}} {{^examples}} -return {{#jdk8}}{{#async}}CompletableFuture.completedFuture({{/async}}{{/jdk8}}new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}){{#jdk8}}{{#async}}){{/async}}{{/jdk8}}; +return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}){{#async}}){{/async}}; {{/examples}} {{/reactive}} {{#reactive}} @@ -49,4 +44,4 @@ Mono result = Mono.empty(); exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); {{/examples}} return result.then(Mono.empty()); -{{/reactive}} \ No newline at end of file +{{/reactive}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache index 9261660fe365..077ba5d8719a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache @@ -10,9 +10,7 @@ import org.openapitools.jackson.nullable.JsonNullable; {{#serializableModel}} import java.io.Serializable; {{/serializableModel}} -{{#jdk8}} import java.time.OffsetDateTime; -{{/jdk8}} {{#useBeanValidation}} import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 997a1a2ab0c0..2c62cecc8c38 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -250,11 +250,11 @@ public void generateFormatForDateAndDateTimeQueryParam() throws IOException { @Test public void interfaceDefaultImplDisableWithResponseWrapper() { final SpringCodegen codegen = new SpringCodegen(); - codegen.additionalProperties().put(SpringCodegen.JAVA_8, true); codegen.additionalProperties().put(RESPONSE_WRAPPER, "aWrapper"); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get("jdk8"), false); + // jdk8 tag has been removed + Assert.assertEquals(codegen.additionalProperties().get("jdk8"), null); } @Test(expectedExceptions = IllegalArgumentException.class) @@ -331,7 +331,6 @@ public void shouldGenerateRequestParamForRefParams_3248_RegressionDates() throws @Test public void springcloudWithAsyncAndJava8HasResponseWrapperCompletableFuture() { final SpringCodegen codegen = new SpringCodegen(); - codegen.additionalProperties().put(SpringCodegen.JAVA_8, true); codegen.additionalProperties().put(SpringCodegen.ASYNC, true); codegen.additionalProperties().put(CodegenConstants.LIBRARY, "spring-cloud"); codegen.processOpts(); @@ -340,22 +339,9 @@ public void springcloudWithAsyncAndJava8HasResponseWrapperCompletableFuture() { Assert.assertEquals(codegen.additionalProperties().get(RESPONSE_WRAPPER), "CompletableFuture"); } - @Test - public void springcloudWithAsyncHasResponseWrapperCallable() { - final SpringCodegen codegen = new SpringCodegen(); - codegen.additionalProperties().put(SpringCodegen.JAVA_8, false); - codegen.additionalProperties().put(SpringCodegen.ASYNC, true); - codegen.additionalProperties().put(CodegenConstants.LIBRARY, "spring-cloud"); - codegen.processOpts(); - - Assert.assertNull(codegen.additionalProperties().get("jdk8-default-interface")); - Assert.assertEquals(codegen.additionalProperties().get(RESPONSE_WRAPPER), "Callable"); - } - @Test public void springcloudWithJava8DisableJdk8() { final SpringCodegen codegen = new SpringCodegen(); - codegen.additionalProperties().put(SpringCodegen.JAVA_8, true); codegen.additionalProperties().put(CodegenConstants.LIBRARY, "spring-cloud"); codegen.processOpts(); @@ -630,7 +616,6 @@ private void beanValidationForFormatEmail(boolean useBeanValidation, boolean per codegen.setOutputDir(output.getAbsolutePath()); codegen.setUseBeanValidation(useBeanValidation); codegen.setPerformBeanValidation(performBeanValidation); - codegen.setJava8(java8); ClientOptInput input = new ClientOptInput(); input.openAPI(openAPI); diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..9004004154bc 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,36 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +51,217 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..3f6c13886b8e 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,36 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +51,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..1835681b83ad 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,37 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +52,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 7c9284a30a84..653d00e34e9a 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -14,15 +14,19 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -30,6 +34,10 @@ @Tag(name = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -53,8 +61,20 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity call123testSpecialTags( + default ResponseEntity call123testSpecialTags( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 0af2569895c4..ab290864b1d8 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,6 +1,7 @@ package org.openapitools.api; import org.openapitools.model.Client; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -8,7 +9,8 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -20,14 +22,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -42,6 +45,11 @@ public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -53,13 +61,15 @@ public AnotherFakeApiController(NativeWebRequest request) { public ResponseEntity call123testSpecialTags( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index bd45a15847b7..b73a7a2e7a3e 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -24,15 +24,19 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -40,6 +44,10 @@ @Tag(name = "fake", description = "the fake API") public interface FakeApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -60,9 +68,12 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - ResponseEntity createXmlItem( + default ResponseEntity createXmlItem( @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -86,9 +97,12 @@ ResponseEntity createXmlItem( value = "/fake/outer/boolean", produces = { "*/*" } ) - ResponseEntity fakeOuterBooleanSerialize( + default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -112,9 +126,21 @@ ResponseEntity fakeOuterBooleanSerialize( value = "/fake/outer/composite", produces = { "*/*" } ) - ResponseEntity fakeOuterCompositeSerialize( + default ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -138,9 +164,12 @@ ResponseEntity fakeOuterCompositeSerialize( value = "/fake/outer/number", produces = { "*/*" } ) - ResponseEntity fakeOuterNumberSerialize( + default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -164,9 +193,12 @@ ResponseEntity fakeOuterNumberSerialize( value = "/fake/outer/string", produces = { "*/*" } ) - ResponseEntity fakeOuterStringSerialize( + default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -188,9 +220,12 @@ ResponseEntity fakeOuterStringSerialize( value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - ResponseEntity testBodyWithFileSchema( + default ResponseEntity testBodyWithFileSchema( @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -212,10 +247,13 @@ ResponseEntity testBodyWithFileSchema( value = "/fake/body-with-query-params", consumes = { "application/json" } ) - ResponseEntity testBodyWithQueryParams( + default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -241,9 +279,21 @@ ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClientModel( + default ResponseEntity testClientModel( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -284,7 +334,7 @@ ResponseEntity testClientModel( value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEndpointParameters( + default ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, @@ -299,7 +349,10 @@ ResponseEntity testEndpointParameters( @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -331,7 +384,7 @@ ResponseEntity testEndpointParameters( value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEnumParameters( + default ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @@ -340,7 +393,10 @@ ResponseEntity testEnumParameters( @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -367,14 +423,17 @@ ResponseEntity testEnumParameters( method = RequestMethod.DELETE, value = "/fake" ) - ResponseEntity testGroupParameters( + default ResponseEntity testGroupParameters( @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -396,9 +455,12 @@ ResponseEntity testGroupParameters( value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - ResponseEntity testInlineAdditionalProperties( + default ResponseEntity testInlineAdditionalProperties( @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -421,10 +483,13 @@ ResponseEntity testInlineAdditionalProperties( value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testJsonFormData( + default ResponseEntity testJsonFormData( @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -449,13 +514,16 @@ ResponseEntity testJsonFormData( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - ResponseEntity testQueryParameterCollectionFormat( + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -485,10 +553,22 @@ ResponseEntity testQueryParameterCollectionFormat( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFileWithRequiredFile( + default ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index c48b968ffdd7..ac3a061983f5 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -11,6 +11,7 @@ import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -18,7 +19,8 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,14 +32,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -52,6 +55,11 @@ public FakeApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -93,13 +101,15 @@ public ResponseEntity fakeOuterBooleanSerialize( public ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,13 +186,15 @@ public ResponseEntity testBodyWithQueryParams( public ResponseEntity testClientModel( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -351,13 +363,15 @@ public ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 623a96bfa3af..993f4a4b4efa 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -14,15 +14,19 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -30,6 +34,10 @@ @Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -56,8 +64,20 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClassname( + default ResponseEntity testClassname( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 002a76ceef94..f1c2fbe3f7e5 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,6 +1,7 @@ package org.openapitools.api; import org.openapitools.model.Client; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -8,7 +9,8 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -20,14 +22,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -42,6 +45,11 @@ public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -53,13 +61,15 @@ public FakeClassnameTestApiController(NativeWebRequest request) { public ResponseEntity testClassname( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index a4a9df21dc46..beda9edb1469 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -16,15 +16,19 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -32,6 +36,10 @@ @Tag(name = "pet", description = "the pet API") public interface PetApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /pet : Add a new pet to the store * @@ -56,9 +64,12 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity addPet( + default ResponseEntity addPet( @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -85,10 +96,13 @@ ResponseEntity addPet( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - ResponseEntity deletePet( + default ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -119,9 +133,26 @@ ResponseEntity deletePet( value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByStatus( + default ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -153,9 +184,26 @@ ResponseEntity> findPetsByStatus( value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByTags( + default ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -188,9 +236,26 @@ ResponseEntity> findPetsByTags( value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - ResponseEntity getPetById( + default ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -221,9 +286,12 @@ ResponseEntity getPetById( value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity updatePet( + default ResponseEntity updatePet( @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -250,11 +318,14 @@ ResponseEntity updatePet( value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity updatePetWithForm( + default ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -284,10 +355,22 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFile( + default ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index ef7bc64295dd..30a27c715125 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -3,6 +3,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import java.util.Set; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -10,7 +11,8 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -22,14 +24,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -44,6 +47,11 @@ public PetApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * POST /pet : Add a new pet to the store * @@ -88,18 +96,20 @@ public ResponseEntity deletePet( public ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -117,18 +127,20 @@ public ResponseEntity> findPetsByStatus( public ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -146,18 +158,20 @@ public ResponseEntity> findPetsByTags( public ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -211,13 +225,15 @@ public ResponseEntity uploadFile( @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 57565fe8958b..963a60ac29a3 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -15,15 +15,19 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -31,6 +35,10 @@ @Tag(name = "store", description = "the store API") public interface StoreApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -52,9 +60,12 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - ResponseEntity deleteOrder( + default ResponseEntity deleteOrder( @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -81,9 +92,12 @@ ResponseEntity deleteOrder( value = "/store/inventory", produces = { "application/json" } ) - ResponseEntity> getInventory( + default ResponseEntity> getInventory( - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -113,9 +127,26 @@ ResponseEntity> getInventory( value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - ResponseEntity getOrderById( + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -142,8 +173,25 @@ ResponseEntity getOrderById( value = "/store/order", produces = { "application/xml", "application/json" } ) - ResponseEntity placeOrder( + default ResponseEntity placeOrder( @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index f8cbc7b210b9..5de51f6ffb58 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,6 +2,7 @@ import java.util.Map; import org.openapitools.model.Order; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -9,7 +10,8 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -21,14 +23,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -43,6 +46,11 @@ public StoreApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -86,18 +94,20 @@ public ResponseEntity> getInventory( public ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -113,18 +123,20 @@ public ResponseEntity getOrderById( public ResponseEntity placeOrder( @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 3d1a4822bb94..f4555ba9a1d6 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -16,15 +16,19 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -32,6 +36,10 @@ @Tag(name = "user", description = "the user API") public interface UserApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /user : Create user * This can only be done by the logged in user. @@ -51,9 +59,12 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) - ResponseEntity createUser( + default ResponseEntity createUser( @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -74,9 +85,12 @@ ResponseEntity createUser( method = RequestMethod.POST, value = "/user/createWithArray" ) - ResponseEntity createUsersWithArrayInput( + default ResponseEntity createUsersWithArrayInput( @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -97,9 +111,12 @@ ResponseEntity createUsersWithArrayInput( method = RequestMethod.POST, value = "/user/createWithList" ) - ResponseEntity createUsersWithListInput( + default ResponseEntity createUsersWithListInput( @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -123,9 +140,12 @@ ResponseEntity createUsersWithListInput( method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser( + default ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -154,9 +174,26 @@ ResponseEntity deleteUser( value = "/user/{username}", produces = { "application/xml", "application/json" } ) - ResponseEntity getUserByName( + default ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -184,10 +221,13 @@ ResponseEntity getUserByName( value = "/user/login", produces = { "application/xml", "application/json" } ) - ResponseEntity loginUser( + default ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -207,9 +247,12 @@ ResponseEntity loginUser( method = RequestMethod.GET, value = "/user/logout" ) - ResponseEntity logoutUser( + default ResponseEntity logoutUser( - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -234,9 +277,12 @@ ResponseEntity logoutUser( method = RequestMethod.PUT, value = "/user/{username}" ) - ResponseEntity updateUser( + default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index 131788ef580d..01cf63fdb40a 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -3,6 +3,7 @@ import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -10,7 +11,8 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -22,14 +24,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -44,6 +47,11 @@ public UserApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * POST /user : Create user * This can only be done by the logged in user. @@ -115,18 +123,20 @@ public ResponseEntity deleteUser( public ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 1facfb48af62..c21547ebe553 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 9775210209ab..6f4b99f6bd22 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index d2440961a78c..603425f75ee4 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 85329fa9f21f..1de1495fee45 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -8,6 +8,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 2125dd106955..7760ea488d8c 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 788612115c61..385adeaf6859 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -7,6 +7,7 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index f469e4b37d94..01486fe5f8f9 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 00091c392dfc..daceddcbd943 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index e762aace509a..cab2078ba9db 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 5664a5b4e731..9871634153fd 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -7,6 +7,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index cc83e1746d91..465cf68cf34f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -7,6 +7,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 2ffb6eb34c83..296e8f58112a 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java index 455f600b0cee..e8cc7d889e63 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index 1948c4618e4c..ad9b04f2b436 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index bab70ab41af5..58d6a300418f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java index d502537ab4e6..d97457af945b 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index 707845c261dc..07c3fdf6735e 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java index 57afab36b95e..7f6bb6e1e7a1 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index b31b562dbba5..140f237c1436 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java index 31927074d37b..57335b9a7e29 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java index 992bc894a34b..7e3a95ef951c 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index 44068dd905a9..9eae8470eca6 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 090f2f021bc0..7f032e7b77f2 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java index d26620f561a6..ee89c0fd2008 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index 357486e4bcb2..171fa442d872 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.model.OuterEnum; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java index 87884c44e796..01328e7289d0 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 59e5a5e272cf..a8ff92bd4a93 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -7,6 +7,7 @@ import java.io.File; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index af0143fc04b0..8b97970dabc9 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,7 @@ import java.util.Arrays; import java.util.UUID; import org.springframework.format.annotation.DateTimeFormat; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 87bfaa5169e2..6af4fea705e5 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index 85b52ae042e9..ecdcea9ffb88 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -8,6 +8,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9168e59da15f..e421cb8aaf9e 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -11,6 +11,7 @@ import java.util.UUID; import org.openapitools.model.Animal; import org.springframework.format.annotation.DateTimeFormat; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 648952ab7633..38fee3569e92 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 9ee12a74ce21..924df8580f17 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index aa4a512c8c5f..8b2ace12f892 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 4a964dd8908a..0b030e1b2450 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index 2dd3efc08b45..2c89f8764d21 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index e4f864b35b27..164351c48a95 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index 5b3f52d439d7..99fcd106e326 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index 2a94c21a95d9..3b034d2add35 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java index 6e050d8e1507..86327bcf4e93 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 84ae9ca686cd..69f9cd6e8af0 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -12,6 +12,7 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index cf421153515a..580a50e935df 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index 068ed6d7943d..fef701b6870f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index 873bb3fc435b..48d0ddacf537 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index f4b8dbb157b9..d3b55c685d80 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -7,6 +7,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index ecce8e4fbccd..04d047121942 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -7,6 +7,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index 60b86f5edc60..7cc0ac4d18c8 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index ab9f16947cde..c07275c07db1 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -7,6 +7,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index f57c395c28a6..ce0d27ccdbb0 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,8 +1,34 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +48,18 @@ public AnotherFakeApiDelegate getDelegate() { return delegate; } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.call123testSpecialTags(body); + } + } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 501419787efc..346dc2916cd9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,8 +1,44 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +58,278 @@ public FakeApiDelegate getDelegate() { return delegate; } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return delegate.createXmlItem(xmlItem); + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return delegate.fakeOuterBooleanSerialize(body); + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + return delegate.fakeOuterCompositeSerialize(body); + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return delegate.fakeOuterNumberSerialize(body); + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return delegate.fakeOuterStringSerialize(body); + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return delegate.testBodyWithFileSchema(body); + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + ) { + return delegate.testBodyWithQueryParams(query, body); + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.testClientModel(body); + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + ) { + return delegate.testInlineAdditionalProperties(param); + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return delegate.testJsonFormData(param, param2); + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + } + } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 0e301ab5f9b1..0e14303a807d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,8 +1,34 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +48,18 @@ public FakeClassnameTestApiDelegate getDelegate() { return delegate; } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.testClassname(body); + } + } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index 03b76f0b64b1..959b2583c1fb 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,36 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +50,131 @@ public PetApiDelegate getDelegate() { return delegate; } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return delegate.addPet(body); + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return delegate.deletePet(petId, apiKey); + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status + ) { + return delegate.findPetsByStatus(status); + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + return delegate.findPetsByTags(tags); + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + return delegate.getPetById(petId); + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return delegate.updatePet(body); + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return delegate.updatePetWithForm(petId, name, status); + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + return delegate.uploadFile(petId, additionalMetadata, file); + } + } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java index 8209043ac020..a6172a2884c6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,8 +1,35 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +49,62 @@ public StoreApiDelegate getDelegate() { return delegate; } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return delegate.deleteOrder(orderId); + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return delegate.getInventory(); + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + return delegate.getOrderById(orderId); + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + return delegate.placeOrder(body); + } + } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java index 82725d160258..6e56a081a4d7 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java @@ -1,8 +1,36 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +50,119 @@ public UserApiDelegate getDelegate() { return delegate; } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + ) { + return delegate.createUser(body); + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) { + return delegate.createUsersWithArrayInput(body); + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) { + return delegate.createUsersWithListInput(body); + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return delegate.deleteUser(username); + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + return delegate.getUserByName(username); + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return delegate.loginUser(username, password); + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return delegate.logoutUser(); + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return delegate.updateUser(username, body); + } + } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 4bad7b07b87d..ab290864b1d8 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,9 +1,35 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +50,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java index c150dba343e5..b3e329f73f08 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,9 +1,45 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +60,312 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 1fb4dc597f84..f1c2fbe3f7e5 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,9 +1,35 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +50,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..c2e45c7d354e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,37 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +52,188 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..5de51f6ffb58 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,36 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +51,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..01cf63fdb40a 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,37 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +52,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java index f57c395c28a6..210b073fd6ed 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,8 +1,34 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java index 501419787efc..d62fbcd43c76 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,8 +1,44 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 0e301ab5f9b1..b3a7f55cdc68 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,8 +1,34 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java index 03b76f0b64b1..551620b155f1 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,36 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java index 8209043ac020..d993e6da6571 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,8 +1,35 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java index 82725d160258..311695aaa73e 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java @@ -1,8 +1,36 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..ed5520cc3cd6 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,217 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @Valid @RequestBody Pet pet + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @PathVariable("petId") Long petId, + @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @Valid @RequestParam(value = "tags", required = true) List tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @Valid @RequestBody Pet pet + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @PathVariable("petId") Long petId, + @Valid @RequestPart(value = "name", required = false) String name, + @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @PathVariable("petId") Long petId, + @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..2a15afd5268b 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @PathVariable("orderId") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @PathVariable("orderId") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @Valid @RequestBody Order order + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..75f0db8aab96 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,30 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +45,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @Valid @RequestBody User user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @Valid @RequestBody List user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @Valid @RequestBody List user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @PathVariable("username") String username, + @Valid @RequestBody User user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 4bad7b07b87d..ab290864b1d8 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,9 +1,35 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +50,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java index c150dba343e5..83577a8d6ed1 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,9 +1,45 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +60,320 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 1fb4dc597f84..f1c2fbe3f7e5 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,9 +1,35 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +50,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..b11ab4e29e0d 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,37 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +52,190 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) Optional apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..5de51f6ffb58 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,36 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +51,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..01cf63fdb40a 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,37 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +52,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..9004004154bc 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,36 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +51,217 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..3f6c13886b8e 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,36 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +51,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..1835681b83ad 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,37 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +52,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index eb4ea771ca48..bbbc5c96bf77 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -7,15 +7,19 @@ import org.openapitools.model.Client; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -23,6 +27,10 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -46,8 +54,20 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity call123testSpecialTags( + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index ec8ea57868a8..225f2f6d443d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,6 +1,10 @@ package org.openapitools.api; import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -12,14 +16,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -34,6 +39,11 @@ public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -45,13 +55,15 @@ public AnotherFakeApiController(NativeWebRequest request) { public ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index beb3bc5545be..27ddf876c5ec 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -17,15 +17,19 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -33,6 +37,10 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -54,9 +62,12 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - ResponseEntity createXmlItem( + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -81,9 +92,12 @@ ResponseEntity createXmlItem( value = "/fake/outer/boolean", produces = { "*/*" } ) - ResponseEntity fakeOuterBooleanSerialize( + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -108,9 +122,21 @@ ResponseEntity fakeOuterBooleanSerialize( value = "/fake/outer/composite", produces = { "*/*" } ) - ResponseEntity fakeOuterCompositeSerialize( + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -135,9 +161,12 @@ ResponseEntity fakeOuterCompositeSerialize( value = "/fake/outer/number", produces = { "*/*" } ) - ResponseEntity fakeOuterNumberSerialize( + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -162,9 +191,12 @@ ResponseEntity fakeOuterNumberSerialize( value = "/fake/outer/string", produces = { "*/*" } ) - ResponseEntity fakeOuterStringSerialize( + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -188,9 +220,12 @@ ResponseEntity fakeOuterStringSerialize( value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - ResponseEntity testBodyWithFileSchema( + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -214,10 +249,13 @@ ResponseEntity testBodyWithFileSchema( value = "/fake/body-with-query-params", consumes = { "application/json" } ) - ResponseEntity testBodyWithQueryParams( + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -243,9 +281,21 @@ ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClientModel( + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -287,7 +337,7 @@ ResponseEntity testClientModel( value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEndpointParameters( + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, @@ -302,7 +352,10 @@ ResponseEntity testEndpointParameters( @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -335,7 +388,7 @@ ResponseEntity testEndpointParameters( value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEnumParameters( + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @@ -344,7 +397,10 @@ ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -372,14 +428,17 @@ ResponseEntity testEnumParameters( method = RequestMethod.DELETE, value = "/fake" ) - ResponseEntity testGroupParameters( + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -402,9 +461,12 @@ ResponseEntity testGroupParameters( value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - ResponseEntity testInlineAdditionalProperties( + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -428,10 +490,13 @@ ResponseEntity testInlineAdditionalProperties( value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testJsonFormData( + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -458,13 +523,16 @@ ResponseEntity testJsonFormData( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - ResponseEntity testQueryParameterCollectionFormat( + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -497,10 +565,22 @@ ResponseEntity testQueryParameterCollectionFormat( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFileWithRequiredFile( + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index 679d98f5a4ef..4238e9d938f3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -11,6 +11,10 @@ import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -22,14 +26,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -44,6 +49,11 @@ public FakeApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -85,13 +95,15 @@ public ResponseEntity fakeOuterBooleanSerialize( public ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -168,13 +180,15 @@ public ResponseEntity testBodyWithQueryParams( public ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -343,13 +357,15 @@ public ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 3b56b4e43b28..17ce875daaac 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -7,15 +7,19 @@ import org.openapitools.model.Client; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -23,6 +27,10 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -49,8 +57,20 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClassname( + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 64dd84c74f47..aa2911fd85e6 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,6 +1,10 @@ package org.openapitools.api; import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -12,14 +16,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -34,6 +39,11 @@ public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -45,13 +55,15 @@ public FakeClassnameTestApiController(NativeWebRequest request) { public ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 799def8ca0d1..864173ded4fc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -9,15 +9,19 @@ import org.openapitools.model.Pet; import java.util.Set; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -25,6 +29,10 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /pet : Add a new pet to the store * @@ -53,9 +61,12 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity addPet( + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -86,10 +97,13 @@ ResponseEntity addPet( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - ResponseEntity deletePet( + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -123,9 +137,26 @@ ResponseEntity deletePet( value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByStatus( + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -160,9 +191,26 @@ ResponseEntity> findPetsByStatus( value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByTags( + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -194,9 +242,26 @@ ResponseEntity> findPetsByTags( value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - ResponseEntity getPetById( + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -231,9 +296,12 @@ ResponseEntity getPetById( value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity updatePet( + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -264,11 +332,14 @@ ResponseEntity updatePet( value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity updatePetWithForm( + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -301,10 +372,22 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFile( + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index 8b859e266f70..b42164232455 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -3,6 +3,10 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import java.util.Set; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -14,14 +18,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -36,6 +41,11 @@ public PetApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * POST /pet : Add a new pet to the store * @@ -80,18 +90,20 @@ public ResponseEntity deletePet( public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -109,18 +121,20 @@ public ResponseEntity> findPetsByStatus( public ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,18 +152,20 @@ public ResponseEntity> findPetsByTags( public ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -203,13 +219,15 @@ public ResponseEntity uploadFile( @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index cc7e38fb9daa..1292cf4edaa2 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -8,15 +8,19 @@ import java.util.Map; import org.openapitools.model.Order; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -24,6 +28,10 @@ @Api(value = "store", description = "the store API") public interface StoreApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -46,9 +54,12 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - ResponseEntity deleteOrder( + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -76,9 +87,12 @@ ResponseEntity deleteOrder( value = "/store/inventory", produces = { "application/json" } ) - ResponseEntity> getInventory( + default ResponseEntity> getInventory( - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -107,9 +121,26 @@ ResponseEntity> getInventory( value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - ResponseEntity getOrderById( + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -135,8 +166,25 @@ ResponseEntity getOrderById( value = "/store/order", produces = { "application/xml", "application/json" } ) - ResponseEntity placeOrder( + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index 021d8d718350..d519896475f2 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,6 +2,10 @@ import java.util.Map; import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -13,14 +17,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -35,6 +40,11 @@ public StoreApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -78,18 +88,20 @@ public ResponseEntity> getInventory( public ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -105,18 +117,20 @@ public ResponseEntity getOrderById( public ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 4cfb300ab524..8b7791294a9b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -9,15 +9,19 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -25,6 +29,10 @@ @Api(value = "user", description = "the user API") public interface UserApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /user : Create user * This can only be done by the logged in user. @@ -45,9 +53,12 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) - ResponseEntity createUser( + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -69,9 +80,12 @@ ResponseEntity createUser( method = RequestMethod.POST, value = "/user/createWithArray" ) - ResponseEntity createUsersWithArrayInput( + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -93,9 +107,12 @@ ResponseEntity createUsersWithArrayInput( method = RequestMethod.POST, value = "/user/createWithList" ) - ResponseEntity createUsersWithListInput( + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -120,9 +137,12 @@ ResponseEntity createUsersWithListInput( method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser( + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -150,9 +170,26 @@ ResponseEntity deleteUser( value = "/user/{username}", produces = { "application/xml", "application/json" } ) - ResponseEntity getUserByName( + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -179,10 +216,13 @@ ResponseEntity getUserByName( value = "/user/login", produces = { "application/xml", "application/json" } ) - ResponseEntity loginUser( + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -203,9 +243,12 @@ ResponseEntity loginUser( method = RequestMethod.GET, value = "/user/logout" ) - ResponseEntity logoutUser( + default ResponseEntity logoutUser( - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -231,9 +274,12 @@ ResponseEntity logoutUser( method = RequestMethod.PUT, value = "/user/{username}" ) - ResponseEntity updateUser( + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index f7527e6836f1..e63fcb4a8ea4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -3,6 +3,10 @@ import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -14,14 +18,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -36,6 +41,11 @@ public UserApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * POST /user : Create user * This can only be done by the logged in user. @@ -107,18 +117,20 @@ public ResponseEntity deleteUser( public ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 3792eec67489..73241ece58af 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 7bbca47bb996..8ccdac40b273 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 386a47d64607..a191e434268c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index ce3196f016c7..b319600c9510 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -10,6 +10,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 995edc193238..989f88c0c63d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 114425f840c5..32e7a118e940 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -9,6 +9,7 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index c655acde2d48..a9f074c13f65 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 62824a372517..fcf049c6af9c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index 188d2098d77b..c15efd1d937b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index ade7581200f0..aecbda603cb5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -9,6 +9,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e952ddbd6dc0..194acd76a434 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -9,6 +9,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 3072ad53963a..8e8b948cac22 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java index 56f1dd720fd6..4f3be6ed2259 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index ff725c49c3a0..dd13d7bdec4e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index 6bad3f78e73a..57505b24226d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java index bd2f9fc3ca08..b8976cec9e36 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index b40fac356ce7..f08bec554e28 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java index 49c5f68bebdc..96a6580d410a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index f5363eb06dc9..45154ca12c1d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java index fd5095aade68..fce7506b0322 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java index df2817a964b3..204603129979 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index d6ac1905f533..e752d7d851f7 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 80de575efa7c..5c758075628f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java index 1e8800e0b670..21a99583f0d2 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index 4ba64037961f..834d74556f35 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java index f0a6777289cd..35dca542482f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 9a58b1331ccf..77b8104b7a75 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -9,6 +9,7 @@ import java.io.File; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index cfa462903d24..01d454756ee7 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -13,6 +13,7 @@ import java.util.Arrays; import java.util.UUID; import org.springframework.format.annotation.DateTimeFormat; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 373b33c1e243..3384df59d317 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index 9e861f3b3f67..d23c0b96ca06 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -10,6 +10,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index ba8ff205bbcd..0a91f59ff49b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,6 +13,7 @@ import java.util.UUID; import org.openapitools.model.Animal; import org.springframework.format.annotation.DateTimeFormat; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 87d2d098812e..5167914f6fd7 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index c5676fe8a91b..19aae2715ecd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index a94a4c384087..e179538482eb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 74b2177186ba..8aa5465ad199 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index ac665b62dd94..d0980783d75b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index ce78534bcf72..f52e43c1dd84 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index 6a406a5047d0..83e683e3d6ae 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index 2300973669e6..50e684f86e5c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java index 874cedf63cfc..cb8a02c1e184 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 7e497a608654..db4c1ce0513c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -14,6 +14,7 @@ import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index a374f2899ff7..6d313020ae9c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index 9ee362ba26ca..cbb43d463caf 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index e24b0968e5ca..5c803770a210 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 98a4c66f2c59..ac0dd3265f79 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -9,6 +9,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index 74fe4656a03b..b13b6e0d1d14 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -9,6 +9,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index f2b4ed4a98ee..cd278220668f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 04e857829fec..cd6bf2b1a1d5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -9,6 +9,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 4bad7b07b87d..225f2f6d443d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index c150dba343e5..4238e9d938f3 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,9 +1,39 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +54,320 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 1fb4dc597f84..aa2911fd85e6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..b42164232455 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,31 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,190 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..d519896475f2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,30 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +45,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..e63fcb4a8ea4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,31 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index f57c395c28a6..893051d77d21 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,8 +1,28 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +42,18 @@ public AnotherFakeApiDelegate getDelegate() { return delegate; } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.call123testSpecialTags(body); + } + } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java index 501419787efc..026c0b7437a6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,8 +1,38 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +52,278 @@ public FakeApiDelegate getDelegate() { return delegate; } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return delegate.createXmlItem(xmlItem); + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return delegate.fakeOuterBooleanSerialize(body); + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + return delegate.fakeOuterCompositeSerialize(body); + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return delegate.fakeOuterNumberSerialize(body); + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return delegate.fakeOuterStringSerialize(body); + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return delegate.testBodyWithFileSchema(body); + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody User body + ) { + return delegate.testBodyWithQueryParams(query, body); + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.testClientModel(body); + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + ) { + return delegate.testInlineAdditionalProperties(param); + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return delegate.testJsonFormData(param, param2); + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + } + } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 0e301ab5f9b1..e1278db7b9f9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,8 +1,28 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +42,18 @@ public FakeClassnameTestApiDelegate getDelegate() { return delegate; } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.testClassname(body); + } + } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java index 03b76f0b64b1..b2914a63a077 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,30 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +44,131 @@ public PetApiDelegate getDelegate() { return delegate; } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return delegate.addPet(body); + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return delegate.deletePet(petId, apiKey); + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + ) { + return delegate.findPetsByStatus(status); + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + return delegate.findPetsByTags(tags); + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + return delegate.getPetById(petId); + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return delegate.updatePet(body); + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return delegate.updatePetWithForm(petId, name, status); + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + return delegate.uploadFile(petId, additionalMetadata, file); + } + } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java index 8209043ac020..f3d02b2f9797 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,8 +1,29 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +43,62 @@ public StoreApiDelegate getDelegate() { return delegate; } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return delegate.deleteOrder(orderId); + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return delegate.getInventory(); + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + return delegate.getOrderById(orderId); + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + return delegate.placeOrder(body); + } + } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java index 82725d160258..c58baa5fb00e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -1,8 +1,30 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +44,119 @@ public UserApiDelegate getDelegate() { return delegate; } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return delegate.createUser(body); + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return delegate.createUsersWithArrayInput(body); + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return delegate.createUsersWithListInput(body); + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return delegate.deleteUser(username); + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + return delegate.getUserByName(username); + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return delegate.loginUser(username, password); + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return delegate.logoutUser(); + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return delegate.updateUser(username, body); + } + } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index f57c395c28a6..893051d77d21 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,8 +1,28 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +42,18 @@ public AnotherFakeApiDelegate getDelegate() { return delegate; } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.call123testSpecialTags(body); + } + } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 501419787efc..026c0b7437a6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,8 +1,38 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +52,278 @@ public FakeApiDelegate getDelegate() { return delegate; } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return delegate.createXmlItem(xmlItem); + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return delegate.fakeOuterBooleanSerialize(body); + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + return delegate.fakeOuterCompositeSerialize(body); + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return delegate.fakeOuterNumberSerialize(body); + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return delegate.fakeOuterStringSerialize(body); + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return delegate.testBodyWithFileSchema(body); + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody User body + ) { + return delegate.testBodyWithQueryParams(query, body); + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.testClientModel(body); + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + ) { + return delegate.testInlineAdditionalProperties(param); + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return delegate.testJsonFormData(param, param2); + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + } + } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 0e301ab5f9b1..e1278db7b9f9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,8 +1,28 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +42,18 @@ public FakeClassnameTestApiDelegate getDelegate() { return delegate; } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.testClassname(body); + } + } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index 03b76f0b64b1..b2914a63a077 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,30 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +44,131 @@ public PetApiDelegate getDelegate() { return delegate; } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return delegate.addPet(body); + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return delegate.deletePet(petId, apiKey); + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + ) { + return delegate.findPetsByStatus(status); + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + return delegate.findPetsByTags(tags); + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + return delegate.getPetById(petId); + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return delegate.updatePet(body); + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return delegate.updatePetWithForm(petId, name, status); + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + return delegate.uploadFile(petId, additionalMetadata, file); + } + } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java index 8209043ac020..f3d02b2f9797 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,8 +1,29 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +43,62 @@ public StoreApiDelegate getDelegate() { return delegate; } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return delegate.deleteOrder(orderId); + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return delegate.getInventory(); + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + return delegate.getOrderById(orderId); + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + return delegate.placeOrder(body); + } + } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java index 82725d160258..c58baa5fb00e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java @@ -1,8 +1,30 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +44,119 @@ public UserApiDelegate getDelegate() { return delegate; } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return delegate.createUser(body); + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return delegate.createUsersWithArrayInput(body); + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return delegate.createUsersWithListInput(body); + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return delegate.deleteUser(username); + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + return delegate.getUserByName(username); + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return delegate.loginUser(username, password); + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return delegate.logoutUser(); + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return delegate.updateUser(username, body); + } + } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 4bad7b07b87d..225f2f6d443d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java index c150dba343e5..381013b21a0e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,9 +1,39 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +54,312 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 1fb4dc597f84..aa2911fd85e6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..d31b06c1d38a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,31 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,188 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..d519896475f2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,30 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +45,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..e63fcb4a8ea4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,31 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java index f57c395c28a6..3c8824b5c3c4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,8 +1,29 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java index 501419787efc..d0bb8a65db51 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,8 +1,39 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 0e301ab5f9b1..400efe2a2bd3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,8 +1,29 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java index 03b76f0b64b1..65428354fbf4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,31 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java index 8209043ac020..2ba71bc16709 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,8 +1,30 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java index 82725d160258..191684585cd6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java @@ -1,8 +1,31 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be1..000000000000 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index eb4ea771ca48..44242e9af9e7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -23,6 +23,10 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { + default AnotherFakeApiDelegate getDelegate() { + return new AnotherFakeApiDelegate() {}; + } + /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -46,8 +50,10 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity call123testSpecialTags( + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + return getDelegate().call123testSpecialTags(body); + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7ae394a6c746..893051d77d21 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,6 +1,10 @@ package org.openapitools.api; import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -12,13 +16,14 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -29,7 +34,12 @@ public class AnotherFakeApiController implements AnotherFakeApi { private final AnotherFakeApiDelegate delegate; public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { - this.delegate = delegate; + this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); + } + + @Override + public AnotherFakeApiDelegate getDelegate() { + return delegate; } /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 0e0027d4bc33..2d5e24bcd5f6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -1,11 +1,15 @@ package org.openapitools.api; import org.openapitools.model.Client; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; /** @@ -15,6 +19,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface AnotherFakeApiDelegate { + default Optional getRequest() { + return Optional.empty(); + } + /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -23,6 +31,18 @@ public interface AnotherFakeApiDelegate { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - ResponseEntity call123testSpecialTags(Client body); + default ResponseEntity call123testSpecialTags(Client body) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 6d87fc1b30c5..c6cc95368d85 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -33,6 +33,10 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { + default FakeApiDelegate getDelegate() { + return new FakeApiDelegate() {}; + } + /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -54,9 +58,11 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - ResponseEntity createXmlItem( + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ); + ) { + return getDelegate().createXmlItem(xmlItem); + } /** @@ -81,9 +87,11 @@ ResponseEntity createXmlItem( value = "/fake/outer/boolean", produces = { "*/*" } ) - ResponseEntity fakeOuterBooleanSerialize( + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ); + ) { + return getDelegate().fakeOuterBooleanSerialize(body); + } /** @@ -108,9 +116,11 @@ ResponseEntity fakeOuterBooleanSerialize( value = "/fake/outer/composite", produces = { "*/*" } ) - ResponseEntity fakeOuterCompositeSerialize( + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ); + ) { + return getDelegate().fakeOuterCompositeSerialize(body); + } /** @@ -135,9 +145,11 @@ ResponseEntity fakeOuterCompositeSerialize( value = "/fake/outer/number", produces = { "*/*" } ) - ResponseEntity fakeOuterNumberSerialize( + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ); + ) { + return getDelegate().fakeOuterNumberSerialize(body); + } /** @@ -162,9 +174,11 @@ ResponseEntity fakeOuterNumberSerialize( value = "/fake/outer/string", produces = { "*/*" } ) - ResponseEntity fakeOuterStringSerialize( + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ); + ) { + return getDelegate().fakeOuterStringSerialize(body); + } /** @@ -188,9 +202,11 @@ ResponseEntity fakeOuterStringSerialize( value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - ResponseEntity testBodyWithFileSchema( + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ); + ) { + return getDelegate().testBodyWithFileSchema(body); + } /** @@ -214,10 +230,12 @@ ResponseEntity testBodyWithFileSchema( value = "/fake/body-with-query-params", consumes = { "application/json" } ) - ResponseEntity testBodyWithQueryParams( + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User body - ); + ) { + return getDelegate().testBodyWithQueryParams(query, body); + } /** @@ -243,9 +261,11 @@ ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClientModel( + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + return getDelegate().testClientModel(body); + } /** @@ -287,7 +307,7 @@ ResponseEntity testClientModel( value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEndpointParameters( + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, @@ -302,7 +322,9 @@ ResponseEntity testEndpointParameters( @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ); + ) { + return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } /** @@ -335,7 +357,7 @@ ResponseEntity testEndpointParameters( value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEnumParameters( + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @@ -344,7 +366,9 @@ ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ); + ) { + return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } /** @@ -372,14 +396,16 @@ ResponseEntity testEnumParameters( method = RequestMethod.DELETE, value = "/fake" ) - ResponseEntity testGroupParameters( + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ); + ) { + return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } /** @@ -402,9 +428,11 @@ ResponseEntity testGroupParameters( value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - ResponseEntity testInlineAdditionalProperties( + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ); + ) { + return getDelegate().testInlineAdditionalProperties(param); + } /** @@ -428,10 +456,12 @@ ResponseEntity testInlineAdditionalProperties( value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testJsonFormData( + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ); + ) { + return getDelegate().testJsonFormData(param, param2); + } /** @@ -458,13 +488,15 @@ ResponseEntity testJsonFormData( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - ResponseEntity testQueryParameterCollectionFormat( + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ); + ) { + return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } /** @@ -497,10 +529,12 @@ ResponseEntity testQueryParameterCollectionFormat( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFileWithRequiredFile( + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ); + ) { + return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index c121c7b8e2da..83d7ada53519 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -11,6 +11,10 @@ import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -22,13 +26,14 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -39,7 +44,12 @@ public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { - this.delegate = delegate; + this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); + } + + @Override + public FakeApiDelegate getDelegate() { + return delegate; } /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index e75dd153c23b..397c677c9949 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -11,11 +11,15 @@ import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; /** @@ -25,6 +29,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeApiDelegate { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -33,7 +41,10 @@ public interface FakeApiDelegate { * @return successful operation (status code 200) * @see FakeApi#createXmlItem */ - ResponseEntity createXmlItem(XmlItem xmlItem); + default ResponseEntity createXmlItem(XmlItem xmlItem) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /fake/outer/boolean @@ -43,7 +54,10 @@ public interface FakeApiDelegate { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - ResponseEntity fakeOuterBooleanSerialize(Boolean body); + default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /fake/outer/composite @@ -53,7 +67,19 @@ public interface FakeApiDelegate { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - ResponseEntity fakeOuterCompositeSerialize(OuterComposite body); + default ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /fake/outer/number @@ -63,7 +89,10 @@ public interface FakeApiDelegate { * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - ResponseEntity fakeOuterNumberSerialize(BigDecimal body); + default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /fake/outer/string @@ -73,7 +102,10 @@ public interface FakeApiDelegate { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - ResponseEntity fakeOuterStringSerialize(String body); + default ResponseEntity fakeOuterStringSerialize(String body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * PUT /fake/body-with-file-schema @@ -83,7 +115,10 @@ public interface FakeApiDelegate { * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - ResponseEntity testBodyWithFileSchema(FileSchemaTestClass body); + default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * PUT /fake/body-with-query-params @@ -93,8 +128,11 @@ public interface FakeApiDelegate { * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ - ResponseEntity testBodyWithQueryParams(String query, - User body); + default ResponseEntity testBodyWithQueryParams(String query, + User body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * PATCH /fake : To test \"client\" model @@ -104,7 +142,19 @@ ResponseEntity testBodyWithQueryParams(String query, * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - ResponseEntity testClientModel(Client body); + default ResponseEntity testClientModel(Client body) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -128,7 +178,7 @@ ResponseEntity testBodyWithQueryParams(String query, * or User not found (status code 404) * @see FakeApi#testEndpointParameters */ - ResponseEntity testEndpointParameters(BigDecimal number, + default ResponseEntity testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, @@ -141,7 +191,10 @@ ResponseEntity testEndpointParameters(BigDecimal number, LocalDate date, OffsetDateTime dateTime, String password, - String paramCallback); + String paramCallback) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /fake : To test enum parameters @@ -159,14 +212,17 @@ ResponseEntity testEndpointParameters(BigDecimal number, * or Not found (status code 404) * @see FakeApi#testEnumParameters */ - ResponseEntity testEnumParameters(List enumHeaderStringArray, + default ResponseEntity testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, - String enumFormString); + String enumFormString) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * DELETE /fake : Fake endpoint to test group parameters (optional) @@ -181,12 +237,15 @@ ResponseEntity testEnumParameters(List enumHeaderStringArray, * @return Someting wrong (status code 400) * @see FakeApi#testGroupParameters */ - ResponseEntity testGroupParameters(Integer requiredStringGroup, + default ResponseEntity testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, - Long int64Group); + Long int64Group) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /fake/inline-additionalProperties : test inline additionalProperties @@ -195,7 +254,10 @@ ResponseEntity testGroupParameters(Integer requiredStringGroup, * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - ResponseEntity testInlineAdditionalProperties(Map param); + default ResponseEntity testInlineAdditionalProperties(Map param) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /fake/jsonFormData : test json serialization of form data @@ -205,8 +267,11 @@ ResponseEntity testGroupParameters(Integer requiredStringGroup, * @return successful operation (status code 200) * @see FakeApi#testJsonFormData */ - ResponseEntity testJsonFormData(String param, - String param2); + default ResponseEntity testJsonFormData(String param, + String param2) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * PUT /fake/test-query-parameters @@ -220,11 +285,14 @@ ResponseEntity testJsonFormData(String param, * @return Success (status code 200) * @see FakeApi#testQueryParameterCollectionFormat */ - ResponseEntity testQueryParameterCollectionFormat(List pipe, + default ResponseEntity testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, - List context); + List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) @@ -235,8 +303,20 @@ ResponseEntity testQueryParameterCollectionFormat(List pipe, * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - ResponseEntity uploadFileWithRequiredFile(Long petId, + default ResponseEntity uploadFileWithRequiredFile(Long petId, MultipartFile requiredFile, - String additionalMetadata); + String additionalMetadata) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 3b56b4e43b28..9c20e7a6553e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -23,6 +23,10 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { + default FakeClassnameTestApiDelegate getDelegate() { + return new FakeClassnameTestApiDelegate() {}; + } + /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -49,8 +53,10 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClassname( + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + return getDelegate().testClassname(body); + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 477a1180d788..e1278db7b9f9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,6 +1,10 @@ package org.openapitools.api; import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -12,13 +16,14 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -29,7 +34,12 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final FakeClassnameTestApiDelegate delegate; public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { - this.delegate = delegate; + this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); + } + + @Override + public FakeClassnameTestApiDelegate getDelegate() { + return delegate; } /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 414a09aed4e3..fb689b13f943 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -1,11 +1,15 @@ package org.openapitools.api; import org.openapitools.model.Client; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; /** @@ -15,6 +19,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeClassnameTestApiDelegate { + default Optional getRequest() { + return Optional.empty(); + } + /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -23,6 +31,18 @@ public interface FakeClassnameTestApiDelegate { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - ResponseEntity testClassname(Client body); + default ResponseEntity testClassname(Client body) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index 30d2cfc48787..52f11a620fcb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -26,6 +26,10 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { + default PetApiDelegate getDelegate() { + return new PetApiDelegate() {}; + } + /** * POST /pet : Add a new pet to the store * @@ -54,9 +58,11 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity addPet( + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + ) { + return getDelegate().addPet(body); + } /** @@ -87,10 +93,12 @@ ResponseEntity addPet( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - ResponseEntity deletePet( + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ); + ) { + return getDelegate().deletePet(petId, apiKey); + } /** @@ -124,10 +132,12 @@ ResponseEntity deletePet( value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByStatus( + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final Pageable pageable - ); + ) { + return getDelegate().findPetsByStatus(status, pageable); + } /** @@ -162,10 +172,12 @@ ResponseEntity> findPetsByStatus( value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByTags( + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @ApiIgnore final Pageable pageable - ); + ) { + return getDelegate().findPetsByTags(tags, pageable); + } /** @@ -197,9 +209,11 @@ ResponseEntity> findPetsByTags( value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - ResponseEntity getPetById( + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ); + ) { + return getDelegate().getPetById(petId); + } /** @@ -234,9 +248,11 @@ ResponseEntity getPetById( value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity updatePet( + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + ) { + return getDelegate().updatePet(body); + } /** @@ -267,11 +283,13 @@ ResponseEntity updatePet( value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity updatePetWithForm( + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ); + ) { + return getDelegate().updatePetWithForm(petId, name, status); + } /** @@ -304,10 +322,12 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFile( + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ); + ) { + return getDelegate().uploadFile(petId, additionalMetadata, file); + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 5e95ed20be2d..d8d7fa43f0ae 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -4,6 +4,10 @@ import org.openapitools.model.ModelApiResponse; import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -15,13 +19,14 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -32,7 +37,12 @@ public class PetApiController implements PetApi { private final PetApiDelegate delegate; public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { - this.delegate = delegate; + this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); + } + + @Override + public PetApiDelegate getDelegate() { + return delegate; } /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index 7047f8a6a5ac..daf113aec6c5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -4,11 +4,15 @@ import org.openapitools.model.ModelApiResponse; import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; /** @@ -18,6 +22,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface PetApiDelegate { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /pet : Add a new pet to the store * @@ -26,7 +34,10 @@ public interface PetApiDelegate { * or Invalid input (status code 405) * @see PetApi#addPet */ - ResponseEntity addPet(Pet body); + default ResponseEntity addPet(Pet body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * DELETE /pet/{petId} : Deletes a pet @@ -37,8 +48,11 @@ public interface PetApiDelegate { * or Invalid pet value (status code 400) * @see PetApi#deletePet */ - ResponseEntity deletePet(Long petId, - String apiKey); + default ResponseEntity deletePet(Long petId, + String apiKey) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /pet/findByStatus : Finds Pets by status @@ -49,7 +63,24 @@ ResponseEntity deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - ResponseEntity> findPetsByStatus(List status, final Pageable pageable); + default ResponseEntity> findPetsByStatus(List status, final Pageable pageable) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /pet/findByTags : Finds Pets by tags @@ -61,7 +92,24 @@ ResponseEntity deletePet(Long petId, * @deprecated * @see PetApi#findPetsByTags */ - ResponseEntity> findPetsByTags(List tags, final Pageable pageable); + default ResponseEntity> findPetsByTags(List tags, final Pageable pageable) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /pet/{petId} : Find pet by ID @@ -73,7 +121,24 @@ ResponseEntity deletePet(Long petId, * or Pet not found (status code 404) * @see PetApi#getPetById */ - ResponseEntity getPetById(Long petId); + default ResponseEntity getPetById(Long petId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * PUT /pet : Update an existing pet @@ -85,7 +150,10 @@ ResponseEntity deletePet(Long petId, * or Validation exception (status code 405) * @see PetApi#updatePet */ - ResponseEntity updatePet(Pet body); + default ResponseEntity updatePet(Pet body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /pet/{petId} : Updates a pet in the store with form data @@ -96,9 +164,12 @@ ResponseEntity deletePet(Long petId, * @return Invalid input (status code 405) * @see PetApi#updatePetWithForm */ - ResponseEntity updatePetWithForm(Long petId, + default ResponseEntity updatePetWithForm(Long petId, String name, - String status); + String status) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /pet/{petId}/uploadImage : uploads an image @@ -109,8 +180,20 @@ ResponseEntity updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - ResponseEntity uploadFile(Long petId, + default ResponseEntity uploadFile(Long petId, String additionalMetadata, - MultipartFile file); + MultipartFile file) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index cc7e38fb9daa..c88eb0641a0d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -24,6 +24,10 @@ @Api(value = "store", description = "the store API") public interface StoreApi { + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() {}; + } + /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -46,9 +50,11 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - ResponseEntity deleteOrder( + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ); + ) { + return getDelegate().deleteOrder(orderId); + } /** @@ -76,9 +82,11 @@ ResponseEntity deleteOrder( value = "/store/inventory", produces = { "application/json" } ) - ResponseEntity> getInventory( + default ResponseEntity> getInventory( - ); + ) { + return getDelegate().getInventory(); + } /** @@ -107,9 +115,11 @@ ResponseEntity> getInventory( value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - ResponseEntity getOrderById( + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ); + ) { + return getDelegate().getOrderById(orderId); + } /** @@ -135,8 +145,10 @@ ResponseEntity getOrderById( value = "/store/order", produces = { "application/xml", "application/json" } ) - ResponseEntity placeOrder( + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ); + ) { + return getDelegate().placeOrder(body); + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index 8fd7fe5fa872..f3d02b2f9797 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,6 +2,10 @@ import java.util.Map; import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -13,13 +17,14 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -30,7 +35,12 @@ public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { - this.delegate = delegate; + this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); + } + + @Override + public StoreApiDelegate getDelegate() { + return delegate; } /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java index 5d4bde80620a..e9b7146b52a8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -2,11 +2,15 @@ import java.util.Map; import org.openapitools.model.Order; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; /** @@ -16,6 +20,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface StoreApiDelegate { + default Optional getRequest() { + return Optional.empty(); + } + /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -25,7 +33,10 @@ public interface StoreApiDelegate { * or Order not found (status code 404) * @see StoreApi#deleteOrder */ - ResponseEntity deleteOrder(String orderId); + default ResponseEntity deleteOrder(String orderId) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /store/inventory : Returns pet inventories by status @@ -34,7 +45,10 @@ public interface StoreApiDelegate { * @return successful operation (status code 200) * @see StoreApi#getInventory */ - ResponseEntity> getInventory(); + default ResponseEntity> getInventory() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /store/order/{order_id} : Find purchase order by ID @@ -46,7 +60,24 @@ public interface StoreApiDelegate { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - ResponseEntity getOrderById(Long orderId); + default ResponseEntity getOrderById(Long orderId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /store/order : Place an order for a pet @@ -56,6 +87,23 @@ public interface StoreApiDelegate { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - ResponseEntity placeOrder(Order body); + default ResponseEntity placeOrder(Order body) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 4cfb300ab524..75d061e0e882 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -25,6 +25,10 @@ @Api(value = "user", description = "the user API") public interface UserApi { + default UserApiDelegate getDelegate() { + return new UserApiDelegate() {}; + } + /** * POST /user : Create user * This can only be done by the logged in user. @@ -45,9 +49,11 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) - ResponseEntity createUser( + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ); + ) { + return getDelegate().createUser(body); + } /** @@ -69,9 +75,11 @@ ResponseEntity createUser( method = RequestMethod.POST, value = "/user/createWithArray" ) - ResponseEntity createUsersWithArrayInput( + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ); + ) { + return getDelegate().createUsersWithArrayInput(body); + } /** @@ -93,9 +101,11 @@ ResponseEntity createUsersWithArrayInput( method = RequestMethod.POST, value = "/user/createWithList" ) - ResponseEntity createUsersWithListInput( + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ); + ) { + return getDelegate().createUsersWithListInput(body); + } /** @@ -120,9 +130,11 @@ ResponseEntity createUsersWithListInput( method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser( + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ); + ) { + return getDelegate().deleteUser(username); + } /** @@ -150,9 +162,11 @@ ResponseEntity deleteUser( value = "/user/{username}", produces = { "application/xml", "application/json" } ) - ResponseEntity getUserByName( + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ); + ) { + return getDelegate().getUserByName(username); + } /** @@ -179,10 +193,12 @@ ResponseEntity getUserByName( value = "/user/login", produces = { "application/xml", "application/json" } ) - ResponseEntity loginUser( + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ); + ) { + return getDelegate().loginUser(username, password); + } /** @@ -203,9 +219,11 @@ ResponseEntity loginUser( method = RequestMethod.GET, value = "/user/logout" ) - ResponseEntity logoutUser( + default ResponseEntity logoutUser( - ); + ) { + return getDelegate().logoutUser(); + } /** @@ -231,9 +249,11 @@ ResponseEntity logoutUser( method = RequestMethod.PUT, value = "/user/{username}" ) - ResponseEntity updateUser( + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ); + ) { + return getDelegate().updateUser(username, body); + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 40c683556aaa..c58baa5fb00e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -3,6 +3,10 @@ import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -14,13 +18,14 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -31,7 +36,12 @@ public class UserApiController implements UserApi { private final UserApiDelegate delegate; public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { - this.delegate = delegate; + this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); + } + + @Override + public UserApiDelegate getDelegate() { + return delegate; } /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index df4771c1caf1..c39231c6b299 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -3,11 +3,15 @@ import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; /** @@ -17,6 +21,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface UserApiDelegate { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /user : Create user * This can only be done by the logged in user. @@ -25,7 +33,10 @@ public interface UserApiDelegate { * @return successful operation (status code 200) * @see UserApi#createUser */ - ResponseEntity createUser(User body); + default ResponseEntity createUser(User body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /user/createWithArray : Creates list of users with given input array @@ -34,7 +45,10 @@ public interface UserApiDelegate { * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - ResponseEntity createUsersWithArrayInput(List body); + default ResponseEntity createUsersWithArrayInput(List body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * POST /user/createWithList : Creates list of users with given input array @@ -43,7 +57,10 @@ public interface UserApiDelegate { * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - ResponseEntity createUsersWithListInput(List body); + default ResponseEntity createUsersWithListInput(List body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * DELETE /user/{username} : Delete user @@ -54,7 +71,10 @@ public interface UserApiDelegate { * or User not found (status code 404) * @see UserApi#deleteUser */ - ResponseEntity deleteUser(String username); + default ResponseEntity deleteUser(String username) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /user/{username} : Get user by user name @@ -65,7 +85,24 @@ public interface UserApiDelegate { * or User not found (status code 404) * @see UserApi#getUserByName */ - ResponseEntity getUserByName(String username); + default ResponseEntity getUserByName(String username) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /user/login : Logs user into the system @@ -76,8 +113,11 @@ public interface UserApiDelegate { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - ResponseEntity loginUser(String username, - String password); + default ResponseEntity loginUser(String username, + String password) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * GET /user/logout : Logs out current logged in user session @@ -85,7 +125,10 @@ ResponseEntity loginUser(String username, * @return successful operation (status code 200) * @see UserApi#logoutUser */ - ResponseEntity logoutUser(); + default ResponseEntity logoutUser() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** * PUT /user/{username} : Updated user @@ -97,7 +140,10 @@ ResponseEntity loginUser(String username, * or User not found (status code 404) * @see UserApi#updateUser */ - ResponseEntity updateUser(String username, - User body); + default ResponseEntity updateUser(String username, + User body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 2874aee40b58..ea719cc4ad89 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 303eb0c55db0..a4ec39252ebe 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 1cac5fc9adca..47db34f7b504 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 67b605455de9..5851aa2c2498 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index faeaecb95cd2..bba3dce1a55e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 522c7e8dda03..5f48487e05d6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -10,6 +10,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 617d4fb867fd..40ca1af6ab4f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 74e04286771a..ddc76e27b19f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java index 4bdbbcad59db..1dc5fc69c61b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 2b0522be2b08..3859dcfdcc05 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 3ef80f22c568..a90ce117c238 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 309656c30172..e8f37b16d5cb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -10,6 +10,7 @@ import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java index 60748a7366ac..37c928a79482 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java index 9fd111c8430c..9fb7bfef1800 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -9,6 +9,7 @@ import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index 025bcca8b97b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java index 06d98844c504..8adf35c2fa00 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java index 2bffe7eecb0e..72e9288b53af 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java index 9bc13add64aa..9891fe7dafce 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java index daf01294455d..3ee8ac596893 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -9,6 +9,7 @@ import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 9c3e02b94529..c081b7517a47 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index a22d2583b128..b85ad3e155ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java index 233a854ff582..c2abaaed4305 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 44433a449d13..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java index baed9c12618f..685394664974 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 552cfcd2ee83..01149ce8f6ae 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 0c5b3f3d3306..153641cacd56 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -14,6 +14,7 @@ import java.util.UUID; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 846cb351f3c1..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java index 7f0aec42b478..27e3cea8e6ed 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 53b1f8fe6b14..e490e2a61ef7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ import org.openapitools.model.Animal; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java index b3ce6a2a9c9b..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 7c53ec981595..131e671e9160 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java index 7384ea7824cd..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index c3e5771a8d27..a933badc4910 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java index 96cadd497361..febe2115a665 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index 4ed41292ec07..dcf5c5e801a6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java index b6eab7cba8a3..6bd55e5a1548 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java @@ -10,6 +10,7 @@ import java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 2fa1e8576afe..eca5e7cd4fa5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java index 542939a2a636..1f09d0a5d17a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index d96e2585864b..d330c28e6791 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -12,6 +12,7 @@ import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 5cf483cb584b..e2ddfcdfcb17 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 8bee0349830a..cbc94826b926 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java index 0131b8854d89..03b4ffcdadca 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 39e0fa94cc76..01e5d5f3fccd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index afe25703c928..e907ad9c28e7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java index f443caa28bf0..cff62427bf1a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java index f9ffb03d0ad0..930edebcef74 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java index f57c395c28a6..893051d77d21 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,8 +1,28 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +42,18 @@ public AnotherFakeApiDelegate getDelegate() { return delegate; } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.call123testSpecialTags(body); + } + } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java index 501419787efc..83d7ada53519 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,8 +1,38 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +52,278 @@ public FakeApiDelegate getDelegate() { return delegate; } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return delegate.createXmlItem(xmlItem); + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return delegate.fakeOuterBooleanSerialize(body); + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + return delegate.fakeOuterCompositeSerialize(body); + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return delegate.fakeOuterNumberSerialize(body); + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return delegate.fakeOuterStringSerialize(body); + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return delegate.testBodyWithFileSchema(body); + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody User body + ) { + return delegate.testBodyWithQueryParams(query, body); + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.testClientModel(body); + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + ) { + return delegate.testInlineAdditionalProperties(param); + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return delegate.testJsonFormData(param, param2); + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + } + } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 0e301ab5f9b1..e1278db7b9f9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,8 +1,28 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +42,18 @@ public FakeClassnameTestApiDelegate getDelegate() { return delegate; } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + return delegate.testClassname(body); + } + } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java index 03b76f0b64b1..d8d7fa43f0ae 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,31 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; +import org.openapitools.model.Pet; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +45,133 @@ public PetApiDelegate getDelegate() { return delegate; } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return delegate.addPet(body); + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return delegate.deletePet(petId, apiKey); + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, + @ApiIgnore final Pageable pageable + ) { + return delegate.findPetsByStatus(status, pageable); + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, + @ApiIgnore final Pageable pageable + ) { + return delegate.findPetsByTags(tags, pageable); + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + return delegate.getPetById(petId); + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return delegate.updatePet(body); + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return delegate.updatePetWithForm(petId, name, status); + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + return delegate.uploadFile(petId, additionalMetadata, file); + } + } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java index 8209043ac020..f3d02b2f9797 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,8 +1,29 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +43,62 @@ public StoreApiDelegate getDelegate() { return delegate; } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return delegate.deleteOrder(orderId); + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return delegate.getInventory(); + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + return delegate.getOrderById(orderId); + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + return delegate.placeOrder(body); + } + } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java index 82725d160258..c58baa5fb00e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java @@ -1,8 +1,30 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -22,4 +44,119 @@ public UserApiDelegate getDelegate() { return delegate; } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return delegate.createUser(body); + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return delegate.createUsersWithArrayInput(body); + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return delegate.createUsersWithListInput(body); + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return delegate.deleteUser(username); + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + return delegate.getUserByName(username); + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return delegate.loginUser(username, password); + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return delegate.logoutUser(); + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return delegate.updateUser(username, body); + } + } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index eb4ea771ca48..bbbc5c96bf77 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -7,15 +7,19 @@ import org.openapitools.model.Client; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -23,6 +27,10 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -46,8 +54,20 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity call123testSpecialTags( + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index ec8ea57868a8..225f2f6d443d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,6 +1,10 @@ package org.openapitools.api; import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -12,14 +16,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -34,6 +39,11 @@ public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -45,13 +55,15 @@ public AnotherFakeApiController(NativeWebRequest request) { public ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 6d87fc1b30c5..a1e3a9409b88 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -17,15 +17,19 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -33,6 +37,10 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -54,9 +62,12 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - ResponseEntity createXmlItem( + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -81,9 +92,12 @@ ResponseEntity createXmlItem( value = "/fake/outer/boolean", produces = { "*/*" } ) - ResponseEntity fakeOuterBooleanSerialize( + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -108,9 +122,21 @@ ResponseEntity fakeOuterBooleanSerialize( value = "/fake/outer/composite", produces = { "*/*" } ) - ResponseEntity fakeOuterCompositeSerialize( + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -135,9 +161,12 @@ ResponseEntity fakeOuterCompositeSerialize( value = "/fake/outer/number", produces = { "*/*" } ) - ResponseEntity fakeOuterNumberSerialize( + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -162,9 +191,12 @@ ResponseEntity fakeOuterNumberSerialize( value = "/fake/outer/string", produces = { "*/*" } ) - ResponseEntity fakeOuterStringSerialize( + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -188,9 +220,12 @@ ResponseEntity fakeOuterStringSerialize( value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - ResponseEntity testBodyWithFileSchema( + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -214,10 +249,13 @@ ResponseEntity testBodyWithFileSchema( value = "/fake/body-with-query-params", consumes = { "application/json" } ) - ResponseEntity testBodyWithQueryParams( + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -243,9 +281,21 @@ ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClientModel( + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -287,7 +337,7 @@ ResponseEntity testClientModel( value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEndpointParameters( + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, @@ -302,7 +352,10 @@ ResponseEntity testEndpointParameters( @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -335,7 +388,7 @@ ResponseEntity testEndpointParameters( value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testEnumParameters( + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @@ -344,7 +397,10 @@ ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -372,14 +428,17 @@ ResponseEntity testEnumParameters( method = RequestMethod.DELETE, value = "/fake" ) - ResponseEntity testGroupParameters( + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -402,9 +461,12 @@ ResponseEntity testGroupParameters( value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - ResponseEntity testInlineAdditionalProperties( + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -428,10 +490,13 @@ ResponseEntity testInlineAdditionalProperties( value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity testJsonFormData( + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -458,13 +523,16 @@ ResponseEntity testJsonFormData( method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) - ResponseEntity testQueryParameterCollectionFormat( + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -497,10 +565,22 @@ ResponseEntity testQueryParameterCollectionFormat( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFileWithRequiredFile( + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index de3ce15a983d..f0ae3ff20eac 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -11,6 +11,10 @@ import org.openapitools.model.OuterComposite; import org.openapitools.model.User; import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -22,14 +26,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -44,6 +49,11 @@ public FakeApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -85,13 +95,15 @@ public ResponseEntity fakeOuterBooleanSerialize( public ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -168,13 +180,15 @@ public ResponseEntity testBodyWithQueryParams( public ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -343,13 +357,15 @@ public ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 3b56b4e43b28..17ce875daaac 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -7,15 +7,19 @@ import org.openapitools.model.Client; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -23,6 +27,10 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -49,8 +57,20 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClassname( + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 64dd84c74f47..aa2911fd85e6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,6 +1,10 @@ package org.openapitools.api; import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -12,14 +16,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -34,6 +39,11 @@ public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -45,13 +55,15 @@ public FakeClassnameTestApiController(NativeWebRequest request) { public ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index 30d2cfc48787..222c5398c8f5 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -10,15 +10,19 @@ import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -26,6 +30,10 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /pet : Add a new pet to the store * @@ -54,9 +62,12 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity addPet( + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -87,10 +98,13 @@ ResponseEntity addPet( method = RequestMethod.DELETE, value = "/pet/{petId}" ) - ResponseEntity deletePet( + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -124,10 +138,27 @@ ResponseEntity deletePet( value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByStatus( + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final Pageable pageable - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -162,10 +193,27 @@ ResponseEntity> findPetsByStatus( value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByTags( + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @ApiIgnore final Pageable pageable - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -197,9 +245,26 @@ ResponseEntity> findPetsByTags( value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - ResponseEntity getPetById( + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -234,9 +299,12 @@ ResponseEntity getPetById( value = "/pet", consumes = { "application/json", "application/xml" } ) - ResponseEntity updatePet( + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -267,11 +335,14 @@ ResponseEntity updatePet( value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - ResponseEntity updatePetWithForm( + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -304,10 +375,22 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFile( + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 7c7fc3eb66a7..59504a7e6241 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -4,6 +4,10 @@ import org.openapitools.model.ModelApiResponse; import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -15,14 +19,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -37,6 +42,11 @@ public PetApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * POST /pet : Add a new pet to the store * @@ -82,18 +92,20 @@ public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final Pageable pageable ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -112,18 +124,20 @@ public ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @ApiIgnore final Pageable pageable ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -141,18 +155,20 @@ public ResponseEntity> findPetsByTags( public ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -206,13 +222,15 @@ public ResponseEntity uploadFile( @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index cc7e38fb9daa..1292cf4edaa2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -8,15 +8,19 @@ import java.util.Map; import org.openapitools.model.Order; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -24,6 +28,10 @@ @Api(value = "store", description = "the store API") public interface StoreApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -46,9 +54,12 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) - ResponseEntity deleteOrder( + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -76,9 +87,12 @@ ResponseEntity deleteOrder( value = "/store/inventory", produces = { "application/json" } ) - ResponseEntity> getInventory( + default ResponseEntity> getInventory( - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -107,9 +121,26 @@ ResponseEntity> getInventory( value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - ResponseEntity getOrderById( + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -135,8 +166,25 @@ ResponseEntity getOrderById( value = "/store/order", produces = { "application/xml", "application/json" } ) - ResponseEntity placeOrder( + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index 021d8d718350..d519896475f2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,6 +2,10 @@ import java.util.Map; import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -13,14 +17,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -35,6 +40,11 @@ public StoreApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -78,18 +88,20 @@ public ResponseEntity> getInventory( public ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -105,18 +117,20 @@ public ResponseEntity getOrderById( public ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 4cfb300ab524..8b7791294a9b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -9,15 +9,19 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -25,6 +29,10 @@ @Api(value = "user", description = "the user API") public interface UserApi { + default Optional getRequest() { + return Optional.empty(); + } + /** * POST /user : Create user * This can only be done by the logged in user. @@ -45,9 +53,12 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) - ResponseEntity createUser( + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -69,9 +80,12 @@ ResponseEntity createUser( method = RequestMethod.POST, value = "/user/createWithArray" ) - ResponseEntity createUsersWithArrayInput( + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -93,9 +107,12 @@ ResponseEntity createUsersWithArrayInput( method = RequestMethod.POST, value = "/user/createWithList" ) - ResponseEntity createUsersWithListInput( + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -120,9 +137,12 @@ ResponseEntity createUsersWithListInput( method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser( + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -150,9 +170,26 @@ ResponseEntity deleteUser( value = "/user/{username}", produces = { "application/xml", "application/json" } ) - ResponseEntity getUserByName( + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ); + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -179,10 +216,13 @@ ResponseEntity getUserByName( value = "/user/login", produces = { "application/xml", "application/json" } ) - ResponseEntity loginUser( + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -203,9 +243,12 @@ ResponseEntity loginUser( method = RequestMethod.GET, value = "/user/logout" ) - ResponseEntity logoutUser( + default ResponseEntity logoutUser( - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } /** @@ -231,9 +274,12 @@ ResponseEntity logoutUser( method = RequestMethod.PUT, value = "/user/{username}" ) - ResponseEntity updateUser( + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ); + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index f7527e6836f1..e63fcb4a8ea4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -3,6 +3,10 @@ import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -14,14 +18,15 @@ import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; import javax.validation.constraints.*; import javax.validation.Valid; + import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -36,6 +41,11 @@ public UserApiController(NativeWebRequest request) { this.request = request; } + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + /** * POST /user : Create user * This can only be done by the logged in user. @@ -107,18 +117,20 @@ public ResponseEntity deleteUser( public ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } } - } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 2874aee40b58..ea719cc4ad89 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 303eb0c55db0..a4ec39252ebe 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 1cac5fc9adca..47db34f7b504 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 67b605455de9..5851aa2c2498 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index faeaecb95cd2..bba3dce1a55e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 522c7e8dda03..5f48487e05d6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -10,6 +10,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 617d4fb867fd..40ca1af6ab4f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 74e04286771a..ddc76e27b19f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java index 4bdbbcad59db..1dc5fc69c61b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 2b0522be2b08..3859dcfdcc05 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 3ef80f22c568..a90ce117c238 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 309656c30172..e8f37b16d5cb 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -10,6 +10,7 @@ import java.util.List; import org.openapitools.model.ReadOnlyFirst; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java index 60748a7366ac..37c928a79482 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java index 9fd111c8430c..9fb7bfef1800 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -9,6 +9,7 @@ import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index 025bcca8b97b..7f699ced5842 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java index 06d98844c504..8adf35c2fa00 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java index 2bffe7eecb0e..72e9288b53af 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java index 9bc13add64aa..9891fe7dafce 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java index daf01294455d..3ee8ac596893 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -9,6 +9,7 @@ import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 9c3e02b94529..c081b7517a47 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index a22d2583b128..b85ad3e155ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java index 233a854ff582..c2abaaed4305 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 44433a449d13..ba5b8c323a9a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java index baed9c12618f..685394664974 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 552cfcd2ee83..01149ce8f6ae 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 0c5b3f3d3306..153641cacd56 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -14,6 +14,7 @@ import java.util.UUID; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 846cb351f3c1..d235c68a51ff 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java index 7f0aec42b478..27e3cea8e6ed 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 53b1f8fe6b14..e490e2a61ef7 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ import org.openapitools.model.Animal; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java index b3ce6a2a9c9b..56b222f4e45b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 7c53ec981595..131e671e9160 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java index 7384ea7824cd..7800a7d698f7 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index c3e5771a8d27..a933badc4910 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java index 96cadd497361..febe2115a665 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index 4ed41292ec07..dcf5c5e801a6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java index b6eab7cba8a3..6bd55e5a1548 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java @@ -10,6 +10,7 @@ import java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 2fa1e8576afe..eca5e7cd4fa5 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java index 542939a2a636..1f09d0a5d17a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -4,6 +4,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index d96e2585864b..d330c28e6791 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -12,6 +12,7 @@ import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 5cf483cb584b..e2ddfcdfcb17 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 8bee0349830a..cbc94826b926 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java index 0131b8854d89..03b4ffcdadca 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 39e0fa94cc76..01e5d5f3fccd 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index afe25703c928..e907ad9c28e7 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java index f443caa28bf0..cff62427bf1a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java index f9ffb03d0ad0..930edebcef74 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 4bad7b07b87d..225f2f6d443d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java index c150dba343e5..f0ae3ff20eac 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,9 +1,39 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +54,320 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 1fb4dc597f84..aa2911fd85e6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..59504a7e6241 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,32 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; +import org.openapitools.model.Pet; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +47,192 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, + @ApiIgnore final Pageable pageable + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, + @ApiIgnore final Pageable pageable + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..d519896475f2 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,30 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +45,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..e63fcb4a8ea4 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,31 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 4bad7b07b87d..225f2f6d443d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java index c150dba343e5..0954aacd9ad0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,9 +1,39 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +54,320 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 1fb4dc597f84..aa2911fd85e6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..f5f401b64fc0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,31 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,190 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) Optional apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..d519896475f2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,30 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +45,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..e63fcb4a8ea4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,31 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java index 7245dbfc6448..a5fa04c024da 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java @@ -1,9 +1,29 @@ package org.openapitools.virtualan.api; +import org.openapitools.virtualan.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java index ece740199a68..223654abecfe 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java @@ -1,9 +1,39 @@ package org.openapitools.virtualan.api; +import java.math.BigDecimal; +import org.openapitools.virtualan.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.virtualan.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.virtualan.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.virtualan.model.OuterComposite; +import org.openapitools.virtualan.model.User; +import org.openapitools.virtualan.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +54,320 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java index b49aa3047d7e..717cff16ca9e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java @@ -1,9 +1,29 @@ package org.openapitools.virtualan.api; +import org.openapitools.virtualan.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java index 944d8536c305..5b6eae27d4d7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java @@ -1,9 +1,31 @@ package org.openapitools.virtualan.api; +import org.openapitools.virtualan.model.ModelApiResponse; +import org.openapitools.virtualan.model.Pet; +import java.util.Set; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,190 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java index d7441d6c6e04..acb5a7eb95f6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java @@ -1,9 +1,30 @@ package org.openapitools.virtualan.api; +import java.util.Map; +import org.openapitools.virtualan.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +45,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java index 676266d17024..f6c3ee34fb62 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java @@ -1,9 +1,31 @@ package org.openapitools.virtualan.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.virtualan.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 4bad7b07b87d..225f2f6d443d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + public ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java index c150dba343e5..4238e9d938f3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,9 +1,39 @@ package org.openapitools.api; +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +54,320 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + public ResponseEntity createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + public ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + public ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + public ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + public ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + public ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + public ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + public ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + public ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + public ResponseEntity testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + public ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + public ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + public ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + public ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + public ResponseEntity uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 1fb4dc597f84..aa2911fd85e6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,9 +1,29 @@ package org.openapitools.api; +import org.openapitools.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +44,28 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + public ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java index 4ad9ef06158b..b42164232455 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java @@ -1,9 +1,31 @@ package org.openapitools.api; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,190 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + public ResponseEntity deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + public ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + public ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + public ResponseEntity getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + public ResponseEntity updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + public ResponseEntity uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java index 293d3035f805..d519896475f2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,9 +1,30 @@ package org.openapitools.api; +import java.util.Map; +import org.openapitools.model.Order; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +45,94 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + public ResponseEntity deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + public ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + public ResponseEntity getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java index aab4767a50d0..e63fcb4a8ea4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java @@ -1,9 +1,31 @@ package org.openapitools.api; +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + +import io.swagger.annotations.*; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; import java.util.Optional; import javax.annotation.Generated; @@ -24,4 +46,141 @@ public Optional getRequest() { return Optional.ofNullable(request); } + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + public ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + public ResponseEntity deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + public ResponseEntity getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + public ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + public ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + public ResponseEntity updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + } From 00e23490bd6ddb0dc595f28201bd6e3c8e13f182 Mon Sep 17 00:00:00 2001 From: cachescrubber <5127753+cachescrubber@users.noreply.github.com> Date: Tue, 15 Feb 2022 02:39:30 +0100 Subject: [PATCH 059/111] Decomission threetenbp support. (#11608) --- .../codegen/languages/SpringCodegen.java | 11 - .../customInstantDeserializer.mustache | 232 ------------------ .../JavaSpring/jacksonConfiguration.mustache | 23 -- .../libraries/spring-boot/pom.mustache | 7 - .../libraries/spring-cloud/pom.mustache | 9 - .../openapiDocumentationConfig.mustache | 4 - .../configuration/JacksonConfiguration.java | 23 -- .../configuration/JacksonConfiguration.java | 23 -- .../configuration/JacksonConfiguration.java | 23 -- .../configuration/JacksonConfiguration.java | 23 -- 10 files changed, 378 deletions(-) delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/customInstantDeserializer.mustache delete mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/jacksonConfiguration.mustache delete mode 100644 samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/JacksonConfiguration.java delete mode 100644 samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/JacksonConfiguration.java delete mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/JacksonConfiguration.java delete mode 100644 samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/JacksonConfiguration.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 0ed2ddcec8f4..8b1a16e4b972 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -474,17 +474,6 @@ public void processOpts() { (sourceFolder + File.separator + apiPackage).replace(".", java.io.File.separator), "ApiUtil.java")); } - if ("threetenbp".equals(dateLibrary)) { - supportingFiles.add(new SupportingFile("customInstantDeserializer.mustache", - (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), - "CustomInstantDeserializer.java")); - if (SPRING_BOOT.equals(library) || SPRING_CLOUD_LIBRARY.equals(library)) { - supportingFiles.add(new SupportingFile("jacksonConfiguration.mustache", - (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), - "JacksonConfiguration.java")); - } - } - if (!delegatePattern || delegateMethod) { additionalProperties.put("jdk8-no-delegate", true); } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/customInstantDeserializer.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/customInstantDeserializer.mustache deleted file mode 100644 index da7b57a61339..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/customInstantDeserializer.mustache +++ /dev/null @@ -1,232 +0,0 @@ -package {{configPackage}}; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/jacksonConfiguration.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/jacksonConfiguration.mustache deleted file mode 100644 index e96aa772c689..000000000000 --- a/modules/openapi-generator/src/main/resources/JavaSpring/jacksonConfiguration.mustache +++ /dev/null @@ -1,23 +0,0 @@ -package {{configPackage}}; - -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZonedDateTime; - -@Configuration -public class JacksonConfiguration { - - @Bean - @ConditionalOnMissingBean(ThreeTenModule.class) - ThreeTenModule threeTenModule() { - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - return module; - } -} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index ccdd99326ace..0a282788132e 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -182,13 +182,6 @@ jackson-datatype-joda {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 - - {{/threetenbp}} {{#openApiNullable}} org.openapitools diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index 41a40decfc73..44ff87dd110b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -129,15 +129,6 @@ jackson-datatype-joda {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - {{^parentOverridden}} - 2.9.10 - {{/parentOverridden}} - - {{/threetenbp}} {{#openApiNullable}} org.openapitools diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache index eabd41caf918..4885990228c1 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache @@ -53,10 +53,6 @@ public class SpringFoxConfiguration { .directModelSubstitute(org.joda.time.LocalDate.class, java.sql.Date.class) .directModelSubstitute(org.joda.time.DateTime.class, java.util.Date.class) {{/joda}} - {{#threetenbp}} - .directModelSubstitute(org.threeten.bp.LocalDate.class, java.sql.Date.class) - .directModelSubstitute(org.threeten.bp.OffsetDateTime.class, java.util.Date.class) - {{/threetenbp}} {{#useOptional}} .genericModelSubstitutes(Optional.class) {{/useOptional}} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/JacksonConfiguration.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/JacksonConfiguration.java deleted file mode 100644 index b481a87518f4..000000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/JacksonConfiguration.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZonedDateTime; - -@Configuration -public class JacksonConfiguration { - - @Bean - @ConditionalOnMissingBean(ThreeTenModule.class) - ThreeTenModule threeTenModule() { - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - return module; - } -} diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/JacksonConfiguration.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/JacksonConfiguration.java deleted file mode 100644 index b481a87518f4..000000000000 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/JacksonConfiguration.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZonedDateTime; - -@Configuration -public class JacksonConfiguration { - - @Bean - @ConditionalOnMissingBean(ThreeTenModule.class) - ThreeTenModule threeTenModule() { - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - return module; - } -} diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/JacksonConfiguration.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/JacksonConfiguration.java deleted file mode 100644 index b481a87518f4..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/JacksonConfiguration.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZonedDateTime; - -@Configuration -public class JacksonConfiguration { - - @Bean - @ConditionalOnMissingBean(ThreeTenModule.class) - ThreeTenModule threeTenModule() { - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - return module; - } -} diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/JacksonConfiguration.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/JacksonConfiguration.java deleted file mode 100644 index b481a87518f4..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/JacksonConfiguration.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.configuration; - -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZonedDateTime; - -@Configuration -public class JacksonConfiguration { - - @Bean - @ConditionalOnMissingBean(ThreeTenModule.class) - ThreeTenModule threeTenModule() { - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - return module; - } -} From 5c0d861f967ad72fc3cdda59469c0ed5a5768aeb Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 15 Feb 2022 09:45:01 +0800 Subject: [PATCH 060/111] add link to presentation --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 075624373191..c73a8bb65a44 100644 --- a/README.md +++ b/README.md @@ -758,6 +758,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2019-11-26 - [CordaCon 2019 Highlights: Braid Server and OpenAPI Generator for Corda Client API’s](https://blog.b9lab.com/cordacon-2019-highlights-braid-server-and-openapi-generator-for-corda-flows-api-s-d24179ccb27c) by [Adel Rustum](https://blog.b9lab.com/@adelrestom) at [B9lab](https://blog.b9lab.com/) - 2019-12-03 - [A Road to Less Coding: Auto-Generate APILibrary](https://www.corda.net/blog/a-road-to-less-coding-auto-generate-apilibrary/) at [Corda Blog](https://www.corda.net/blog/) - 2019-12-04 - [Angular+NestJS+OpenAPI(Swagger)でマイクロサービスを視野に入れた環境を考える](https://qiita.com/teracy55/items/0327c7a170ec772970c6) by [てらしー](https://twitter.com/teracy55) +- 2019-12-05 - [Code generation on the Java VM](https://speakerdeck.com/sullis/code-generation-on-the-java-vm-2019-12-05) by [Sean Sullivan](https://speakerdeck.com/sullis) - 2019-12-17 - [OpenAPI Generator で OAuth2 アクセストークン発行のコードまで生成してみる](https://www.techscore.com/blog/2019/12/17/openapi-generator-oauth2-accesstoken/) by [TECHSCORE](https://www.techscore.com/blog/) - 2019-12-23 - [Use Ada for Your Web Development](https://www.electronicdesign.com/technologies/embedded-revolution/article/21119177/use-ada-for-your-web-development) by [Stephane Carrez](https://github.com/stcarrez) - 2019-12-23 - [OpenAPIのスキーマを分割・構造化していく方法](https://gift-tech.co.jp/articles/structured-openapi-schema) by [小飯塚達也](https://github.com/t2h5) at [GiFT, Inc](https://gift-tech.co.jp/) From 7555018aa646e3c71a03d8d5d4f684d68dac2cc2 Mon Sep 17 00:00:00 2001 From: matthiasloeu <64127331+matthiasloeu@users.noreply.github.com> Date: Tue, 15 Feb 2022 09:54:14 +0800 Subject: [PATCH 061/111] Add default value (#11600) --- .../src/main/resources/JavaVertXWebServer/queryParams.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/queryParams.mustache index 70a410519557..5da5fc9f654f 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/queryParams.mustache @@ -4,7 +4,7 @@ {{{dataType}}} {{paramName}} = requestParameters.queryParameter("{{baseName}}") != null ? DatabindCodec.mapper().convertValue(requestParameters.queryParameter("{{baseName}}").get(), new TypeReference<{{{dataType}}}>(){}) : null; {{/isModel}} {{^isModel}} - {{{dataType}}} {{paramName}} = requestParameters.queryParameter("{{baseName}}") != null ? requestParameters.queryParameter("{{baseName}}").get{{dataType}}() : null; + {{{dataType}}} {{paramName}} = requestParameters.queryParameter("{{baseName}}") != null ? requestParameters.queryParameter("{{baseName}}").get{{dataType}}() : {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{.}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{#isBoolean}}{{.}}{{/isBoolean}}{{#isLong}}{{.}}L{{/isLong}}{{^isLong}}{{#isInteger}}{{.}}{{/isInteger}}{{^isInteger}}{{#isShort}}{{.}}{{/isShort}}{{/isInteger}}{{/isLong}}{{/defaultValue}}; {{/isModel}} {{/isArray}} {{#isArray}} From ba047208982ac33a6a6f55abebaf63099385b661 Mon Sep 17 00:00:00 2001 From: Lennart Schwahn Date: Tue, 15 Feb 2022 03:35:46 +0100 Subject: [PATCH 062/111] fix #6134 by considering the type List (#11361) The method buildRequestBodyMultipart in ApiClient.java now recognizes if an input parameter is an instance of List. --- .../libraries/okhttp-gson/ApiClient.mustache | 22 ++++++++++++++++--- .../org/openapitools/client/ApiClient.java | 22 ++++++++++++++++--- .../org/openapitools/client/ApiClient.java | 22 ++++++++++++++++--- .../org/openapitools/client/ApiClient.java | 22 ++++++++++++++++--- .../org/openapitools/client/ApiClient.java | 22 ++++++++++++++++--- 5 files changed, 95 insertions(+), 15 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index e2bbb004f93e..f678b9d6f226 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -1522,9 +1522,12 @@ public class ApiClient { for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List files = (List) param.getValue(); + for (File file : files) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } } else { Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); @@ -1548,6 +1551,19 @@ public class ApiClient { } } + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + /** * Get network interceptor to add it to the httpClient to track download progress for * async requests. diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java index 6c97a04c6b43..7b52fe547a95 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java @@ -1317,9 +1317,12 @@ public RequestBody buildRequestBodyMultipart(Map formParams) { for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List files = (List) param.getValue(); + for (File file : files) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } } else { Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); @@ -1343,6 +1346,19 @@ public String guessContentTypeFromFile(File file) { } } + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + /** * Get network interceptor to add it to the httpClient to track download progress for * async requests. diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java index eb4b02d4f32c..bb5a40250e79 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java @@ -1395,9 +1395,12 @@ public RequestBody buildRequestBodyMultipart(Map formParams) { for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List files = (List) param.getValue(); + for (File file : files) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } } else { Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); @@ -1421,6 +1424,19 @@ public String guessContentTypeFromFile(File file) { } } + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + /** * Get network interceptor to add it to the httpClient to track download progress for * async requests. diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index c30989218335..627f9ac88d59 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -1396,9 +1396,12 @@ public RequestBody buildRequestBodyMultipart(Map formParams) { for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List files = (List) param.getValue(); + for (File file : files) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } } else { Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); @@ -1422,6 +1425,19 @@ public String guessContentTypeFromFile(File file) { } } + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + /** * Get network interceptor to add it to the httpClient to track download progress for * async requests. diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index d745edd6e62b..081e1c1f34c0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -1415,9 +1415,12 @@ public RequestBody buildRequestBodyMultipart(Map formParams) { for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List files = (List) param.getValue(); + for (File file : files) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } } else { Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); @@ -1441,6 +1444,19 @@ public String guessContentTypeFromFile(File file) { } } + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + /** * Get network interceptor to add it to the httpClient to track download progress for * async requests. From a4fcd1c9247b8932da12daed7fcd6635a99d5799 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 15 Feb 2022 10:42:55 +0800 Subject: [PATCH 063/111] avoid Double Brace Initialization (DBI) (#11609) --- .../JavaMicronautAbstractCodegen.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java index 79b478360e26..70a10a9bdce8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java @@ -86,18 +86,18 @@ public JavaMicronautAbstractCodegen() { cliOptions.add(CliOption.newBoolean(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "Allow only to create models with all the required properties provided in constructor", requiredPropertiesInConstructor)); CliOption buildToolOption = new CliOption(OPT_BUILD, "Specify for which build tool to generate files").defaultValue(buildTool); - buildToolOption.setEnum(new HashMap() {{ - put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project"); - put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project"); - put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated"); - }}); + Map buildToolOptionMap = new HashMap(); + buildToolOptionMap.put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project"); + buildToolOptionMap.put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project"); + buildToolOptionMap.put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated"); + buildToolOption.setEnum(buildToolOptionMap); cliOptions.add(buildToolOption); CliOption testToolOption = new CliOption(OPT_TEST, "Specify which test tool to generate files for").defaultValue(testTool); - testToolOption.setEnum(new HashMap() {{ - put(OPT_TEST_JUNIT, "Use JUnit as test tool"); - put(OPT_TEST_SPOCK, "Use Spock as test tool"); - }}); + Map testToolOptionMap = new HashMap(); + testToolOptionMap.put(OPT_TEST_JUNIT, "Use JUnit as test tool"); + testToolOptionMap.put(OPT_TEST_SPOCK, "Use Spock as test tool"); + testToolOption.setEnum(testToolOptionMap); cliOptions.add(testToolOption); // Remove the date library option From d7b812ad42bbb2dc108e9d248360a93aa90ff092 Mon Sep 17 00:00:00 2001 From: devhl-labs Date: Mon, 14 Feb 2022 21:44:23 -0500 Subject: [PATCH 064/111] [charp-netcore] Constructor Improvements (#11502) * refactor nrt annotation * enable nrt by default in .net6.0+ * use shorter nrt annotation * build samples * removed debugging lines * fixed model and operatoin constructors * reverted a commented line for comparison * created library modelGeneric, removed debugging lines * build samples * build all samples * avoid breaking changes * publish and build samples * added line break --- docs/generators/csharp-netcore.md | 1 - .../languages/AbstractCSharpCodegen.java | 15 +- .../languages/CSharpNetCoreClientCodegen.java | 83 ++- .../mustache/OptionalParameterLambda.java | 69 +++ .../mustache/RequiredParameterLambda.java | 62 +++ .../generichost/modelGeneric.mustache | 488 ++++++++++++++++++ .../csharp-netcore/netcore_project.mustache | 2 +- .../netcore_testproject.mustache | 2 +- .../docs/models/Category.md | 2 +- .../docs/models/ChildCat.md | 2 +- .../docs/models/EnumTest.md | 2 +- .../docs/models/FormatTest.md | 8 +- .../docs/models/FruitReq.md | 2 +- .../docs/models/HealthCheckResult.md | 2 +- .../docs/models/Mammal.md | 2 +- .../docs/models/NullableClass.md | 2 +- .../docs/models/Pet.md | 4 +- .../docs/models/Whale.md | 2 +- .../docs/models/Zebra.md | 2 +- .../Org.OpenAPITools.Test.csproj | 2 +- .../Model/AdditionalPropertiesClass.cs | 18 +- .../src/Org.OpenAPITools/Model/Animal.cs | 11 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 8 +- .../src/Org.OpenAPITools/Model/Apple.cs | 6 +- .../src/Org.OpenAPITools/Model/AppleReq.cs | 8 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 4 +- .../Model/ArrayOfNumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 8 +- .../src/Org.OpenAPITools/Model/Banana.cs | 4 +- .../src/Org.OpenAPITools/Model/BananaReq.cs | 4 +- .../src/Org.OpenAPITools/Model/BasquePig.cs | 6 +- .../Org.OpenAPITools/Model/Capitalization.cs | 14 +- .../src/Org.OpenAPITools/Model/Cat.cs | 6 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/Category.cs | 24 +- .../src/Org.OpenAPITools/Model/ChildCat.cs | 10 +- .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 4 +- .../Model/ComplexQuadrilateral.cs | 10 +- .../src/Org.OpenAPITools/Model/DanishPig.cs | 6 +- .../Model/DeprecatedObject.cs | 4 +- .../src/Org.OpenAPITools/Model/Dog.cs | 6 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/Drawing.cs | 10 +- .../src/Org.OpenAPITools/Model/EnumArrays.cs | 4 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 28 +- .../Model/EquilateralTriangle.cs | 10 +- .../src/Org.OpenAPITools/Model/File.cs | 4 +- .../Model/FileSchemaTestClass.cs | 6 +- .../src/Org.OpenAPITools/Model/Foo.cs | 7 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 170 +++--- .../Model/GrandparentAnimal.cs | 6 +- .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 4 +- .../Model/HealthCheckResult.cs | 2 +- .../Model/InlineResponseDefault.cs | 4 +- .../Model/IsoscelesTriangle.cs | 10 +- .../src/Org.OpenAPITools/Model/List.cs | 4 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 10 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 8 +- .../Model/Model200Response.cs | 6 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 4 +- .../src/Org.OpenAPITools/Model/Name.cs | 8 +- .../Org.OpenAPITools/Model/NullableClass.cs | 14 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 4 +- .../Model/ObjectWithDeprecatedFields.cs | 10 +- .../src/Org.OpenAPITools/Model/Order.cs | 12 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 8 +- .../src/Org.OpenAPITools/Model/Pet.cs | 50 +- .../Model/QuadrilateralInterface.cs | 6 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 6 +- .../src/Org.OpenAPITools/Model/Return.cs | 4 +- .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 10 +- .../Org.OpenAPITools/Model/ShapeInterface.cs | 6 +- .../Model/SimpleQuadrilateral.cs | 10 +- .../Model/SpecialModelName.cs | 6 +- .../src/Org.OpenAPITools/Model/Tag.cs | 6 +- .../Model/TriangleInterface.cs | 6 +- .../src/Org.OpenAPITools/Model/User.cs | 26 +- .../src/Org.OpenAPITools/Model/Whale.cs | 30 +- .../src/Org.OpenAPITools/Model/Zebra.cs | 12 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../docs/models/Category.md | 2 +- .../docs/models/ChildCat.md | 2 +- .../docs/models/EnumTest.md | 2 +- .../docs/models/FormatTest.md | 8 +- .../docs/models/FruitReq.md | 2 +- .../docs/models/Mammal.md | 2 +- .../docs/models/Pet.md | 4 +- .../docs/models/Whale.md | 2 +- .../docs/models/Zebra.md | 2 +- .../Model/AdditionalPropertiesClass.cs | 2 +- .../src/Org.OpenAPITools/Model/Animal.cs | 2 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 2 +- .../src/Org.OpenAPITools/Model/Apple.cs | 2 +- .../src/Org.OpenAPITools/Model/AppleReq.cs | 2 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 2 +- .../Model/ArrayOfNumberOnly.cs | 2 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 2 +- .../src/Org.OpenAPITools/Model/Banana.cs | 2 +- .../src/Org.OpenAPITools/Model/BananaReq.cs | 2 +- .../src/Org.OpenAPITools/Model/BasquePig.cs | 2 +- .../Org.OpenAPITools/Model/Capitalization.cs | 2 +- .../src/Org.OpenAPITools/Model/Cat.cs | 4 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 2 +- .../src/Org.OpenAPITools/Model/Category.cs | 20 +- .../src/Org.OpenAPITools/Model/ChildCat.cs | 8 +- .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 2 +- .../Model/ComplexQuadrilateral.cs | 2 +- .../src/Org.OpenAPITools/Model/DanishPig.cs | 2 +- .../Model/DeprecatedObject.cs | 2 +- .../src/Org.OpenAPITools/Model/Dog.cs | 4 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 2 +- .../src/Org.OpenAPITools/Model/Drawing.cs | 2 +- .../src/Org.OpenAPITools/Model/EnumArrays.cs | 4 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 42 +- .../Model/EquilateralTriangle.cs | 2 +- .../src/Org.OpenAPITools/Model/File.cs | 2 +- .../Model/FileSchemaTestClass.cs | 2 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 142 ++--- .../Model/GrandparentAnimal.cs | 2 +- .../Model/HealthCheckResult.cs | 2 +- .../Model/InlineResponseDefault.cs | 2 +- .../Model/IsoscelesTriangle.cs | 2 +- .../src/Org.OpenAPITools/Model/List.cs | 2 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 2 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 2 +- .../Model/Model200Response.cs | 2 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 2 +- .../src/Org.OpenAPITools/Model/Name.cs | 2 +- .../Org.OpenAPITools/Model/NullableClass.cs | 2 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 2 +- .../Model/ObjectWithDeprecatedFields.cs | 2 +- .../src/Org.OpenAPITools/Model/Order.cs | 4 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 2 +- .../src/Org.OpenAPITools/Model/Pet.cs | 46 +- .../Model/QuadrilateralInterface.cs | 2 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 2 +- .../src/Org.OpenAPITools/Model/Return.cs | 2 +- .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 2 +- .../Org.OpenAPITools/Model/ShapeInterface.cs | 2 +- .../Model/SimpleQuadrilateral.cs | 2 +- .../Model/SpecialModelName.cs | 2 +- .../src/Org.OpenAPITools/Model/Tag.cs | 2 +- .../Model/TriangleInterface.cs | 2 +- .../src/Org.OpenAPITools/Model/User.cs | 2 +- .../src/Org.OpenAPITools/Model/Whale.cs | 22 +- .../src/Org.OpenAPITools/Model/Zebra.cs | 10 +- .../docs/models/Category.md | 2 +- .../docs/models/ChildCat.md | 2 +- .../docs/models/EnumTest.md | 2 +- .../docs/models/FormatTest.md | 8 +- .../docs/models/FruitReq.md | 2 +- .../docs/models/Mammal.md | 2 +- .../docs/models/Pet.md | 4 +- .../docs/models/Whale.md | 2 +- .../docs/models/Zebra.md | 2 +- .../Model/AdditionalPropertiesClass.cs | 2 +- .../src/Org.OpenAPITools/Model/Animal.cs | 2 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 2 +- .../src/Org.OpenAPITools/Model/Apple.cs | 2 +- .../src/Org.OpenAPITools/Model/AppleReq.cs | 2 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 2 +- .../Model/ArrayOfNumberOnly.cs | 2 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 2 +- .../src/Org.OpenAPITools/Model/Banana.cs | 2 +- .../src/Org.OpenAPITools/Model/BananaReq.cs | 2 +- .../src/Org.OpenAPITools/Model/BasquePig.cs | 2 +- .../Org.OpenAPITools/Model/Capitalization.cs | 2 +- .../src/Org.OpenAPITools/Model/Cat.cs | 4 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 2 +- .../src/Org.OpenAPITools/Model/Category.cs | 20 +- .../src/Org.OpenAPITools/Model/ChildCat.cs | 8 +- .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 2 +- .../Model/ComplexQuadrilateral.cs | 2 +- .../src/Org.OpenAPITools/Model/DanishPig.cs | 2 +- .../Model/DeprecatedObject.cs | 2 +- .../src/Org.OpenAPITools/Model/Dog.cs | 4 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 2 +- .../src/Org.OpenAPITools/Model/Drawing.cs | 2 +- .../src/Org.OpenAPITools/Model/EnumArrays.cs | 4 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 42 +- .../Model/EquilateralTriangle.cs | 2 +- .../src/Org.OpenAPITools/Model/File.cs | 2 +- .../Model/FileSchemaTestClass.cs | 2 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 142 ++--- .../Model/GrandparentAnimal.cs | 2 +- .../Model/HealthCheckResult.cs | 2 +- .../Model/InlineResponseDefault.cs | 2 +- .../Model/IsoscelesTriangle.cs | 2 +- .../src/Org.OpenAPITools/Model/List.cs | 2 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 2 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 2 +- .../Model/Model200Response.cs | 2 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 2 +- .../src/Org.OpenAPITools/Model/Name.cs | 2 +- .../Org.OpenAPITools/Model/NullableClass.cs | 2 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 2 +- .../Model/ObjectWithDeprecatedFields.cs | 2 +- .../src/Org.OpenAPITools/Model/Order.cs | 4 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 2 +- .../src/Org.OpenAPITools/Model/Pet.cs | 46 +- .../Model/QuadrilateralInterface.cs | 2 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 2 +- .../src/Org.OpenAPITools/Model/Return.cs | 2 +- .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 2 +- .../Org.OpenAPITools/Model/ShapeInterface.cs | 2 +- .../Model/SimpleQuadrilateral.cs | 2 +- .../Model/SpecialModelName.cs | 2 +- .../src/Org.OpenAPITools/Model/Tag.cs | 2 +- .../Model/TriangleInterface.cs | 2 +- .../src/Org.OpenAPITools/Model/User.cs | 2 +- .../src/Org.OpenAPITools/Model/Whale.cs | 22 +- .../src/Org.OpenAPITools/Model/Zebra.cs | 10 +- 215 files changed, 1558 insertions(+), 762 deletions(-) create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/OptionalParameterLambda.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/RequiredParameterLambda.java create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/modelGeneric.mustache diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index b1d67360295c..9b6459e8287f 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -41,7 +41,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |packageVersion|C# package version.| |1.0.0| |releaseNote|Release note, default to 'Minor update'.| |Minor update| |returnICollection|Return ICollection<T> instead of the concrete type.| |false| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| |targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|
    **netstandard1.3**
    .NET Standard 1.3 compatible
    **netstandard1.4**
    .NET Standard 1.4 compatible
    **netstandard1.5**
    .NET Standard 1.5 compatible
    **netstandard1.6**
    .NET Standard 1.6 compatible
    **netstandard2.0**
    .NET Standard 2.0 compatible
    **netstandard2.1**
    .NET Standard 2.1 compatible
    **netcoreapp2.0**
    .NET Core 2.0 compatible (deprecated)
    **netcoreapp2.1**
    .NET Core 2.1 compatible (deprecated)
    **netcoreapp3.0**
    .NET Core 3.0 compatible (deprecated)
    **netcoreapp3.1**
    .NET Core 3.1 compatible
    **net47**
    .NET Framework 4.7 compatible
    **net5.0**
    .NET 5.0 compatible
    **net6.0**
    .NET 6.0 compatible
    |netstandard2.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index 359101c3556b..fefad19184a0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -214,6 +214,11 @@ public AbstractCSharpCodegen() { valueTypes = new HashSet<>( Arrays.asList("decimal", "bool", "int", "float", "long", "double") ); + + this.setSortParamsByRequiredFlag(true); + + // do it only on newer libraries to avoid breaking changes + // this.setSortModelPropertiesByRequiredFlag(true); } public void setReturnICollection(boolean returnICollection) { @@ -396,7 +401,9 @@ public void processOpts() { @Override protected ImmutableMap.Builder addMustacheLambdas() { return super.addMustacheLambdas() - .put("camelcase_param", new CamelCaseLambda().generator(this).escapeAsParamName(true)); + .put("camelcase_param", new CamelCaseLambda().generator(this).escapeAsParamName(true)) + .put("required", new RequiredParameterLambda().generator(this)) + .put("optional", new OptionalParameterLambda().generator(this)); } @Override @@ -1167,16 +1174,18 @@ public void setNullableReferenceTypes(final Boolean nullReferenceTypesFlag){ additionalProperties.put("nrt", nullReferenceTypesFlag); if (nullReferenceTypesFlag){ - this.nullableType.add("string"); additionalProperties.put("nrt?", "?"); additionalProperties.put("nrt!", "!"); } else { - this.nullableType.remove("string"); additionalProperties.remove("nrt?"); additionalProperties.remove("nrt!"); } } + public boolean getNullableReferencesTypes(){ + return this.nullReferenceTypesFlag; + } + public void setInterfacePrefix(final String interfacePrefix) { this.interfacePrefix = interfacePrefix; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index 12d8ec68770b..9ba892cace65 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -21,6 +21,8 @@ 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.Operation; +import io.swagger.v3.oas.models.servers.Server; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.utils.ModelUtils; @@ -33,6 +35,9 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; import static org.apache.commons.lang3.StringUtils.isEmpty; import static org.openapitools.codegen.utils.StringUtils.camelize; @@ -247,10 +252,6 @@ public CSharpNetCoreClientCodegen() { CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC, this.hideGenerationTimestamp); - addSwitch(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, - CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC, - this.sortParamsByRequiredFlag); - addSwitch(CodegenConstants.USE_DATETIME_OFFSET, CodegenConstants.USE_DATETIME_OFFSET_DESC, this.useDateTimeOffsetFlag); @@ -394,6 +395,40 @@ public CodegenModel fromModel(String name, Schema model) { } } + // avoid breaking changes + if (GENERICHOST.equals(getLibrary())){ + Comparator comparatorByDefaultValue = new Comparator() { + @Override + public int compare(CodegenProperty one, CodegenProperty another) { + if (one.defaultValue == another.defaultValue) + return 0; + else if (Boolean.FALSE.equals(one.defaultValue)) + return -1; + else + return 1; + } + }; + + Comparator comparatorByRequired = new Comparator() { + @Override + public int compare(CodegenProperty one, CodegenProperty another) { + if (one.required == another.required) + return 0; + else if (Boolean.TRUE.equals(one.required)) + return -1; + else + return 1; + } + }; + + Collections.sort(codegenModel.vars, comparatorByDefaultValue); + Collections.sort(codegenModel.vars, comparatorByRequired); + Collections.sort(codegenModel.allVars, comparatorByDefaultValue); + Collections.sort(codegenModel.allVars, comparatorByRequired); + Collections.sort(codegenModel.readWriteVars, comparatorByDefaultValue); + Collections.sort(codegenModel.readWriteVars, comparatorByRequired); + } + return codegenModel; } @@ -598,6 +633,8 @@ public void processOpts() { if (GENERICHOST.equals(getLibrary())){ setLibrary(GENERICHOST); additionalProperties.put("useGenericHost", true); + // all c# libraries should be doing this, but we only do it here to avoid breaking changes + this.setSortModelPropertiesByRequiredFlag(true); } else if (RESTSHARP.equals(getLibrary())) { additionalProperties.put("useRestSharp", true); needsCustomHttpMethod = true; @@ -733,6 +770,44 @@ else if (GENERICHOST.equals(getLibrary())){ addTestInstructions(); } + @Override + public CodegenOperation fromOperation(String path, + String httpMethod, + Operation operation, + List servers) { + CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); + + if (!GENERICHOST.equals(getLibrary())){ + return op; + } + + Collections.sort(op.allParams, new Comparator() { + @Override + public int compare(CodegenParameter one, CodegenParameter another) { + if (one.defaultValue == another.defaultValue) + return 0; + else if (Boolean.FALSE.equals(one.defaultValue)) + return -1; + else + return 1; + } + }); + + Collections.sort(op.allParams, new Comparator() { + @Override + public int compare(CodegenParameter one, CodegenParameter another) { + if (one.required == another.required) + return 0; + else if (Boolean.TRUE.equals(one.required)) + return -1; + else + return 1; + } + }); + + return op; + } + private void addTestInstructions(){ if (GENERICHOST.equals(getLibrary())){ additionalProperties.put("testInstructions", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/OptionalParameterLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/OptionalParameterLambda.java new file mode 100644 index 000000000000..3494628043a9 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/OptionalParameterLambda.java @@ -0,0 +1,69 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * 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.templating.mustache; + +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.languages.AbstractCSharpCodegen; + +import java.io.IOException; +import java.io.Writer; + +import static org.openapitools.codegen.utils.StringUtils.camelize; + +/** + * Appends trailing ? to a text fragement if not already present + * + * Register: + *
    + * additionalProperties.put("optional", new OptionalParameterLambda());
    + * 
    + * + * Use: + *
    + * {{#lambda.optional}}{{name}}{{/lambda.optional}}
    + * 
    + */ +public class OptionalParameterLambda implements Mustache.Lambda { + private CodegenConfig generator = null; + private Boolean escapeParam = false; + + public OptionalParameterLambda() {} + + public OptionalParameterLambda generator(final CodegenConfig generator) { + this.generator = generator; + return this; + } + + @Override + public void execute(Template.Fragment fragment, Writer writer) throws IOException { + String text = fragment.execute(); + + if (this.generator instanceof AbstractCSharpCodegen){ + AbstractCSharpCodegen csharpGenerator = (AbstractCSharpCodegen) this.generator; + if (csharpGenerator.getNullableReferencesTypes()){ + text = text.endsWith("?") + ? text + : text + "?"; + } + } + + writer.write(text); + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/RequiredParameterLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/RequiredParameterLambda.java new file mode 100644 index 000000000000..54b5fad703b7 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/RequiredParameterLambda.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * 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.templating.mustache; + +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; +import org.openapitools.codegen.CodegenConfig; + +import java.io.IOException; +import java.io.Writer; + +import static org.openapitools.codegen.utils.StringUtils.camelize; + +/** + * Strips trailing ? from a text fragement + * + * Register: + *
    + * additionalProperties.put("required", new RequiredParameterLambda());
    + * 
    + * + * Use: + *
    + * {{#lambda.required}}{{name}}{{/lambda.required}}
    + * 
    + */ +public class RequiredParameterLambda implements Mustache.Lambda { + private CodegenConfig generator = null; + private Boolean escapeParam = false; + + public RequiredParameterLambda() {} + + public RequiredParameterLambda generator(final CodegenConfig generator) { + this.generator = generator; + return this; + } + + @Override + public void execute(Template.Fragment fragment, Writer writer) throws IOException { + String text = fragment.execute(); + text = text.endsWith("?") + ? text.substring(0, text.length() - 1) + : text; + + writer.write(text); + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/modelGeneric.mustache new file mode 100644 index 000000000000..2ecca5b10e7d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/modelGeneric.mustache @@ -0,0 +1,488 @@ + /// + /// {{description}}{{^description}}{{classname}}{{/description}} + /// + [DataContract(Name = "{{{name}}}")] + {{#discriminator}} + [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] + {{#mappedModels}} + [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] + {{/mappedModels}} + {{/discriminator}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + { + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/isEnum}} + {{#isEnum}} + + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// + {{#description}} + /// {{.}} + {{/description}} + {{^conditionalSerialization}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{#isNullable}}{{#required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{#required}}{{{datatypeWithEnum}}}{{/required}}{{/isNullable}}{{#isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}} {{name}} { get; set; } + {{#isReadOnly}} + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{#isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{#isNullable}}{{#required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{#required}}{{{datatypeWithEnum}}}{{/required}}{{/isNullable}}{{#isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}} {{name}} { get; set; } + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + + {{^isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} + { + get{ return _{{name}};} + set + { + _{{name}} = value; + _flag{{name}} = true; + } + } + private {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; + private bool _flag{{name}}; + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return _flag{{name}}; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{/isEnum}} + {{/vars}} + {{#hasRequired}} + {{^hasOnlyReadOnly}} + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + {{^isAdditionalPropertiesTrue}} + protected {{classname}}() { } + {{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + protected {{classname}}() + { + this.AdditionalProperties = new Dictionary(); + } + {{/isAdditionalPropertiesTrue}} + {{/hasOnlyReadOnly}} + {{/hasRequired}} + /// + /// Initializes a new instance of the class. + /// + {{#readWriteVars}} + /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. + {{/readWriteVars}} + {{#hasOnlyReadOnly}} + [JsonConstructorAttribute] + {{/hasOnlyReadOnly}} + public {{classname}}({{#readWriteVars}}{{#isNullable}}{{#required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{#required}}{{{datatypeWithEnum}}}{{/required}}{{/isNullable}}{{#isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#defaultValue}} = {{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^required}}{{^defaultValue}} = default{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + { + {{#vars}} + {{^isInherited}} + {{^isReadOnly}} + {{#required}} + {{^conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) + if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) { + throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + } + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) + if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) { + throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + } + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{/required}} + {{/isReadOnly}} + {{/isInherited}} + {{/vars}} + {{#vars}} + {{^isInherited}} + {{^isReadOnly}} + {{^required}} + {{#defaultValue}} + {{^conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + // use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{{defaultValue}}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{/defaultValue}} + {{^defaultValue}} + {{^conditionalSerialization}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/conditionalSerialization}} + {{#conditionalSerialization}} + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/conditionalSerialization}} + {{/defaultValue}} + {{/required}} + {{/isReadOnly}} + {{/isInherited}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + this.AdditionalProperties = new Dictionary(); + {{/isAdditionalPropertiesTrue}} + } + + {{#vars}} + {{^isInherited}} + {{^isEnum}} + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// {{#description}} + /// {{.}}{{/description}} + {{^conditionalSerialization}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{#isNullable}}{{#required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{#required}}{{{datatypeWithEnum}}}{{/required}}{{/isNullable}}{{#isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + + {{#isReadOnly}} + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{#isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{#isNullable}}{{#lambda.optional}}{{{dataType}}}{{/lambda.optional}}{{/isNullable}}{{^isNullable}}{{{dataType}}}{{/isNullable}} {{name}} { get; private set; } + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{^isReadOnly}} + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{#required}}{{#lambda.required}}{{{dataType}}}{{/lambda.required}}{{/required}}{{^required}}{{#lambda.optional}}{{{dataType}}}{{/lambda.optional}}{{/required}} {{name}} + { + get{ return _{{name}};} + set + { + _{{name}} = value; + _flag{{name}} = true; + } + } + private {{{dataType}}} _{{name}}; + private bool _flag{{name}}; + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return _flag{{name}}; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{/isEnum}} + {{/isInherited}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + {{/isAdditionalPropertiesTrue}} + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + {{#parent}} + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + {{/parent}} + {{#vars}} + sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/vars}} + {{#isAdditionalPropertiesTrue}} + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + {{/isAdditionalPropertiesTrue}} + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public {{#parent}}{{^isArray}}{{^isMap}}override {{/isMap}}{{/isArray}}{{/parent}}{{^parent}}virtual {{/parent}}string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + { + return false; + } + return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} + ( + this.{{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}} + (this.{{name}} != null && + this.{{name}}.Equals(input.{{name}})) + {{/vendorExtensions.x-is-value-type}} + {{#vendorExtensions.x-is-value-type}} + this.{{name}}.Equals(input.{{name}}) + {{/vendorExtensions.x-is-value-type}} + ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} + ( + this.{{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}}this.{{name}} != null && + input.{{name}} != null && + {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}}) + ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); + {{/isAdditionalPropertiesTrue}} + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + {{#parent}} + int hashCode = base.GetHashCode(); + {{/parent}} + {{^parent}} + int hashCode = 41; + {{/parent}} + {{#vars}} + {{^vendorExtensions.x-is-value-type}} + if (this.{{name}} != null) + { + hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); + } + {{/vendorExtensions.x-is-value-type}} + {{#vendorExtensions.x-is-value-type}} + hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); + {{/vendorExtensions.x-is-value-type}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + {{/isAdditionalPropertiesTrue}} + return hashCode; + } + } + +{{#validatable}} +{{#discriminator}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { +{{/discriminator}} +{{^discriminator}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { +{{/discriminator}} + {{#parent}} + {{^isArray}} + {{^isMap}} + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + {{/isMap}} + {{/isArray}} + {{/parent}} + {{#vars}} + {{#hasValidation}} + {{^isEnum}} + {{#maxLength}} + // {{{name}}} ({{{dataType}}}) maxLength + if (this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); + } + + {{/maxLength}} + {{#minLength}} + // {{{name}}} ({{{dataType}}}) minLength + if (this.{{{name}}} != null && this.{{{name}}}.Length < {{minLength}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); + } + + {{/minLength}} + {{#maximum}} + // {{{name}}} ({{{dataType}}}) maximum + if (this.{{{name}}} > ({{{dataType}}}){{maximum}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value less than or equal to {{maximum}}.", new [] { "{{{name}}}" }); + } + + {{/maximum}} + {{#minimum}} + // {{{name}}} ({{{dataType}}}) minimum + if (this.{{{name}}} < ({{{dataType}}}){{minimum}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value greater than or equal to {{minimum}}.", new [] { "{{{name}}}" }); + } + + {{/minimum}} + {{#pattern}} + {{^isByteArray}} + // {{{name}}} ({{{dataType}}}) pattern + Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); + if (false == regex{{{name}}}.Match(this.{{{name}}}).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); + } + + {{/isByteArray}} + {{/pattern}} + {{/isEnum}} + {{/hasValidation}} + {{/vars}} + yield break; + } +{{/validatable}} + } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index 6cca9a0d1a2e..c675c7f35222 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -20,7 +20,7 @@ git{{#releaseNote}} {{.}}{{/releaseNote}}{{#packageTags}} {{{.}}}{{/packageTags}}{{#nrt}} - annotations{{/nrt}} + {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache index 3e0c54f8f0d1..d4b2048ae54f 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache @@ -5,7 +5,7 @@ {{testPackageName}} {{testTargetFramework}} false{{#nrt}} - annotations{{/nrt}} + {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Category.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Category.md index 6eb0a2e13eaa..c2cf3f8e919e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Category.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Category.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long** | | [optional] **Name** | **string** | | [default to "default-name"] +**Id** | **long** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCat.md index 88fe8f7a7fdd..48a3c7fd38d9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCat.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ChildCat.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] **PetType** | **string** | | [default to PetTypeEnum.ChildCat] +**Name** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumTest.md index d2b72b5368fb..71602270bab4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/EnumTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | +**EnumString** | **string** | | [optional] **EnumInteger** | **int** | | [optional] **EnumIntegerOnly** | **int** | | [optional] **EnumNumber** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md index b0d2f47b2eb6..0b92c2fb10a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md @@ -4,20 +4,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Number** | **decimal** | | +**Byte** | **byte[]** | | +**Date** | **DateTime** | | +**Password** | **string** | | **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] **Int64** | **long** | | [optional] -**Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] **Decimal** | **decimal** | | [optional] **String** | **string** | | [optional] -**Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime** | | **DateTime** | **DateTime** | | [optional] **Uuid** | **Guid** | | [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] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FruitReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FruitReq.md index 5afd947f4a63..5217febc9b68 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FruitReq.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FruitReq.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Cultivar** | **string** | | -**Mealy** | **bool** | | [optional] **LengthCm** | **decimal** | | +**Mealy** | **bool** | | [optional] **Sweet** | **bool** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HealthCheckResult.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HealthCheckResult.md index 8d91f2d854c2..682cfc50e3a4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HealthCheckResult.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/HealthCheckResult.md @@ -5,7 +5,7 @@ Just a string to inform instance is up and running. Make it nullable in hope to Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NullableMessage** | [**string?**](string?.md) | | [optional] +**NullableMessage** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Mammal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Mammal.md index 79d95fce63a3..82a8ca6027b5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Mammal.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Mammal.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | **HasBaleen** | **bool** | | [optional] **HasTeeth** | **bool** | | [optional] -**ClassName** | **string** | | **Type** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableClass.md index 88058fc4929a..d4a19d1856bc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/NullableClass.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **IntegerProp** | **int?** | | [optional] **NumberProp** | **decimal?** | | [optional] **BooleanProp** | **bool?** | | [optional] -**StringProp** | [**string?**](string?.md) | | [optional] +**StringProp** | **string** | | [optional] **DateProp** | **DateTime?** | | [optional] **DatetimeProp** | **DateTime?** | | [optional] **ArrayNullableProp** | **List<Object>** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pet.md index 6a9d41feb0d6..7de10304abf4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pet.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Pet.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long** | | [optional] -**Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | +**Id** | **long** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] **Tags** | [**List<Tag>**](Tag.md) | | [optional] **Status** | **string** | pet status in the store | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Whale.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Whale.md index afbc08409d22..1c633fdce61b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Whale.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Whale.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | **HasBaleen** | **bool** | | [optional] **HasTeeth** | **bool** | | [optional] -**ClassName** | **string** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Zebra.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Zebra.md index 4c5a820bac04..aef3866b92c9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Zebra.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Zebra.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | [optional] **ClassName** | **string** | | +**Type** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index be4790511afb..141777c62a83 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -5,7 +5,7 @@ Org.OpenAPITools.Test net6.0 false - annotations + enable diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b3ddad35a07d..19896e401bcb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -43,7 +43,7 @@ public partial class AdditionalPropertiesClass : IEquatablemapWithUndeclaredPropertiesAnytype3. /// an object with no declared properties and no undeclared properties, hence it's an empty map.. /// mapWithUndeclaredPropertiesString. - public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>), Object anytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype2 = default(Object), Dictionary mapWithUndeclaredPropertiesAnytype3 = default(Dictionary), Object emptyMap = default(Object), Dictionary mapWithUndeclaredPropertiesString = default(Dictionary)) + public AdditionalPropertiesClass(Dictionary? mapProperty = default, Dictionary>? mapOfMapProperty = default, Object? anytype1 = default, Object? mapWithUndeclaredPropertiesAnytype1 = default, Object? mapWithUndeclaredPropertiesAnytype2 = default, Dictionary? mapWithUndeclaredPropertiesAnytype3 = default, Object? emptyMap = default, Dictionary? mapWithUndeclaredPropertiesString = default) { this.MapProperty = mapProperty; this.MapOfMapProperty = mapOfMapProperty; @@ -60,50 +60,50 @@ public partial class AdditionalPropertiesClass : IEquatable [DataMember(Name = "map_property", EmitDefaultValue = false)] - public Dictionary MapProperty { get; set; } + public Dictionary? MapProperty { get; set; } /// /// Gets or Sets MapOfMapProperty /// [DataMember(Name = "map_of_map_property", EmitDefaultValue = false)] - public Dictionary> MapOfMapProperty { get; set; } + public Dictionary>? MapOfMapProperty { get; set; } /// /// Gets or Sets Anytype1 /// [DataMember(Name = "anytype_1", EmitDefaultValue = true)] - public Object Anytype1 { get; set; } + public Object? Anytype1 { get; set; } /// /// Gets or Sets MapWithUndeclaredPropertiesAnytype1 /// [DataMember(Name = "map_with_undeclared_properties_anytype_1", EmitDefaultValue = false)] - public Object MapWithUndeclaredPropertiesAnytype1 { get; set; } + public Object? MapWithUndeclaredPropertiesAnytype1 { get; set; } /// /// Gets or Sets MapWithUndeclaredPropertiesAnytype2 /// [DataMember(Name = "map_with_undeclared_properties_anytype_2", EmitDefaultValue = false)] - public Object MapWithUndeclaredPropertiesAnytype2 { get; set; } + public Object? MapWithUndeclaredPropertiesAnytype2 { get; set; } /// /// Gets or Sets MapWithUndeclaredPropertiesAnytype3 /// [DataMember(Name = "map_with_undeclared_properties_anytype_3", EmitDefaultValue = false)] - public Dictionary MapWithUndeclaredPropertiesAnytype3 { get; set; } + public Dictionary? MapWithUndeclaredPropertiesAnytype3 { get; set; } /// /// an object with no declared properties and no undeclared properties, hence it's an empty map. /// /// an object with no declared properties and no undeclared properties, hence it's an empty map. [DataMember(Name = "empty_map", EmitDefaultValue = false)] - public Object EmptyMap { get; set; } + public Object? EmptyMap { get; set; } /// /// Gets or Sets MapWithUndeclaredPropertiesString /// [DataMember(Name = "map_with_undeclared_properties_string", EmitDefaultValue = false)] - public Dictionary MapWithUndeclaredPropertiesString { get; set; } + public Dictionary? MapWithUndeclaredPropertiesString { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs index 834d0665bd81..fba745ea51d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs @@ -49,10 +49,15 @@ protected Animal() /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className, string? color = "red") { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } this.ClassName = className; - this.Color = color; + // use default value if no "color" provided + this.Color = color ?? "red"; this.AdditionalProperties = new Dictionary(); } @@ -66,7 +71,7 @@ protected Animal() /// Gets or Sets Color ///
    [DataMember(Name = "color", EmitDefaultValue = false)] - public string Color { get; set; } + public string? Color { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs index 79873f4ddfed..f4cdba705069 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -38,7 +38,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// code. /// type. /// message. - public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) + public ApiResponse(int? code = default, string? type = default, string? message = default) { this.Code = code; this.Type = type; @@ -50,19 +50,19 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// Gets or Sets Code /// [DataMember(Name = "code", EmitDefaultValue = false)] - public int Code { get; set; } + public int? Code { get; set; } /// /// Gets or Sets Type /// [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + public string? Type { get; set; } /// /// Gets or Sets Message /// [DataMember(Name = "message", EmitDefaultValue = false)] - public string Message { get; set; } + public string? Message { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs index 8b1f87d1aa9a..345517cc2592 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs @@ -37,7 +37,7 @@ public partial class Apple : IEquatable, IValidatableObject /// /// cultivar. /// origin. - public Apple(string cultivar = default(string), string origin = default(string)) + public Apple(string? cultivar = default, string? origin = default) { this.Cultivar = cultivar; this.Origin = origin; @@ -48,13 +48,13 @@ public partial class Apple : IEquatable, IValidatableObject /// Gets or Sets Cultivar ///
    [DataMember(Name = "cultivar", EmitDefaultValue = false)] - public string Cultivar { get; set; } + public string? Cultivar { get; set; } /// /// Gets or Sets Origin /// [DataMember(Name = "origin", EmitDefaultValue = false)] - public string Origin { get; set; } + public string? Origin { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs index 798d6d457dfe..7cfaecc03f14 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs @@ -42,8 +42,12 @@ protected AppleReq() { } /// /// cultivar (required). /// mealy. - public AppleReq(string cultivar = default(string), bool mealy = default(bool)) + public AppleReq(string cultivar, bool? mealy = default) { + // to ensure "cultivar" is required (not null) + if (cultivar == null) { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } this.Cultivar = cultivar; this.Mealy = mealy; } @@ -58,7 +62,7 @@ protected AppleReq() { } /// Gets or Sets Mealy ///
    [DataMember(Name = "mealy", EmitDefaultValue = true)] - public bool Mealy { get; set; } + public bool? Mealy { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 30bf57ef0f52..f2ed6250a5f4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -36,7 +36,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatable class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List>? arrayArrayNumber = default) { this.ArrayArrayNumber = arrayArrayNumber; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatable [DataMember(Name = "ArrayArrayNumber", EmitDefaultValue = false)] - public List> ArrayArrayNumber { get; set; } + public List>? ArrayArrayNumber { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8a215aad133b..0d9d0781d946 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -36,7 +36,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValidat /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List? arrayNumber = default) { this.ArrayNumber = arrayNumber; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValidat /// Gets or Sets ArrayNumber ///
    [DataMember(Name = "ArrayNumber", EmitDefaultValue = false)] - public List ArrayNumber { get; set; } + public List? ArrayNumber { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs index 1a879a1d9ca2..3831f2ecc87b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -38,7 +38,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List? arrayOfString = default, List>? arrayArrayOfInteger = default, List>? arrayArrayOfModel = default) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; @@ -50,19 +50,19 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// Gets or Sets ArrayOfString /// [DataMember(Name = "array_of_string", EmitDefaultValue = false)] - public List ArrayOfString { get; set; } + public List? ArrayOfString { get; set; } /// /// Gets or Sets ArrayArrayOfInteger /// [DataMember(Name = "array_array_of_integer", EmitDefaultValue = false)] - public List> ArrayArrayOfInteger { get; set; } + public List>? ArrayArrayOfInteger { get; set; } /// /// Gets or Sets ArrayArrayOfModel /// [DataMember(Name = "array_array_of_model", EmitDefaultValue = false)] - public List> ArrayArrayOfModel { get; set; } + public List>? ArrayArrayOfModel { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs index 97939597ede8..f1e62ce23956 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs @@ -36,7 +36,7 @@ public partial class Banana : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// lengthCm. - public Banana(decimal lengthCm = default(decimal)) + public Banana(decimal? lengthCm = default) { this.LengthCm = lengthCm; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class Banana : IEquatable, IValidatableObject /// Gets or Sets LengthCm ///
    [DataMember(Name = "lengthCm", EmitDefaultValue = false)] - public decimal LengthCm { get; set; } + public decimal? LengthCm { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs index fdd36929d13c..1c4f23aac56f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs @@ -42,7 +42,7 @@ protected BananaReq() { } /// /// lengthCm (required). /// sweet. - public BananaReq(decimal lengthCm = default(decimal), bool sweet = default(bool)) + public BananaReq(decimal lengthCm, bool? sweet = default) { this.LengthCm = lengthCm; this.Sweet = sweet; @@ -58,7 +58,7 @@ protected BananaReq() { } /// Gets or Sets Sweet ///
    [DataMember(Name = "sweet", EmitDefaultValue = true)] - public bool Sweet { get; set; } + public bool? Sweet { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs index 82062513ba1e..0706a3e8196b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs @@ -44,8 +44,12 @@ protected BasquePig() /// Initializes a new instance of the class. /// /// className (required). - public BasquePig(string className = default(string)) + public BasquePig(string className) { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs index be68a50a116a..2a49007bfbe5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs @@ -41,7 +41,7 @@ public partial class Capitalization : IEquatable, IValidatableOb /// capitalSnake. /// sCAETHFlowPoints. /// Name of the pet . - public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + public Capitalization(string? smallCamel = default, string? capitalCamel = default, string? smallSnake = default, string? capitalSnake = default, string? sCAETHFlowPoints = default, string? aTTNAME = default) { this.SmallCamel = smallCamel; this.CapitalCamel = capitalCamel; @@ -56,38 +56,38 @@ public partial class Capitalization : IEquatable, IValidatableOb /// Gets or Sets SmallCamel ///
    [DataMember(Name = "smallCamel", EmitDefaultValue = false)] - public string SmallCamel { get; set; } + public string? SmallCamel { get; set; } /// /// Gets or Sets CapitalCamel /// [DataMember(Name = "CapitalCamel", EmitDefaultValue = false)] - public string CapitalCamel { get; set; } + public string? CapitalCamel { get; set; } /// /// Gets or Sets SmallSnake /// [DataMember(Name = "small_Snake", EmitDefaultValue = false)] - public string SmallSnake { get; set; } + public string? SmallSnake { get; set; } /// /// Gets or Sets CapitalSnake /// [DataMember(Name = "Capital_Snake", EmitDefaultValue = false)] - public string CapitalSnake { get; set; } + public string? CapitalSnake { get; set; } /// /// Gets or Sets SCAETHFlowPoints /// [DataMember(Name = "SCA_ETH_Flow_Points", EmitDefaultValue = false)] - public string SCAETHFlowPoints { get; set; } + public string? SCAETHFlowPoints { get; set; } /// /// Name of the pet /// /// Name of the pet [DataMember(Name = "ATT_NAME", EmitDefaultValue = false)] - public string ATT_NAME { get; set; } + public string? ATT_NAME { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs index 2bc55707da95..53ebf92552ec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs @@ -45,10 +45,10 @@ protected Cat() /// /// Initializes a new instance of the class. /// - /// declawed. /// className (required) (default to "Cat"). + /// declawed. /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(string className = "Cat", bool? declawed = default, string? color = "red") : base(className, color) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); @@ -58,7 +58,7 @@ protected Cat() /// Gets or Sets Declawed /// [DataMember(Name = "declawed", EmitDefaultValue = true)] - public bool Declawed { get; set; } + public bool? Declawed { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs index 3a960e9925e3..1f47a8e5439f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -36,7 +36,7 @@ public partial class CatAllOf : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// declawed. - public CatAllOf(bool declawed = default(bool)) + public CatAllOf(bool? declawed = default) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class CatAllOf : IEquatable, IValidatableObject /// Gets or Sets Declawed ///
    [DataMember(Name = "declawed", EmitDefaultValue = true)] - public bool Declawed { get; set; } + public bool? Declawed { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs index 391fc2b11467..c9ed80eeb113 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs @@ -43,27 +43,31 @@ protected Category() /// /// Initializes a new instance of the class. /// - /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + /// id. + public Category(string name = "default-name", long? id = default) { + // to ensure "name" is required (not null) + if (name == null) { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } this.Name = name; this.Id = id; this.AdditionalProperties = new Dictionary(); } - /// - /// Gets or Sets Id - /// - [DataMember(Name = "id", EmitDefaultValue = false)] - public long Id { get; set; } - /// /// Gets or Sets Name /// [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] public string Name { get; set; } + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long? Id { get; set; } + /// /// Gets or Sets additional properties /// @@ -78,8 +82,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -123,11 +127,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCat.cs index 7a15a5297df2..1fe9959c94d5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCat.cs @@ -65,9 +65,9 @@ protected ChildCat() /// /// Initializes a new instance of the class. /// - /// name. /// petType (required) (default to PetTypeEnum.ChildCat). - public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base() + /// name. + public ChildCat(PetTypeEnum petType = PetTypeEnum.ChildCat, string? name = default) : base() { this.PetType = petType; this.Name = name; @@ -78,7 +78,7 @@ protected ChildCat() /// Gets or Sets Name /// [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + public string? Name { get; set; } /// /// Gets or Sets additional properties @@ -95,8 +95,8 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -140,11 +140,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index a353ad7ffd71..ad1636c77538 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -57,7 +57,7 @@ public enum PetTypeEnum /// /// name. /// petType (default to PetTypeEnum.ChildCat). - public ChildCatAllOf(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) + public ChildCatAllOf(string? name = default, PetTypeEnum? petType = PetTypeEnum.ChildCat) { this.Name = name; this.PetType = petType; @@ -68,7 +68,7 @@ public enum PetTypeEnum /// Gets or Sets Name /// [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + public string? Name { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs index 7177e9bf0b6c..8aa42b57ddbb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs @@ -36,7 +36,7 @@ public partial class ClassModel : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _class. - public ClassModel(string _class = default(string)) + public ClassModel(string? _class = default) { this.Class = _class; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class ClassModel : IEquatable, IValidatableObject /// Gets or Sets Class /// [DataMember(Name = "_class", EmitDefaultValue = false)] - public string Class { get; set; } + public string? Class { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 3d53cf265245..ab75994ddf5c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -45,9 +45,17 @@ protected ComplexQuadrilateral() /// /// shapeType (required). /// quadrilateralType (required). - public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + public ComplexQuadrilateral(string shapeType, string quadrilateralType) { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } this.ShapeType = shapeType; + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs index bf13c6794819..7314bf3a2140 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs @@ -44,8 +44,12 @@ protected DanishPig() /// Initializes a new instance of the class. /// /// className (required). - public DanishPig(string className = default(string)) + public DanishPig(string className) { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1928b236bf66..191d7f38d247 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -36,7 +36,7 @@ public partial class DeprecatedObject : IEquatable, IValidatab /// Initializes a new instance of the class. /// /// name. - public DeprecatedObject(string name = default(string)) + public DeprecatedObject(string? name = default) { this.Name = name; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class DeprecatedObject : IEquatable, IValidatab /// Gets or Sets Name /// [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + public string? Name { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs index 9cd520deaf82..3714017fe63e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs @@ -45,10 +45,10 @@ protected Dog() /// /// Initializes a new instance of the class. /// - /// breed. /// className (required) (default to "Dog"). + /// breed. /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string className = "Dog", string? breed = default, string? color = "red") : base(className, color) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); @@ -58,7 +58,7 @@ protected Dog() /// Gets or Sets Breed /// [DataMember(Name = "breed", EmitDefaultValue = false)] - public string Breed { get; set; } + public string? Breed { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs index 7b026acbf1e5..134ad1d40dba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -36,7 +36,7 @@ public partial class DogAllOf : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// breed. - public DogAllOf(string breed = default(string)) + public DogAllOf(string? breed = default) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class DogAllOf : IEquatable, IValidatableObject /// Gets or Sets Breed /// [DataMember(Name = "breed", EmitDefaultValue = false)] - public string Breed { get; set; } + public string? Breed { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs index d8cd2a70ef61..14558ee5aea5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs @@ -39,7 +39,7 @@ public partial class Drawing : Dictionary, IEquatable, I /// shapeOrNull. /// nullableShape. /// shapes. - public Drawing(Shape mainShape = default(Shape), ShapeOrNull shapeOrNull = default(ShapeOrNull), NullableShape nullableShape = default(NullableShape), List shapes = default(List)) : base() + public Drawing(Shape? mainShape = default, ShapeOrNull? shapeOrNull = default, NullableShape? nullableShape = default, List? shapes = default) : base() { this.MainShape = mainShape; this.ShapeOrNull = shapeOrNull; @@ -51,25 +51,25 @@ public partial class Drawing : Dictionary, IEquatable, I /// Gets or Sets MainShape /// [DataMember(Name = "mainShape", EmitDefaultValue = false)] - public Shape MainShape { get; set; } + public Shape? MainShape { get; set; } /// /// Gets or Sets ShapeOrNull /// [DataMember(Name = "shapeOrNull", EmitDefaultValue = false)] - public ShapeOrNull ShapeOrNull { get; set; } + public ShapeOrNull? ShapeOrNull { get; set; } /// /// Gets or Sets NullableShape /// [DataMember(Name = "nullableShape", EmitDefaultValue = true)] - public NullableShape NullableShape { get; set; } + public NullableShape? NullableShape { get; set; } /// /// Gets or Sets Shapes /// [DataMember(Name = "shapes", EmitDefaultValue = false)] - public List Shapes { get; set; } + public List? Shapes { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs index 6d7830c0e8ba..f651effcbab7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -84,13 +84,13 @@ public enum ArrayEnumEnum /// Gets or Sets ArrayEnum /// [DataMember(Name = "array_enum", EmitDefaultValue = false)] - public List ArrayEnum { get; set; } + public List? ArrayEnum { get; set; } /// /// Initializes a new instance of the class. /// /// justSymbol. /// arrayEnum. - public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + public EnumArrays(JustSymbolEnum? justSymbol = default, List? arrayEnum = default) { this.JustSymbol = justSymbol; this.ArrayEnum = arrayEnum; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs index 6f3d2272c5c3..bde4245a8022 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs @@ -33,10 +33,10 @@ namespace Org.OpenAPITools.Model public partial class EnumTest : IEquatable, IValidatableObject { /// - /// Defines EnumString + /// Defines EnumStringRequired /// [JsonConverter(typeof(StringEnumConverter))] - public enum EnumStringEnum + public enum EnumStringRequiredEnum { /// /// Enum UPPER for value: UPPER @@ -60,15 +60,15 @@ public enum EnumStringEnum /// - /// Gets or Sets EnumString + /// Gets or Sets EnumStringRequired /// - [DataMember(Name = "enum_string", EmitDefaultValue = false)] - public EnumStringEnum? EnumString { get; set; } + [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } /// - /// Defines EnumStringRequired + /// Defines EnumString /// [JsonConverter(typeof(StringEnumConverter))] - public enum EnumStringRequiredEnum + public enum EnumStringEnum { /// /// Enum UPPER for value: UPPER @@ -92,10 +92,10 @@ public enum EnumStringRequiredEnum /// - /// Gets or Sets EnumStringRequired + /// Gets or Sets EnumString /// - [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)] - public EnumStringRequiredEnum EnumStringRequired { get; set; } + [DataMember(Name = "enum_string", EmitDefaultValue = false)] + public EnumStringEnum? EnumString { get; set; } /// /// Defines EnumInteger /// @@ -203,8 +203,8 @@ protected EnumTest() /// /// Initializes a new instance of the class. /// - /// enumString. /// enumStringRequired (required). + /// enumString. /// enumInteger. /// enumIntegerOnly. /// enumNumber. @@ -212,7 +212,7 @@ protected EnumTest() /// outerEnumInteger. /// outerEnumDefaultValue. /// outerEnumIntegerDefaultValue. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumIntegerOnlyEnum? enumIntegerOnly = default(EnumIntegerOnlyEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?), OuterEnumInteger? outerEnumInteger = default(OuterEnumInteger?), OuterEnumDefaultValue? outerEnumDefaultValue = default(OuterEnumDefaultValue?), OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue?)) + public EnumTest(EnumStringRequiredEnum enumStringRequired, EnumStringEnum? enumString = default, EnumIntegerEnum? enumInteger = default, EnumIntegerOnlyEnum? enumIntegerOnly = default, EnumNumberEnum? enumNumber = default, OuterEnum? outerEnum = default, OuterEnumInteger? outerEnumInteger = default, OuterEnumDefaultValue? outerEnumDefaultValue = default, OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default) { this.EnumStringRequired = enumStringRequired; this.EnumString = enumString; @@ -240,8 +240,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class EnumTest {\n"); - sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); @@ -292,8 +292,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index b216e2f6a9ab..43e72bd635aa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -45,9 +45,17 @@ protected EquilateralTriangle() /// /// shapeType (required). /// triangleType (required). - public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) + public EquilateralTriangle(string shapeType, string triangleType) { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs index e77d15e06bce..b3c3263ba5b1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs @@ -36,7 +36,7 @@ public partial class File : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// Test capitalization. - public File(string sourceURI = default(string)) + public File(string? sourceURI = default) { this.SourceURI = sourceURI; this.AdditionalProperties = new Dictionary(); @@ -47,7 +47,7 @@ public partial class File : IEquatable, IValidatableObject /// /// Test capitalization [DataMember(Name = "sourceURI", EmitDefaultValue = false)] - public string SourceURI { get; set; } + public string? SourceURI { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 6808978c49f8..06920e9adf69 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -37,7 +37,7 @@ public partial class FileSchemaTestClass : IEquatable, IVal /// /// file. /// files. - public FileSchemaTestClass(File file = default(File), List files = default(List)) + public FileSchemaTestClass(File? file = default, List? files = default) { this.File = file; this.Files = files; @@ -48,13 +48,13 @@ public partial class FileSchemaTestClass : IEquatable, IVal /// Gets or Sets File /// [DataMember(Name = "file", EmitDefaultValue = false)] - public File File { get; set; } + public File? File { get; set; } /// /// Gets or Sets Files /// [DataMember(Name = "files", EmitDefaultValue = false)] - public List Files { get; set; } + public List? Files { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs index 2bb0754f044e..eefb6ba98611 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs @@ -36,9 +36,10 @@ public partial class Foo : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// bar (default to "bar"). - public Foo(string bar = "bar") + public Foo(string? bar = "bar") { - this.Bar = bar; + // use default value if no "bar" provided + this.Bar = bar ?? "bar"; this.AdditionalProperties = new Dictionary(); } @@ -46,7 +47,7 @@ public Foo(string bar = "bar") /// Gets or Sets Bar /// [DataMember(Name = "bar", EmitDefaultValue = false)] - public string Bar { get; set; } + public string? Bar { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs index 479292b07ac8..8bd1caec56ac 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs @@ -43,23 +43,23 @@ protected FormatTest() /// /// Initializes a new instance of the class. /// + /// number (required). + /// _byte (required). + /// date (required). + /// password (required). /// integer. /// int32. /// int64. - /// number (required). /// _float. /// _double. /// _decimal. /// _string. - /// _byte (required). /// binary. - /// date (required). /// dateTime. /// uuid. - /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(decimal number, byte[] _byte, DateTime date, string password, int? integer = default, int? int32 = default, long? int64 = default, float? _float = default, double? _double = default, decimal? _decimal = default, string? _string = default, System.IO.Stream? binary = default, DateTime? dateTime = default, Guid? uuid = default, string? patternWithDigits = default, string? patternWithDigitsAndDelimiter = default) { this.Number = number; // to ensure "_byte" is required (not null) @@ -68,6 +68,10 @@ protected FormatTest() } this.Byte = _byte; this.Date = date; + // to ensure "password" is required (not null) + if (password == null) { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } this.Password = password; this.Integer = integer; this.Int32 = int32; @@ -84,104 +88,104 @@ protected FormatTest() this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets Number + /// + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)] + public decimal Number { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Date + /// + [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime Date { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)] + public string Password { get; set; } + /// /// Gets or Sets Integer /// [DataMember(Name = "integer", EmitDefaultValue = false)] - public int Integer { get; set; } + public int? Integer { get; set; } /// /// Gets or Sets Int32 /// [DataMember(Name = "int32", EmitDefaultValue = false)] - public int Int32 { get; set; } + public int? Int32 { get; set; } /// /// Gets or Sets Int64 /// [DataMember(Name = "int64", EmitDefaultValue = false)] - public long Int64 { get; set; } - - /// - /// Gets or Sets Number - /// - [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)] - public decimal Number { get; set; } + public long? Int64 { get; set; } /// /// Gets or Sets Float /// [DataMember(Name = "float", EmitDefaultValue = false)] - public float Float { get; set; } + public float? Float { get; set; } /// /// Gets or Sets Double /// [DataMember(Name = "double", EmitDefaultValue = false)] - public double Double { get; set; } + public double? Double { get; set; } /// /// Gets or Sets Decimal /// [DataMember(Name = "decimal", EmitDefaultValue = false)] - public decimal Decimal { get; set; } + public decimal? Decimal { get; set; } /// /// Gets or Sets String /// [DataMember(Name = "string", EmitDefaultValue = false)] - public string String { get; set; } - - /// - /// Gets or Sets Byte - /// - [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)] - public byte[] Byte { get; set; } + public string? String { get; set; } /// /// Gets or Sets Binary /// [DataMember(Name = "binary", EmitDefaultValue = false)] - public System.IO.Stream Binary { get; set; } - - /// - /// Gets or Sets Date - /// - [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime Date { get; set; } + public System.IO.Stream? Binary { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name = "dateTime", EmitDefaultValue = false)] - public DateTime DateTime { get; set; } + public DateTime? DateTime { get; set; } /// /// Gets or Sets Uuid /// [DataMember(Name = "uuid", EmitDefaultValue = false)] - public Guid Uuid { get; set; } - - /// - /// Gets or Sets Password - /// - [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)] - public string Password { get; set; } + public Guid? Uuid { get; set; } /// /// A string that is a 10 digit number. Can have leading zeros. /// /// A string that is a 10 digit number. Can have leading zeros. [DataMember(Name = "pattern_with_digits", EmitDefaultValue = false)] - public string PatternWithDigits { get; set; } + public string? PatternWithDigits { get; set; } /// /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. [DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)] - public string PatternWithDigitsAndDelimiter { get; set; } + public string? PatternWithDigitsAndDelimiter { get; set; } /// /// Gets or Sets additional properties @@ -197,20 +201,20 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class FormatTest {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); - sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); - sb.Append(" Byte: ").Append(Byte).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); - sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -256,10 +260,22 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + if (this.Byte != null) + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } + if (this.Date != null) + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); - hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); @@ -267,18 +283,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.String.GetHashCode(); } - if (this.Byte != null) - { - hashCode = (hashCode * 59) + this.Byte.GetHashCode(); - } if (this.Binary != null) { hashCode = (hashCode * 59) + this.Binary.GetHashCode(); } - if (this.Date != null) - { - hashCode = (hashCode * 59) + this.Date.GetHashCode(); - } if (this.DateTime != null) { hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); @@ -287,10 +295,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); } - if (this.Password != null) - { - hashCode = (hashCode * 59) + this.Password.GetHashCode(); - } if (this.PatternWithDigits != null) { hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); @@ -314,6 +318,30 @@ public override int GetHashCode() /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + // Integer (int) maximum if (this.Integer > (int)100) { @@ -338,18 +366,6 @@ public override int GetHashCode() yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } - // Number (decimal) maximum - if (this.Number > (decimal)543.2) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); - } - - // Number (decimal) minimum - if (this.Number < (decimal)32.1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); - } - // Float (float) maximum if (this.Float > (float)987.6) { @@ -381,18 +397,6 @@ public override int GetHashCode() yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } - // Password (string) maxLength - if (this.Password != null && this.Password.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); - } - - // Password (string) minLength - if (this.Password != null && this.Password.Length < 10) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); - } - // PatternWithDigits (string) pattern Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 68b77ec78494..24b3df864e19 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -48,8 +48,12 @@ protected GrandparentAnimal() /// Initializes a new instance of the class. /// /// petType (required). - public GrandparentAnimal(string petType = default(string)) + public GrandparentAnimal(string petType) { + // to ensure "petType" is required (not null) + if (petType == null) { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } this.PetType = petType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 52099a7095e1..76c03db21736 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -45,7 +45,7 @@ public HasOnlyReadOnly() /// Gets or Sets Bar /// [DataMember(Name = "bar", EmitDefaultValue = false)] - public string Bar { get; private set; } + public string? Bar { get; private set; } /// /// Returns false as Bar should not be serialized given that it's read-only. @@ -59,7 +59,7 @@ public bool ShouldSerializeBar() /// Gets or Sets Foo /// [DataMember(Name = "foo", EmitDefaultValue = false)] - public string Foo { get; private set; } + public string? Foo { get; private set; } /// /// Returns false as Foo should not be serialized given that it's read-only. diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs index f31580de3c2f..53fa8992f612 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -36,7 +36,7 @@ public partial class HealthCheckResult : IEquatable, IValidat /// Initializes a new instance of the class. /// /// nullableMessage. - public HealthCheckResult(string? nullableMessage = default(string?)) + public HealthCheckResult(string? nullableMessage = default) { this.NullableMessage = nullableMessage; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index ae46f1f0098f..09d4dde78f74 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -36,7 +36,7 @@ public partial class InlineResponseDefault : IEquatable, /// Initializes a new instance of the class. /// /// _string. - public InlineResponseDefault(Foo _string = default(Foo)) + public InlineResponseDefault(Foo? _string = default) { this.String = _string; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class InlineResponseDefault : IEquatable, /// Gets or Sets String /// [DataMember(Name = "string", EmitDefaultValue = false)] - public Foo String { get; set; } + public Foo? String { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3ad7989abef6..d5ff97d769cc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -42,9 +42,17 @@ protected IsoscelesTriangle() { } /// /// shapeType (required). /// triangleType (required). - public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) + public IsoscelesTriangle(string shapeType, string triangleType) { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } this.TriangleType = triangleType; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs index 00814d110694..c6b2042d9819 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs @@ -36,7 +36,7 @@ public partial class List : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _123list. - public List(string _123list = default(string)) + public List(string? _123list = default) { this._123List = _123list; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class List : IEquatable, IValidatableObject /// Gets or Sets _123List /// [DataMember(Name = "123-list", EmitDefaultValue = false)] - public string _123List { get; set; } + public string? _123List { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs index 8b5a73e77365..4b18ed169afb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs @@ -58,7 +58,7 @@ public enum InnerEnum /// Gets or Sets MapOfEnumString /// [DataMember(Name = "map_of_enum_string", EmitDefaultValue = false)] - public Dictionary MapOfEnumString { get; set; } + public Dictionary? MapOfEnumString { get; set; } /// /// Initializes a new instance of the class. /// @@ -66,7 +66,7 @@ public enum InnerEnum /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + public MapTest(Dictionary>? mapMapOfString = default, Dictionary? mapOfEnumString = default, Dictionary? directMap = default, Dictionary? indirectMap = default) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; @@ -79,19 +79,19 @@ public enum InnerEnum /// Gets or Sets MapMapOfString /// [DataMember(Name = "map_map_of_string", EmitDefaultValue = false)] - public Dictionary> MapMapOfString { get; set; } + public Dictionary>? MapMapOfString { get; set; } /// /// Gets or Sets DirectMap /// [DataMember(Name = "direct_map", EmitDefaultValue = false)] - public Dictionary DirectMap { get; set; } + public Dictionary? DirectMap { get; set; } /// /// Gets or Sets IndirectMap /// [DataMember(Name = "indirect_map", EmitDefaultValue = false)] - public Dictionary IndirectMap { get; set; } + public Dictionary? IndirectMap { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3225727af37b..c99949454686 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -38,7 +38,7 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatableuuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default, DateTime? dateTime = default, Dictionary? map = default) { this.Uuid = uuid; this.DateTime = dateTime; @@ -50,19 +50,19 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable [DataMember(Name = "uuid", EmitDefaultValue = false)] - public Guid Uuid { get; set; } + public Guid? Uuid { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name = "dateTime", EmitDefaultValue = false)] - public DateTime DateTime { get; set; } + public DateTime? DateTime { get; set; } /// /// Gets or Sets Map /// [DataMember(Name = "map", EmitDefaultValue = false)] - public Dictionary Map { get; set; } + public Dictionary? Map { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs index 79a49ef91d28..c08ba66f533f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs @@ -37,7 +37,7 @@ public partial class Model200Response : IEquatable, IValidatab /// /// name. /// _class. - public Model200Response(int name = default(int), string _class = default(string)) + public Model200Response(int? name = default, string? _class = default) { this.Name = name; this.Class = _class; @@ -48,13 +48,13 @@ public partial class Model200Response : IEquatable, IValidatab /// Gets or Sets Name /// [DataMember(Name = "name", EmitDefaultValue = false)] - public int Name { get; set; } + public int? Name { get; set; } /// /// Gets or Sets Class /// [DataMember(Name = "class", EmitDefaultValue = false)] - public string Class { get; set; } + public string? Class { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs index 1995ec4b1692..20b409cf263d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs @@ -36,7 +36,7 @@ public partial class ModelClient : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _client. - public ModelClient(string _client = default(string)) + public ModelClient(string? _client = default) { this._Client = _client; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class ModelClient : IEquatable, IValidatableObject /// Gets or Sets _Client /// [DataMember(Name = "client", EmitDefaultValue = false)] - public string _Client { get; set; } + public string? _Client { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs index 0dc21bb656f0..d0705677db3f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs @@ -45,7 +45,7 @@ protected Name() /// /// name (required). /// property. - public Name(int name = default(int), string property = default(string)) + public Name(int name, string? property = default) { this._Name = name; this.Property = property; @@ -62,7 +62,7 @@ protected Name() /// Gets or Sets SnakeCase /// [DataMember(Name = "snake_case", EmitDefaultValue = false)] - public int SnakeCase { get; private set; } + public int? SnakeCase { get; private set; } /// /// Returns false as SnakeCase should not be serialized given that it's read-only. @@ -76,13 +76,13 @@ public bool ShouldSerializeSnakeCase() /// Gets or Sets Property /// [DataMember(Name = "property", EmitDefaultValue = false)] - public string Property { get; set; } + public string? Property { get; set; } /// /// Gets or Sets _123Number /// [DataMember(Name = "123Number", EmitDefaultValue = false)] - public int _123Number { get; private set; } + public int? _123Number { get; private set; } /// /// Returns false as _123Number should not be serialized given that it's read-only. diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs index 0c1f1d4b15ca..c45e895dfc66 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs @@ -47,7 +47,7 @@ public partial class NullableClass : Dictionary, IEquatableobjectNullableProp. /// objectAndItemsNullableProp. /// objectItemsNullable. - public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string? stringProp = default(string?), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + public NullableClass(int? integerProp = default, decimal? numberProp = default, bool? booleanProp = default, string? stringProp = default, DateTime? dateProp = default, DateTime? datetimeProp = default, List? arrayNullableProp = default, List? arrayAndItemsNullableProp = default, List? arrayItemsNullable = default, Dictionary? objectNullableProp = default, Dictionary? objectAndItemsNullableProp = default, Dictionary? objectItemsNullable = default) : base() { this.IntegerProp = integerProp; this.NumberProp = numberProp; @@ -104,37 +104,37 @@ public partial class NullableClass : Dictionary, IEquatable [DataMember(Name = "array_nullable_prop", EmitDefaultValue = true)] - public List ArrayNullableProp { get; set; } + public List? ArrayNullableProp { get; set; } /// /// Gets or Sets ArrayAndItemsNullableProp /// [DataMember(Name = "array_and_items_nullable_prop", EmitDefaultValue = true)] - public List ArrayAndItemsNullableProp { get; set; } + public List? ArrayAndItemsNullableProp { get; set; } /// /// Gets or Sets ArrayItemsNullable /// [DataMember(Name = "array_items_nullable", EmitDefaultValue = false)] - public List ArrayItemsNullable { get; set; } + public List? ArrayItemsNullable { get; set; } /// /// Gets or Sets ObjectNullableProp /// [DataMember(Name = "object_nullable_prop", EmitDefaultValue = true)] - public Dictionary ObjectNullableProp { get; set; } + public Dictionary? ObjectNullableProp { get; set; } /// /// Gets or Sets ObjectAndItemsNullableProp /// [DataMember(Name = "object_and_items_nullable_prop", EmitDefaultValue = true)] - public Dictionary ObjectAndItemsNullableProp { get; set; } + public Dictionary? ObjectAndItemsNullableProp { get; set; } /// /// Gets or Sets ObjectItemsNullable /// [DataMember(Name = "object_items_nullable", EmitDefaultValue = false)] - public Dictionary ObjectItemsNullable { get; set; } + public Dictionary? ObjectItemsNullable { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs index 97f869b0ebc1..06bd026938fe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -36,7 +36,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal justNumber = default(decimal)) + public NumberOnly(decimal? justNumber = default) { this.JustNumber = justNumber; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// Gets or Sets JustNumber /// [DataMember(Name = "JustNumber", EmitDefaultValue = false)] - public decimal JustNumber { get; set; } + public decimal? JustNumber { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 86ea32998f8c..ff6275890045 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -39,7 +39,7 @@ public partial class ObjectWithDeprecatedFields : IEquatableid. /// deprecatedRef. /// bars. - public ObjectWithDeprecatedFields(string uuid = default(string), decimal id = default(decimal), DeprecatedObject deprecatedRef = default(DeprecatedObject), List bars = default(List)) + public ObjectWithDeprecatedFields(string? uuid = default, decimal? id = default, DeprecatedObject? deprecatedRef = default, List? bars = default) { this.Uuid = uuid; this.Id = id; @@ -52,28 +52,28 @@ public partial class ObjectWithDeprecatedFields : IEquatable [DataMember(Name = "uuid", EmitDefaultValue = false)] - public string Uuid { get; set; } + public string? Uuid { get; set; } /// /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = false)] [Obsolete] - public decimal Id { get; set; } + public decimal? Id { get; set; } /// /// Gets or Sets DeprecatedRef /// [DataMember(Name = "deprecatedRef", EmitDefaultValue = false)] [Obsolete] - public DeprecatedObject DeprecatedRef { get; set; } + public DeprecatedObject? DeprecatedRef { get; set; } /// /// Gets or Sets Bars /// [DataMember(Name = "bars", EmitDefaultValue = false)] [Obsolete] - public List Bars { get; set; } + public List? Bars { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs index 5c52482e79b9..cdc227e0564f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs @@ -75,7 +75,7 @@ public enum StatusEnum /// shipDate. /// Order Status. /// complete (default to false). - public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) + public Order(long? id = default, long? petId = default, int? quantity = default, DateTime? shipDate = default, StatusEnum? status = default, bool? complete = false) { this.Id = id; this.PetId = petId; @@ -90,31 +90,31 @@ public enum StatusEnum /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = false)] - public long Id { get; set; } + public long? Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name = "petId", EmitDefaultValue = false)] - public long PetId { get; set; } + public long? PetId { get; set; } /// /// Gets or Sets Quantity /// [DataMember(Name = "quantity", EmitDefaultValue = false)] - public int Quantity { get; set; } + public int? Quantity { get; set; } /// /// Gets or Sets ShipDate /// [DataMember(Name = "shipDate", EmitDefaultValue = false)] - public DateTime ShipDate { get; set; } + public DateTime? ShipDate { get; set; } /// /// Gets or Sets Complete /// [DataMember(Name = "complete", EmitDefaultValue = true)] - public bool Complete { get; set; } + public bool? Complete { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs index 3209f6d6244e..0acf83c4c628 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -38,7 +38,7 @@ public partial class OuterComposite : IEquatable, IValidatableOb /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) + public OuterComposite(decimal? myNumber = default, string? myString = default, bool? myBoolean = default) { this.MyNumber = myNumber; this.MyString = myString; @@ -50,19 +50,19 @@ public partial class OuterComposite : IEquatable, IValidatableOb /// Gets or Sets MyNumber /// [DataMember(Name = "my_number", EmitDefaultValue = false)] - public decimal MyNumber { get; set; } + public decimal? MyNumber { get; set; } /// /// Gets or Sets MyString /// [DataMember(Name = "my_string", EmitDefaultValue = false)] - public string MyString { get; set; } + public string? MyString { get; set; } /// /// Gets or Sets MyBoolean /// [DataMember(Name = "my_boolean", EmitDefaultValue = true)] - public bool MyBoolean { get; set; } + public bool? MyBoolean { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs index 24e8a3698916..f94869df280c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs @@ -77,14 +77,18 @@ protected Pet() /// /// Initializes a new instance of the class. /// - /// id. - /// category. /// name (required). /// photoUrls (required). + /// id. + /// category. /// tags. /// pet status in the store. - public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(string name, List photoUrls, long? id = default, Category? category = default, List? tags = default, StatusEnum? status = default) { + // to ensure "name" is required (not null) + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } this.Name = name; // to ensure "photoUrls" is required (not null) if (photoUrls == null) { @@ -98,18 +102,6 @@ protected Pet() this.AdditionalProperties = new Dictionary(); } - /// - /// Gets or Sets Id - /// - [DataMember(Name = "id", EmitDefaultValue = false)] - public long Id { get; set; } - - /// - /// Gets or Sets Category - /// - [DataMember(Name = "category", EmitDefaultValue = false)] - public Category Category { get; set; } - /// /// Gets or Sets Name /// @@ -122,11 +114,23 @@ protected Pet() [DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = false)] public List PhotoUrls { get; set; } + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public Category? Category { get; set; } + /// /// Gets or Sets Tags /// [DataMember(Name = "tags", EmitDefaultValue = false)] - public List Tags { get; set; } + public List? Tags { get; set; } /// /// Gets or Sets additional properties @@ -142,10 +146,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); sb.Append(" Tags: ").Append(Tags).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -191,11 +195,6 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.Category != null) - { - hashCode = (hashCode * 59) + this.Category.GetHashCode(); - } if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); @@ -204,6 +203,11 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Category != null) + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Tags != null) { hashCode = (hashCode * 59) + this.Tags.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 613aec4d121b..b29e2db36b6b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -44,8 +44,12 @@ protected QuadrilateralInterface() /// Initializes a new instance of the class. /// /// quadrilateralType (required). - public QuadrilateralInterface(string quadrilateralType = default(string)) + public QuadrilateralInterface(string quadrilateralType) { + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index ad59ca832864..c668741b9609 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -36,7 +36,7 @@ public partial class ReadOnlyFirst : IEquatable, IValidatableObje /// Initializes a new instance of the class. /// /// baz. - public ReadOnlyFirst(string baz = default(string)) + public ReadOnlyFirst(string? baz = default) { this.Baz = baz; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class ReadOnlyFirst : IEquatable, IValidatableObje /// Gets or Sets Bar /// [DataMember(Name = "bar", EmitDefaultValue = false)] - public string Bar { get; private set; } + public string? Bar { get; private set; } /// /// Returns false as Bar should not be serialized given that it's read-only. @@ -60,7 +60,7 @@ public bool ShouldSerializeBar() /// Gets or Sets Baz /// [DataMember(Name = "baz", EmitDefaultValue = false)] - public string Baz { get; set; } + public string? Baz { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs index e702e0157030..4b6b8710a1d4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs @@ -36,7 +36,7 @@ public partial class Return : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _return. - public Return(int _return = default(int)) + public Return(int? _return = default) { this._Return = _return; this.AdditionalProperties = new Dictionary(); @@ -46,7 +46,7 @@ public partial class Return : IEquatable, IValidatableObject /// Gets or Sets _Return /// [DataMember(Name = "return", EmitDefaultValue = false)] - public int _Return { get; set; } + public int? _Return { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 4b58e23f4fc0..206e0fbe3315 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -45,9 +45,17 @@ protected ScaleneTriangle() /// /// shapeType (required). /// triangleType (required). - public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) + public ScaleneTriangle(string shapeType, string triangleType) { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs index b2d5e37cfa51..55788e33f354 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -44,8 +44,12 @@ protected ShapeInterface() /// Initializes a new instance of the class. /// /// shapeType (required). - public ShapeInterface(string shapeType = default(string)) + public ShapeInterface(string shapeType) { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } this.ShapeType = shapeType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 17676b976178..1398011e13f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -45,9 +45,17 @@ protected SimpleQuadrilateral() /// /// shapeType (required). /// quadrilateralType (required). - public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + public SimpleQuadrilateral(string shapeType, string quadrilateralType) { + // to ensure "shapeType" is required (not null) + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } this.ShapeType = shapeType; + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7800467822ea..64d0866fbf05 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -37,7 +37,7 @@ public partial class SpecialModelName : IEquatable, IValidatab /// /// specialPropertyName. /// specialModelName. - public SpecialModelName(long specialPropertyName = default(long), string specialModelName = default(string)) + public SpecialModelName(long? specialPropertyName = default, string? specialModelName = default) { this.SpecialPropertyName = specialPropertyName; this._SpecialModelName = specialModelName; @@ -48,13 +48,13 @@ public partial class SpecialModelName : IEquatable, IValidatab /// Gets or Sets SpecialPropertyName /// [DataMember(Name = "$special[property.name]", EmitDefaultValue = false)] - public long SpecialPropertyName { get; set; } + public long? SpecialPropertyName { get; set; } /// /// Gets or Sets _SpecialModelName /// [DataMember(Name = "_special_model.name_", EmitDefaultValue = false)] - public string _SpecialModelName { get; set; } + public string? _SpecialModelName { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs index 3df2c02e2cef..09b8204eb380 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs @@ -37,7 +37,7 @@ public partial class Tag : IEquatable, IValidatableObject /// /// id. /// name. - public Tag(long id = default(long), string name = default(string)) + public Tag(long? id = default, string? name = default) { this.Id = id; this.Name = name; @@ -48,13 +48,13 @@ public partial class Tag : IEquatable, IValidatableObject /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = false)] - public long Id { get; set; } + public long? Id { get; set; } /// /// Gets or Sets Name /// [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + public string? Name { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs index bb58c9940506..8c62abd8c657 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -44,8 +44,12 @@ protected TriangleInterface() /// Initializes a new instance of the class. /// /// triangleType (required). - public TriangleInterface(string triangleType = default(string)) + public TriangleInterface(string triangleType) { + // to ensure "triangleType" is required (not null) + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs index 5f2a3020c3dd..cc4448626432 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs @@ -47,7 +47,7 @@ public partial class User : IEquatable, IValidatableObject /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. - public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int), Object objectWithNoDeclaredProps = default(Object), Object objectWithNoDeclaredPropsNullable = default(Object), Object anyTypeProp = default(Object), Object anyTypePropNullable = default(Object)) + public User(long? id = default, string? username = default, string? firstName = default, string? lastName = default, string? email = default, string? password = default, string? phone = default, int? userStatus = default, Object? objectWithNoDeclaredProps = default, Object? objectWithNoDeclaredPropsNullable = default, Object? anyTypeProp = default, Object? anyTypePropNullable = default) { this.Id = id; this.Username = username; @@ -68,78 +68,78 @@ public partial class User : IEquatable, IValidatableObject /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = false)] - public long Id { get; set; } + public long? Id { get; set; } /// /// Gets or Sets Username /// [DataMember(Name = "username", EmitDefaultValue = false)] - public string Username { get; set; } + public string? Username { get; set; } /// /// Gets or Sets FirstName /// [DataMember(Name = "firstName", EmitDefaultValue = false)] - public string FirstName { get; set; } + public string? FirstName { get; set; } /// /// Gets or Sets LastName /// [DataMember(Name = "lastName", EmitDefaultValue = false)] - public string LastName { get; set; } + public string? LastName { get; set; } /// /// Gets or Sets Email /// [DataMember(Name = "email", EmitDefaultValue = false)] - public string Email { get; set; } + public string? Email { get; set; } /// /// Gets or Sets Password /// [DataMember(Name = "password", EmitDefaultValue = false)] - public string Password { get; set; } + public string? Password { get; set; } /// /// Gets or Sets Phone /// [DataMember(Name = "phone", EmitDefaultValue = false)] - public string Phone { get; set; } + public string? Phone { get; set; } /// /// User Status /// /// User Status [DataMember(Name = "userStatus", EmitDefaultValue = false)] - public int UserStatus { get; set; } + public int? UserStatus { get; set; } /// /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. /// /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. [DataMember(Name = "objectWithNoDeclaredProps", EmitDefaultValue = false)] - public Object ObjectWithNoDeclaredProps { get; set; } + public Object? ObjectWithNoDeclaredProps { get; set; } /// /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. /// /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. [DataMember(Name = "objectWithNoDeclaredPropsNullable", EmitDefaultValue = true)] - public Object ObjectWithNoDeclaredPropsNullable { get; set; } + public Object? ObjectWithNoDeclaredPropsNullable { get; set; } /// /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 /// /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 [DataMember(Name = "anyTypeProp", EmitDefaultValue = true)] - public Object AnyTypeProp { get; set; } + public Object? AnyTypeProp { get; set; } /// /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. /// /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. [DataMember(Name = "anyTypePropNullable", EmitDefaultValue = true)] - public Object AnyTypePropNullable { get; set; } + public Object? AnyTypePropNullable { get; set; } /// /// Gets or Sets additional properties diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs index dbe00ae03e58..e13e3f2d012e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs @@ -43,34 +43,38 @@ protected Whale() /// /// Initializes a new instance of the class. /// + /// className (required). /// hasBaleen. /// hasTeeth. - /// className (required). - public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) + public Whale(string className, bool? hasBaleen = default, bool? hasTeeth = default) { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } this.ClassName = className; this.HasBaleen = hasBaleen; this.HasTeeth = hasTeeth; this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + /// /// Gets or Sets HasBaleen /// [DataMember(Name = "hasBaleen", EmitDefaultValue = true)] - public bool HasBaleen { get; set; } + public bool? HasBaleen { get; set; } /// /// Gets or Sets HasTeeth /// [DataMember(Name = "hasTeeth", EmitDefaultValue = true)] - public bool HasTeeth { get; set; } - - /// - /// Gets or Sets ClassName - /// - [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] - public string ClassName { get; set; } + public bool? HasTeeth { get; set; } /// /// Gets or Sets additional properties @@ -86,9 +90,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Whale {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -132,12 +136,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); - hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.ClassName != null) { hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); } + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs index 0811c5faac00..0d4c8c671305 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs @@ -75,10 +75,14 @@ protected Zebra() /// /// Initializes a new instance of the class. /// - /// type. /// className (required). - public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() + /// type. + public Zebra(string className, TypeEnum? type = default) : base() { + // to ensure "className" is required (not null) + if (className == null) { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } this.ClassName = className; this.Type = type; this.AdditionalProperties = new Dictionary(); @@ -105,8 +109,8 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class Zebra {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -150,11 +154,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ClassName != null) { hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 4f5b8ae971aa..ef39b0552f3e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,7 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update - annotations + enable diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Category.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Category.md index 6eb0a2e13eaa..c2cf3f8e919e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Category.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Category.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long** | | [optional] **Name** | **string** | | [default to "default-name"] +**Id** | **long** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCat.md index 88fe8f7a7fdd..48a3c7fd38d9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCat.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ChildCat.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] **PetType** | **string** | | [default to PetTypeEnum.ChildCat] +**Name** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumTest.md index d2b72b5368fb..71602270bab4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/EnumTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | +**EnumString** | **string** | | [optional] **EnumInteger** | **int** | | [optional] **EnumIntegerOnly** | **int** | | [optional] **EnumNumber** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md index b0d2f47b2eb6..0b92c2fb10a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md @@ -4,20 +4,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Number** | **decimal** | | +**Byte** | **byte[]** | | +**Date** | **DateTime** | | +**Password** | **string** | | **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] **Int64** | **long** | | [optional] -**Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] **Decimal** | **decimal** | | [optional] **String** | **string** | | [optional] -**Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime** | | **DateTime** | **DateTime** | | [optional] **Uuid** | **Guid** | | [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] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FruitReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FruitReq.md index 5afd947f4a63..5217febc9b68 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FruitReq.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FruitReq.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Cultivar** | **string** | | -**Mealy** | **bool** | | [optional] **LengthCm** | **decimal** | | +**Mealy** | **bool** | | [optional] **Sweet** | **bool** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Mammal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Mammal.md index 79d95fce63a3..82a8ca6027b5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Mammal.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Mammal.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | **HasBaleen** | **bool** | | [optional] **HasTeeth** | **bool** | | [optional] -**ClassName** | **string** | | **Type** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pet.md index 6a9d41feb0d6..7de10304abf4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pet.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Pet.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long** | | [optional] -**Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | +**Id** | **long** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] **Tags** | [**List<Tag>**](Tag.md) | | [optional] **Status** | **string** | pet status in the store | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Whale.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Whale.md index afbc08409d22..1c633fdce61b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Whale.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Whale.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | **HasBaleen** | **bool** | | [optional] **HasTeeth** | **bool** | | [optional] -**ClassName** | **string** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Zebra.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Zebra.md index 4c5a820bac04..aef3866b92c9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Zebra.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Zebra.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | [optional] **ClassName** | **string** | | +**Type** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b3ddad35a07d..14d0e92eaa29 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -43,7 +43,7 @@ public partial class AdditionalPropertiesClass : IEquatablemapWithUndeclaredPropertiesAnytype3. /// an object with no declared properties and no undeclared properties, hence it's an empty map.. /// mapWithUndeclaredPropertiesString. - public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>), Object anytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype2 = default(Object), Dictionary mapWithUndeclaredPropertiesAnytype3 = default(Dictionary), Object emptyMap = default(Object), Dictionary mapWithUndeclaredPropertiesString = default(Dictionary)) + public AdditionalPropertiesClass(Dictionary mapProperty = default, Dictionary> mapOfMapProperty = default, Object anytype1 = default, Object mapWithUndeclaredPropertiesAnytype1 = default, Object mapWithUndeclaredPropertiesAnytype2 = default, Dictionary mapWithUndeclaredPropertiesAnytype3 = default, Object emptyMap = default, Dictionary mapWithUndeclaredPropertiesString = default) { this.MapProperty = mapProperty; this.MapOfMapProperty = mapOfMapProperty; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs index e8ea00bb46a8..73eef4704068 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs @@ -49,7 +49,7 @@ protected Animal() /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className, string color = "red") { // to ensure "className" is required (not null) if (className == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs index 79873f4ddfed..e5fee65b6bc2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -38,7 +38,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// code. /// type. /// message. - public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) + public ApiResponse(int code = default, string type = default, string message = default) { this.Code = code; this.Type = type; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs index 8b1f87d1aa9a..adf8438c5912 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs @@ -37,7 +37,7 @@ public partial class Apple : IEquatable, IValidatableObject /// /// cultivar. /// origin. - public Apple(string cultivar = default(string), string origin = default(string)) + public Apple(string cultivar = default, string origin = default) { this.Cultivar = cultivar; this.Origin = origin; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs index 1d6d42dc9b3a..28ce313d0b60 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -42,7 +42,7 @@ protected AppleReq() { } /// /// cultivar (required). /// mealy. - public AppleReq(string cultivar = default(string), bool mealy = default(bool)) + public AppleReq(string cultivar, bool mealy = default) { // to ensure "cultivar" is required (not null) if (cultivar == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 30bf57ef0f52..a342794fafaa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -36,7 +36,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatable class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default) { this.ArrayArrayNumber = arrayArrayNumber; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8a215aad133b..349fc7ef5a1d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -36,7 +36,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValidat /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List arrayNumber = default) { this.ArrayNumber = arrayNumber; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs index 1a879a1d9ca2..b7f6f3cd1779 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -38,7 +38,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List arrayOfString = default, List> arrayArrayOfInteger = default, List> arrayArrayOfModel = default) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs index 97939597ede8..bb1962fc2b2f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs @@ -36,7 +36,7 @@ public partial class Banana : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// lengthCm. - public Banana(decimal lengthCm = default(decimal)) + public Banana(decimal lengthCm = default) { this.LengthCm = lengthCm; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs index fdd36929d13c..812c91b012fe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -42,7 +42,7 @@ protected BananaReq() { } /// /// lengthCm (required). /// sweet. - public BananaReq(decimal lengthCm = default(decimal), bool sweet = default(bool)) + public BananaReq(decimal lengthCm, bool sweet = default) { this.LengthCm = lengthCm; this.Sweet = sweet; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs index ea4ff737c89a..0706a3e8196b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -44,7 +44,7 @@ protected BasquePig() /// Initializes a new instance of the class. /// /// className (required). - public BasquePig(string className = default(string)) + public BasquePig(string className) { // to ensure "className" is required (not null) if (className == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs index be68a50a116a..377781227e62 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -41,7 +41,7 @@ public partial class Capitalization : IEquatable, IValidatableOb /// capitalSnake. /// sCAETHFlowPoints. /// Name of the pet . - public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + public Capitalization(string smallCamel = default, string capitalCamel = default, string smallSnake = default, string capitalSnake = default, string sCAETHFlowPoints = default, string aTTNAME = default) { this.SmallCamel = smallCamel; this.CapitalCamel = capitalCamel; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs index 2bc55707da95..d7c0634c555a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs @@ -45,10 +45,10 @@ protected Cat() /// /// Initializes a new instance of the class. /// - /// declawed. /// className (required) (default to "Cat"). + /// declawed. /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(string className = "Cat", bool declawed = default, string color = "red") : base(className, color) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs index 3a960e9925e3..5aa226e03f6e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -36,7 +36,7 @@ public partial class CatAllOf : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// declawed. - public CatAllOf(bool declawed = default(bool)) + public CatAllOf(bool declawed = default) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs index 0cc23f5f6c23..8cd4fe7e9ac9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs @@ -43,9 +43,9 @@ protected Category() /// /// Initializes a new instance of the class. /// - /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + /// id. + public Category(string name = "default-name", long id = default) { // to ensure "name" is required (not null) if (name == null) { @@ -56,18 +56,18 @@ protected Category() this.AdditionalProperties = new Dictionary(); } - /// - /// Gets or Sets Id - /// - [DataMember(Name = "id", EmitDefaultValue = false)] - public long Id { get; set; } - /// /// Gets or Sets Name /// [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] public string Name { get; set; } + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + /// /// Gets or Sets additional properties /// @@ -82,8 +82,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -127,11 +127,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCat.cs index 7a15a5297df2..991717f25912 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCat.cs @@ -65,9 +65,9 @@ protected ChildCat() /// /// Initializes a new instance of the class. /// - /// name. /// petType (required) (default to PetTypeEnum.ChildCat). - public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base() + /// name. + public ChildCat(PetTypeEnum petType = PetTypeEnum.ChildCat, string name = default) : base() { this.PetType = petType; this.Name = name; @@ -95,8 +95,8 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -140,11 +140,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index a353ad7ffd71..483062ead25b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -51,13 +51,13 @@ public enum PetTypeEnum /// Gets or Sets PetType /// [DataMember(Name = "pet_type", EmitDefaultValue = false)] - public PetTypeEnum? PetType { get; set; } + public PetTypeEnum PetType { get; set; } /// /// Initializes a new instance of the class. /// /// name. /// petType (default to PetTypeEnum.ChildCat). - public ChildCatAllOf(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) + public ChildCatAllOf(string name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) { this.Name = name; this.PetType = petType; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs index 7177e9bf0b6c..fa446f3a33ff 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -36,7 +36,7 @@ public partial class ClassModel : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _class. - public ClassModel(string _class = default(string)) + public ClassModel(string _class = default) { this.Class = _class; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 807f0eb26bf8..ab75994ddf5c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -45,7 +45,7 @@ protected ComplexQuadrilateral() /// /// shapeType (required). /// quadrilateralType (required). - public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + public ComplexQuadrilateral(string shapeType, string quadrilateralType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs index a27b1db39297..7314bf3a2140 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -44,7 +44,7 @@ protected DanishPig() /// Initializes a new instance of the class. /// /// className (required). - public DanishPig(string className = default(string)) + public DanishPig(string className) { // to ensure "className" is required (not null) if (className == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1928b236bf66..a900bc224e49 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -36,7 +36,7 @@ public partial class DeprecatedObject : IEquatable, IValidatab /// Initializes a new instance of the class. /// /// name. - public DeprecatedObject(string name = default(string)) + public DeprecatedObject(string name = default) { this.Name = name; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs index 9cd520deaf82..d34b90a530d3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs @@ -45,10 +45,10 @@ protected Dog() /// /// Initializes a new instance of the class. /// - /// breed. /// className (required) (default to "Dog"). + /// breed. /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string className = "Dog", string breed = default, string color = "red") : base(className, color) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs index 7b026acbf1e5..7563294d9944 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -36,7 +36,7 @@ public partial class DogAllOf : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// breed. - public DogAllOf(string breed = default(string)) + public DogAllOf(string breed = default) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs index d8cd2a70ef61..bbec316ee186 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -39,7 +39,7 @@ public partial class Drawing : Dictionary, IEquatable, I /// shapeOrNull. /// nullableShape. /// shapes. - public Drawing(Shape mainShape = default(Shape), ShapeOrNull shapeOrNull = default(ShapeOrNull), NullableShape nullableShape = default(NullableShape), List shapes = default(List)) : base() + public Drawing(Shape mainShape = default, ShapeOrNull shapeOrNull = default, NullableShape nullableShape = default, List shapes = default) : base() { this.MainShape = mainShape; this.ShapeOrNull = shapeOrNull; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs index 6d7830c0e8ba..f8a52d1b5faf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -57,7 +57,7 @@ public enum JustSymbolEnum /// Gets or Sets JustSymbol /// [DataMember(Name = "just_symbol", EmitDefaultValue = false)] - public JustSymbolEnum? JustSymbol { get; set; } + public JustSymbolEnum JustSymbol { get; set; } /// /// Defines ArrayEnum /// @@ -90,7 +90,7 @@ public enum ArrayEnumEnum /// /// justSymbol. /// arrayEnum. - public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + public EnumArrays(JustSymbolEnum justSymbol = default, List arrayEnum = default) { this.JustSymbol = justSymbol; this.ArrayEnum = arrayEnum; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs index 6f3d2272c5c3..b1b8afaa9a60 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -33,10 +33,10 @@ namespace Org.OpenAPITools.Model public partial class EnumTest : IEquatable, IValidatableObject { /// - /// Defines EnumString + /// Defines EnumStringRequired /// [JsonConverter(typeof(StringEnumConverter))] - public enum EnumStringEnum + public enum EnumStringRequiredEnum { /// /// Enum UPPER for value: UPPER @@ -60,15 +60,15 @@ public enum EnumStringEnum /// - /// Gets or Sets EnumString + /// Gets or Sets EnumStringRequired /// - [DataMember(Name = "enum_string", EmitDefaultValue = false)] - public EnumStringEnum? EnumString { get; set; } + [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } /// - /// Defines EnumStringRequired + /// Defines EnumString /// [JsonConverter(typeof(StringEnumConverter))] - public enum EnumStringRequiredEnum + public enum EnumStringEnum { /// /// Enum UPPER for value: UPPER @@ -92,10 +92,10 @@ public enum EnumStringRequiredEnum /// - /// Gets or Sets EnumStringRequired + /// Gets or Sets EnumString /// - [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)] - public EnumStringRequiredEnum EnumStringRequired { get; set; } + [DataMember(Name = "enum_string", EmitDefaultValue = false)] + public EnumStringEnum EnumString { get; set; } /// /// Defines EnumInteger /// @@ -118,7 +118,7 @@ public enum EnumIntegerEnum /// Gets or Sets EnumInteger /// [DataMember(Name = "enum_integer", EmitDefaultValue = false)] - public EnumIntegerEnum? EnumInteger { get; set; } + public EnumIntegerEnum EnumInteger { get; set; } /// /// Defines EnumIntegerOnly /// @@ -141,7 +141,7 @@ public enum EnumIntegerOnlyEnum /// Gets or Sets EnumIntegerOnly /// [DataMember(Name = "enum_integer_only", EmitDefaultValue = false)] - public EnumIntegerOnlyEnum? EnumIntegerOnly { get; set; } + public EnumIntegerOnlyEnum EnumIntegerOnly { get; set; } /// /// Defines EnumNumber /// @@ -167,31 +167,31 @@ public enum EnumNumberEnum /// Gets or Sets EnumNumber /// [DataMember(Name = "enum_number", EmitDefaultValue = false)] - public EnumNumberEnum? EnumNumber { get; set; } + public EnumNumberEnum EnumNumber { get; set; } /// /// Gets or Sets OuterEnum /// [DataMember(Name = "outerEnum", EmitDefaultValue = true)] - public OuterEnum? OuterEnum { get; set; } + public OuterEnum OuterEnum { get; set; } /// /// Gets or Sets OuterEnumInteger /// [DataMember(Name = "outerEnumInteger", EmitDefaultValue = false)] - public OuterEnumInteger? OuterEnumInteger { get; set; } + public OuterEnumInteger OuterEnumInteger { get; set; } /// /// Gets or Sets OuterEnumDefaultValue /// [DataMember(Name = "outerEnumDefaultValue", EmitDefaultValue = false)] - public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + public OuterEnumDefaultValue OuterEnumDefaultValue { get; set; } /// /// Gets or Sets OuterEnumIntegerDefaultValue /// [DataMember(Name = "outerEnumIntegerDefaultValue", EmitDefaultValue = false)] - public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + public OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue { get; set; } /// /// Initializes a new instance of the class. /// @@ -203,8 +203,8 @@ protected EnumTest() /// /// Initializes a new instance of the class. /// - /// enumString. /// enumStringRequired (required). + /// enumString. /// enumInteger. /// enumIntegerOnly. /// enumNumber. @@ -212,7 +212,7 @@ protected EnumTest() /// outerEnumInteger. /// outerEnumDefaultValue. /// outerEnumIntegerDefaultValue. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumIntegerOnlyEnum? enumIntegerOnly = default(EnumIntegerOnlyEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?), OuterEnumInteger? outerEnumInteger = default(OuterEnumInteger?), OuterEnumDefaultValue? outerEnumDefaultValue = default(OuterEnumDefaultValue?), OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue?)) + public EnumTest(EnumStringRequiredEnum enumStringRequired, EnumStringEnum enumString = default, EnumIntegerEnum enumInteger = default, EnumIntegerOnlyEnum enumIntegerOnly = default, EnumNumberEnum enumNumber = default, OuterEnum outerEnum = default, OuterEnumInteger outerEnumInteger = default, OuterEnumDefaultValue outerEnumDefaultValue = default, OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = default) { this.EnumStringRequired = enumStringRequired; this.EnumString = enumString; @@ -240,8 +240,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class EnumTest {\n"); - sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); @@ -292,8 +292,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index a931c0d6327a..43e72bd635aa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -45,7 +45,7 @@ protected EquilateralTriangle() /// /// shapeType (required). /// triangleType (required). - public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) + public EquilateralTriangle(string shapeType, string triangleType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs index e77d15e06bce..e4d0738adbf6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs @@ -36,7 +36,7 @@ public partial class File : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// Test capitalization. - public File(string sourceURI = default(string)) + public File(string sourceURI = default) { this.SourceURI = sourceURI; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 6808978c49f8..423799cb24e8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -37,7 +37,7 @@ public partial class FileSchemaTestClass : IEquatable, IVal /// /// file. /// files. - public FileSchemaTestClass(File file = default(File), List files = default(List)) + public FileSchemaTestClass(File file = default, List files = default) { this.File = file; this.Files = files; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs index eb38d586bbb7..8b846d403ffb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -43,23 +43,23 @@ protected FormatTest() /// /// Initializes a new instance of the class. /// + /// number (required). + /// _byte (required). + /// date (required). + /// password (required). /// integer. /// int32. /// int64. - /// number (required). /// _float. /// _double. /// _decimal. /// _string. - /// _byte (required). /// binary. - /// date (required). /// dateTime. /// uuid. - /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(decimal number, byte[] _byte, DateTime date, string password, int integer = default, int int32 = default, long int64 = default, float _float = default, double _double = default, decimal _decimal = default, string _string = default, System.IO.Stream binary = default, DateTime dateTime = default, Guid uuid = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default) { this.Number = number; // to ensure "_byte" is required (not null) @@ -88,6 +88,31 @@ protected FormatTest() this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets Number + /// + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)] + public decimal Number { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Date + /// + [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime Date { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)] + public string Password { get; set; } + /// /// Gets or Sets Integer /// @@ -106,12 +131,6 @@ protected FormatTest() [DataMember(Name = "int64", EmitDefaultValue = false)] public long Int64 { get; set; } - /// - /// Gets or Sets Number - /// - [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)] - public decimal Number { get; set; } - /// /// Gets or Sets Float /// @@ -136,25 +155,12 @@ protected FormatTest() [DataMember(Name = "string", EmitDefaultValue = false)] public string String { get; set; } - /// - /// Gets or Sets Byte - /// - [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)] - public byte[] Byte { get; set; } - /// /// Gets or Sets Binary /// [DataMember(Name = "binary", EmitDefaultValue = false)] public System.IO.Stream Binary { get; set; } - /// - /// Gets or Sets Date - /// - [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime Date { get; set; } - /// /// Gets or Sets DateTime /// @@ -167,12 +173,6 @@ protected FormatTest() [DataMember(Name = "uuid", EmitDefaultValue = false)] public Guid Uuid { get; set; } - /// - /// Gets or Sets Password - /// - [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)] - public string Password { get; set; } - /// /// A string that is a 10 digit number. Can have leading zeros. /// @@ -201,20 +201,20 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class FormatTest {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); - sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); - sb.Append(" Byte: ").Append(Byte).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); - sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -260,10 +260,22 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + if (this.Byte != null) + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } + if (this.Date != null) + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); - hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); @@ -271,18 +283,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.String.GetHashCode(); } - if (this.Byte != null) - { - hashCode = (hashCode * 59) + this.Byte.GetHashCode(); - } if (this.Binary != null) { hashCode = (hashCode * 59) + this.Binary.GetHashCode(); } - if (this.Date != null) - { - hashCode = (hashCode * 59) + this.Date.GetHashCode(); - } if (this.DateTime != null) { hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); @@ -291,10 +295,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); } - if (this.Password != null) - { - hashCode = (hashCode * 59) + this.Password.GetHashCode(); - } if (this.PatternWithDigits != null) { hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); @@ -318,6 +318,30 @@ public override int GetHashCode() /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + // Integer (int) maximum if (this.Integer > (int)100) { @@ -342,18 +366,6 @@ public override int GetHashCode() yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } - // Number (decimal) maximum - if (this.Number > (decimal)543.2) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); - } - - // Number (decimal) minimum - if (this.Number < (decimal)32.1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); - } - // Float (float) maximum if (this.Float > (float)987.6) { @@ -385,18 +397,6 @@ public override int GetHashCode() yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } - // Password (string) maxLength - if (this.Password != null && this.Password.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); - } - - // Password (string) minLength - if (this.Password != null && this.Password.Length < 10) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); - } - // PatternWithDigits (string) pattern Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index cee75f3f8157..24b3df864e19 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -48,7 +48,7 @@ protected GrandparentAnimal() /// Initializes a new instance of the class. /// /// petType (required). - public GrandparentAnimal(string petType = default(string)) + public GrandparentAnimal(string petType) { // to ensure "petType" is required (not null) if (petType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs index e8cbb68e2e4c..616877a9f601 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -36,7 +36,7 @@ public partial class HealthCheckResult : IEquatable, IValidat /// Initializes a new instance of the class. /// /// nullableMessage. - public HealthCheckResult(string nullableMessage = default(string)) + public HealthCheckResult(string nullableMessage = default) { this.NullableMessage = nullableMessage; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index ae46f1f0098f..fc8c0d066361 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -36,7 +36,7 @@ public partial class InlineResponseDefault : IEquatable, /// Initializes a new instance of the class. /// /// _string. - public InlineResponseDefault(Foo _string = default(Foo)) + public InlineResponseDefault(Foo _string = default) { this.String = _string; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 50e7ce4aaa8d..d5ff97d769cc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -42,7 +42,7 @@ protected IsoscelesTriangle() { } /// /// shapeType (required). /// triangleType (required). - public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) + public IsoscelesTriangle(string shapeType, string triangleType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs index 00814d110694..adaece91e886 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs @@ -36,7 +36,7 @@ public partial class List : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _123list. - public List(string _123list = default(string)) + public List(string _123list = default) { this._123List = _123list; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs index 8b5a73e77365..b5ab56afe6ae 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -66,7 +66,7 @@ public enum InnerEnum /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + public MapTest(Dictionary> mapMapOfString = default, Dictionary mapOfEnumString = default, Dictionary directMap = default, Dictionary indirectMap = default) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3225727af37b..63145e93f888 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -38,7 +38,7 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatableuuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default, DateTime dateTime = default, Dictionary map = default) { this.Uuid = uuid; this.DateTime = dateTime; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs index 79a49ef91d28..65d373b28745 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -37,7 +37,7 @@ public partial class Model200Response : IEquatable, IValidatab /// /// name. /// _class. - public Model200Response(int name = default(int), string _class = default(string)) + public Model200Response(int name = default, string _class = default) { this.Name = name; this.Class = _class; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs index 1995ec4b1692..c1f5970e0328 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -36,7 +36,7 @@ public partial class ModelClient : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _client. - public ModelClient(string _client = default(string)) + public ModelClient(string _client = default) { this._Client = _client; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs index 0dc21bb656f0..9bb13253bc32 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs @@ -45,7 +45,7 @@ protected Name() /// /// name (required). /// property. - public Name(int name = default(int), string property = default(string)) + public Name(int name, string property = default) { this._Name = name; this.Property = property; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs index 57555c376785..fd0c90505e6a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -47,7 +47,7 @@ public partial class NullableClass : Dictionary, IEquatableobjectNullableProp. /// objectAndItemsNullableProp. /// objectItemsNullable. - public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + public NullableClass(int? integerProp = default, decimal? numberProp = default, bool? booleanProp = default, string stringProp = default, DateTime? dateProp = default, DateTime? datetimeProp = default, List arrayNullableProp = default, List arrayAndItemsNullableProp = default, List arrayItemsNullable = default, Dictionary objectNullableProp = default, Dictionary objectAndItemsNullableProp = default, Dictionary objectItemsNullable = default) : base() { this.IntegerProp = integerProp; this.NumberProp = numberProp; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs index 97f869b0ebc1..7787cb03338d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -36,7 +36,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal justNumber = default(decimal)) + public NumberOnly(decimal justNumber = default) { this.JustNumber = justNumber; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 86ea32998f8c..de7d09291bfe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -39,7 +39,7 @@ public partial class ObjectWithDeprecatedFields : IEquatableid. /// deprecatedRef. /// bars. - public ObjectWithDeprecatedFields(string uuid = default(string), decimal id = default(decimal), DeprecatedObject deprecatedRef = default(DeprecatedObject), List bars = default(List)) + public ObjectWithDeprecatedFields(string uuid = default, decimal id = default, DeprecatedObject deprecatedRef = default, List bars = default) { this.Uuid = uuid; this.Id = id; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs index 5c52482e79b9..8c986b5f6763 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs @@ -65,7 +65,7 @@ public enum StatusEnum /// /// Order Status [DataMember(Name = "status", EmitDefaultValue = false)] - public StatusEnum? Status { get; set; } + public StatusEnum Status { get; set; } /// /// Initializes a new instance of the class. /// @@ -75,7 +75,7 @@ public enum StatusEnum /// shipDate. /// Order Status. /// complete (default to false). - public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) + public Order(long id = default, long petId = default, int quantity = default, DateTime shipDate = default, StatusEnum status = default, bool complete = false) { this.Id = id; this.PetId = petId; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs index 3209f6d6244e..7f4749fe8b5c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -38,7 +38,7 @@ public partial class OuterComposite : IEquatable, IValidatableOb /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) + public OuterComposite(decimal myNumber = default, string myString = default, bool myBoolean = default) { this.MyNumber = myNumber; this.MyString = myString; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs index 31fd118f4f68..c7c27fb4e98d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs @@ -65,7 +65,7 @@ public enum StatusEnum /// /// pet status in the store [DataMember(Name = "status", EmitDefaultValue = false)] - public StatusEnum? Status { get; set; } + public StatusEnum Status { get; set; } /// /// Initializes a new instance of the class. /// @@ -77,13 +77,13 @@ protected Pet() /// /// Initializes a new instance of the class. /// - /// id. - /// category. /// name (required). /// photoUrls (required). + /// id. + /// category. /// tags. /// pet status in the store. - public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(string name, List photoUrls, long id = default, Category category = default, List tags = default, StatusEnum status = default) { // to ensure "name" is required (not null) if (name == null) { @@ -102,18 +102,6 @@ protected Pet() this.AdditionalProperties = new Dictionary(); } - /// - /// Gets or Sets Id - /// - [DataMember(Name = "id", EmitDefaultValue = false)] - public long Id { get; set; } - - /// - /// Gets or Sets Category - /// - [DataMember(Name = "category", EmitDefaultValue = false)] - public Category Category { get; set; } - /// /// Gets or Sets Name /// @@ -126,6 +114,18 @@ protected Pet() [DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = false)] public List PhotoUrls { get; set; } + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public Category Category { get; set; } + /// /// Gets or Sets Tags /// @@ -146,10 +146,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); sb.Append(" Tags: ").Append(Tags).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -195,11 +195,6 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.Category != null) - { - hashCode = (hashCode * 59) + this.Category.GetHashCode(); - } if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); @@ -208,6 +203,11 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Category != null) + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Tags != null) { hashCode = (hashCode * 59) + this.Tags.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 4d7c39c4364d..b29e2db36b6b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -44,7 +44,7 @@ protected QuadrilateralInterface() /// Initializes a new instance of the class. /// /// quadrilateralType (required). - public QuadrilateralInterface(string quadrilateralType = default(string)) + public QuadrilateralInterface(string quadrilateralType) { // to ensure "quadrilateralType" is required (not null) if (quadrilateralType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index ad59ca832864..6b4acaddf1b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -36,7 +36,7 @@ public partial class ReadOnlyFirst : IEquatable, IValidatableObje /// Initializes a new instance of the class. /// /// baz. - public ReadOnlyFirst(string baz = default(string)) + public ReadOnlyFirst(string baz = default) { this.Baz = baz; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs index e702e0157030..c862011ba9de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs @@ -36,7 +36,7 @@ public partial class Return : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _return. - public Return(int _return = default(int)) + public Return(int _return = default) { this._Return = _return; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 236839471475..206e0fbe3315 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -45,7 +45,7 @@ protected ScaleneTriangle() /// /// shapeType (required). /// triangleType (required). - public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) + public ScaleneTriangle(string shapeType, string triangleType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs index 92774561aaa5..55788e33f354 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -44,7 +44,7 @@ protected ShapeInterface() /// Initializes a new instance of the class. /// /// shapeType (required). - public ShapeInterface(string shapeType = default(string)) + public ShapeInterface(string shapeType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index fc9b37ce01fb..1398011e13f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -45,7 +45,7 @@ protected SimpleQuadrilateral() /// /// shapeType (required). /// quadrilateralType (required). - public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + public SimpleQuadrilateral(string shapeType, string quadrilateralType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7800467822ea..e24187da5be7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -37,7 +37,7 @@ public partial class SpecialModelName : IEquatable, IValidatab /// /// specialPropertyName. /// specialModelName. - public SpecialModelName(long specialPropertyName = default(long), string specialModelName = default(string)) + public SpecialModelName(long specialPropertyName = default, string specialModelName = default) { this.SpecialPropertyName = specialPropertyName; this._SpecialModelName = specialModelName; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs index 3df2c02e2cef..cca02fceb327 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs @@ -37,7 +37,7 @@ public partial class Tag : IEquatable, IValidatableObject /// /// id. /// name. - public Tag(long id = default(long), string name = default(string)) + public Tag(long id = default, string name = default) { this.Id = id; this.Name = name; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs index 7f7abb5bc85b..8c62abd8c657 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -44,7 +44,7 @@ protected TriangleInterface() /// Initializes a new instance of the class. /// /// triangleType (required). - public TriangleInterface(string triangleType = default(string)) + public TriangleInterface(string triangleType) { // to ensure "triangleType" is required (not null) if (triangleType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs index 5f2a3020c3dd..709d9397d872 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs @@ -47,7 +47,7 @@ public partial class User : IEquatable, IValidatableObject /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. - public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int), Object objectWithNoDeclaredProps = default(Object), Object objectWithNoDeclaredPropsNullable = default(Object), Object anyTypeProp = default(Object), Object anyTypePropNullable = default(Object)) + public User(long id = default, string username = default, string firstName = default, string lastName = default, string email = default, string password = default, string phone = default, int userStatus = default, Object objectWithNoDeclaredProps = default, Object objectWithNoDeclaredPropsNullable = default, Object anyTypeProp = default, Object anyTypePropNullable = default) { this.Id = id; this.Username = username; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs index c30b6dbfabed..2eb7fa28c7fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs @@ -43,10 +43,10 @@ protected Whale() /// /// Initializes a new instance of the class. /// + /// className (required). /// hasBaleen. /// hasTeeth. - /// className (required). - public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) + public Whale(string className, bool hasBaleen = default, bool hasTeeth = default) { // to ensure "className" is required (not null) if (className == null) { @@ -58,6 +58,12 @@ protected Whale() this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + /// /// Gets or Sets HasBaleen /// @@ -70,12 +76,6 @@ protected Whale() [DataMember(Name = "hasTeeth", EmitDefaultValue = true)] public bool HasTeeth { get; set; } - /// - /// Gets or Sets ClassName - /// - [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -90,9 +90,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Whale {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -136,12 +136,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); - hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.ClassName != null) { hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); } + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs index 4fb60ed8ddf2..ddb4196e8549 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -63,7 +63,7 @@ public enum TypeEnum /// Gets or Sets Type /// [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + public TypeEnum Type { get; set; } /// /// Initializes a new instance of the class. /// @@ -75,9 +75,9 @@ protected Zebra() /// /// Initializes a new instance of the class. /// - /// type. /// className (required). - public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() + /// type. + public Zebra(string className, TypeEnum type = default) : base() { // to ensure "className" is required (not null) if (className == null) { @@ -109,8 +109,8 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class Zebra {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -154,11 +154,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ClassName != null) { hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Category.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Category.md index 6eb0a2e13eaa..c2cf3f8e919e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Category.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Category.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long** | | [optional] **Name** | **string** | | [default to "default-name"] +**Id** | **long** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCat.md index 88fe8f7a7fdd..48a3c7fd38d9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCat.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ChildCat.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] **PetType** | **string** | | [default to PetTypeEnum.ChildCat] +**Name** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumTest.md index d2b72b5368fb..71602270bab4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/EnumTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | +**EnumString** | **string** | | [optional] **EnumInteger** | **int** | | [optional] **EnumIntegerOnly** | **int** | | [optional] **EnumNumber** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md index b0d2f47b2eb6..0b92c2fb10a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md @@ -4,20 +4,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Number** | **decimal** | | +**Byte** | **byte[]** | | +**Date** | **DateTime** | | +**Password** | **string** | | **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] **Int64** | **long** | | [optional] -**Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] **Decimal** | **decimal** | | [optional] **String** | **string** | | [optional] -**Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime** | | **DateTime** | **DateTime** | | [optional] **Uuid** | **Guid** | | [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] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FruitReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FruitReq.md index 5afd947f4a63..5217febc9b68 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FruitReq.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FruitReq.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Cultivar** | **string** | | -**Mealy** | **bool** | | [optional] **LengthCm** | **decimal** | | +**Mealy** | **bool** | | [optional] **Sweet** | **bool** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Mammal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Mammal.md index 79d95fce63a3..82a8ca6027b5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Mammal.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Mammal.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | **HasBaleen** | **bool** | | [optional] **HasTeeth** | **bool** | | [optional] -**ClassName** | **string** | | **Type** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pet.md index 6a9d41feb0d6..7de10304abf4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pet.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Pet.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long** | | [optional] -**Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | +**Id** | **long** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] **Tags** | [**List<Tag>**](Tag.md) | | [optional] **Status** | **string** | pet status in the store | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Whale.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Whale.md index afbc08409d22..1c633fdce61b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Whale.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Whale.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | **HasBaleen** | **bool** | | [optional] **HasTeeth** | **bool** | | [optional] -**ClassName** | **string** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Zebra.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Zebra.md index 4c5a820bac04..aef3866b92c9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Zebra.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Zebra.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | [optional] **ClassName** | **string** | | +**Type** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b3ddad35a07d..14d0e92eaa29 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -43,7 +43,7 @@ public partial class AdditionalPropertiesClass : IEquatablemapWithUndeclaredPropertiesAnytype3. /// an object with no declared properties and no undeclared properties, hence it's an empty map.. /// mapWithUndeclaredPropertiesString. - public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>), Object anytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype2 = default(Object), Dictionary mapWithUndeclaredPropertiesAnytype3 = default(Dictionary), Object emptyMap = default(Object), Dictionary mapWithUndeclaredPropertiesString = default(Dictionary)) + public AdditionalPropertiesClass(Dictionary mapProperty = default, Dictionary> mapOfMapProperty = default, Object anytype1 = default, Object mapWithUndeclaredPropertiesAnytype1 = default, Object mapWithUndeclaredPropertiesAnytype2 = default, Dictionary mapWithUndeclaredPropertiesAnytype3 = default, Object emptyMap = default, Dictionary mapWithUndeclaredPropertiesString = default) { this.MapProperty = mapProperty; this.MapOfMapProperty = mapOfMapProperty; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs index e8ea00bb46a8..73eef4704068 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs @@ -49,7 +49,7 @@ protected Animal() /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className, string color = "red") { // to ensure "className" is required (not null) if (className == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs index 79873f4ddfed..e5fee65b6bc2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -38,7 +38,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// code. /// type. /// message. - public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) + public ApiResponse(int code = default, string type = default, string message = default) { this.Code = code; this.Type = type; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs index 8b1f87d1aa9a..adf8438c5912 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs @@ -37,7 +37,7 @@ public partial class Apple : IEquatable, IValidatableObject /// /// cultivar. /// origin. - public Apple(string cultivar = default(string), string origin = default(string)) + public Apple(string cultivar = default, string origin = default) { this.Cultivar = cultivar; this.Origin = origin; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs index 1d6d42dc9b3a..28ce313d0b60 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -42,7 +42,7 @@ protected AppleReq() { } /// /// cultivar (required). /// mealy. - public AppleReq(string cultivar = default(string), bool mealy = default(bool)) + public AppleReq(string cultivar, bool mealy = default) { // to ensure "cultivar" is required (not null) if (cultivar == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 30bf57ef0f52..a342794fafaa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -36,7 +36,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatable class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default) { this.ArrayArrayNumber = arrayArrayNumber; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8a215aad133b..349fc7ef5a1d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -36,7 +36,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValidat /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List arrayNumber = default) { this.ArrayNumber = arrayNumber; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs index 1a879a1d9ca2..b7f6f3cd1779 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -38,7 +38,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List arrayOfString = default, List> arrayArrayOfInteger = default, List> arrayArrayOfModel = default) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs index 97939597ede8..bb1962fc2b2f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs @@ -36,7 +36,7 @@ public partial class Banana : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// lengthCm. - public Banana(decimal lengthCm = default(decimal)) + public Banana(decimal lengthCm = default) { this.LengthCm = lengthCm; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs index fdd36929d13c..812c91b012fe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -42,7 +42,7 @@ protected BananaReq() { } /// /// lengthCm (required). /// sweet. - public BananaReq(decimal lengthCm = default(decimal), bool sweet = default(bool)) + public BananaReq(decimal lengthCm, bool sweet = default) { this.LengthCm = lengthCm; this.Sweet = sweet; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs index ea4ff737c89a..0706a3e8196b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -44,7 +44,7 @@ protected BasquePig() /// Initializes a new instance of the class. /// /// className (required). - public BasquePig(string className = default(string)) + public BasquePig(string className) { // to ensure "className" is required (not null) if (className == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs index be68a50a116a..377781227e62 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -41,7 +41,7 @@ public partial class Capitalization : IEquatable, IValidatableOb /// capitalSnake. /// sCAETHFlowPoints. /// Name of the pet . - public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + public Capitalization(string smallCamel = default, string capitalCamel = default, string smallSnake = default, string capitalSnake = default, string sCAETHFlowPoints = default, string aTTNAME = default) { this.SmallCamel = smallCamel; this.CapitalCamel = capitalCamel; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs index 2bc55707da95..d7c0634c555a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs @@ -45,10 +45,10 @@ protected Cat() /// /// Initializes a new instance of the class. /// - /// declawed. /// className (required) (default to "Cat"). + /// declawed. /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(string className = "Cat", bool declawed = default, string color = "red") : base(className, color) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs index 3a960e9925e3..5aa226e03f6e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -36,7 +36,7 @@ public partial class CatAllOf : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// declawed. - public CatAllOf(bool declawed = default(bool)) + public CatAllOf(bool declawed = default) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs index 0cc23f5f6c23..8cd4fe7e9ac9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs @@ -43,9 +43,9 @@ protected Category() /// /// Initializes a new instance of the class. /// - /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + /// id. + public Category(string name = "default-name", long id = default) { // to ensure "name" is required (not null) if (name == null) { @@ -56,18 +56,18 @@ protected Category() this.AdditionalProperties = new Dictionary(); } - /// - /// Gets or Sets Id - /// - [DataMember(Name = "id", EmitDefaultValue = false)] - public long Id { get; set; } - /// /// Gets or Sets Name /// [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] public string Name { get; set; } + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + /// /// Gets or Sets additional properties /// @@ -82,8 +82,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -127,11 +127,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCat.cs index 7a15a5297df2..991717f25912 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCat.cs @@ -65,9 +65,9 @@ protected ChildCat() /// /// Initializes a new instance of the class. /// - /// name. /// petType (required) (default to PetTypeEnum.ChildCat). - public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base() + /// name. + public ChildCat(PetTypeEnum petType = PetTypeEnum.ChildCat, string name = default) : base() { this.PetType = petType; this.Name = name; @@ -95,8 +95,8 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -140,11 +140,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index a353ad7ffd71..483062ead25b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -51,13 +51,13 @@ public enum PetTypeEnum /// Gets or Sets PetType /// [DataMember(Name = "pet_type", EmitDefaultValue = false)] - public PetTypeEnum? PetType { get; set; } + public PetTypeEnum PetType { get; set; } /// /// Initializes a new instance of the class. /// /// name. /// petType (default to PetTypeEnum.ChildCat). - public ChildCatAllOf(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) + public ChildCatAllOf(string name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) { this.Name = name; this.PetType = petType; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs index 7177e9bf0b6c..fa446f3a33ff 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -36,7 +36,7 @@ public partial class ClassModel : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _class. - public ClassModel(string _class = default(string)) + public ClassModel(string _class = default) { this.Class = _class; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 807f0eb26bf8..ab75994ddf5c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -45,7 +45,7 @@ protected ComplexQuadrilateral() /// /// shapeType (required). /// quadrilateralType (required). - public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + public ComplexQuadrilateral(string shapeType, string quadrilateralType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs index a27b1db39297..7314bf3a2140 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -44,7 +44,7 @@ protected DanishPig() /// Initializes a new instance of the class. /// /// className (required). - public DanishPig(string className = default(string)) + public DanishPig(string className) { // to ensure "className" is required (not null) if (className == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1928b236bf66..a900bc224e49 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -36,7 +36,7 @@ public partial class DeprecatedObject : IEquatable, IValidatab /// Initializes a new instance of the class. /// /// name. - public DeprecatedObject(string name = default(string)) + public DeprecatedObject(string name = default) { this.Name = name; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs index 9cd520deaf82..d34b90a530d3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs @@ -45,10 +45,10 @@ protected Dog() /// /// Initializes a new instance of the class. /// - /// breed. /// className (required) (default to "Dog"). + /// breed. /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string className = "Dog", string breed = default, string color = "red") : base(className, color) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs index 7b026acbf1e5..7563294d9944 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -36,7 +36,7 @@ public partial class DogAllOf : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// breed. - public DogAllOf(string breed = default(string)) + public DogAllOf(string breed = default) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs index d8cd2a70ef61..bbec316ee186 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -39,7 +39,7 @@ public partial class Drawing : Dictionary, IEquatable, I /// shapeOrNull. /// nullableShape. /// shapes. - public Drawing(Shape mainShape = default(Shape), ShapeOrNull shapeOrNull = default(ShapeOrNull), NullableShape nullableShape = default(NullableShape), List shapes = default(List)) : base() + public Drawing(Shape mainShape = default, ShapeOrNull shapeOrNull = default, NullableShape nullableShape = default, List shapes = default) : base() { this.MainShape = mainShape; this.ShapeOrNull = shapeOrNull; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs index 6d7830c0e8ba..f8a52d1b5faf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -57,7 +57,7 @@ public enum JustSymbolEnum /// Gets or Sets JustSymbol /// [DataMember(Name = "just_symbol", EmitDefaultValue = false)] - public JustSymbolEnum? JustSymbol { get; set; } + public JustSymbolEnum JustSymbol { get; set; } /// /// Defines ArrayEnum /// @@ -90,7 +90,7 @@ public enum ArrayEnumEnum /// /// justSymbol. /// arrayEnum. - public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + public EnumArrays(JustSymbolEnum justSymbol = default, List arrayEnum = default) { this.JustSymbol = justSymbol; this.ArrayEnum = arrayEnum; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs index 6f3d2272c5c3..b1b8afaa9a60 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -33,10 +33,10 @@ namespace Org.OpenAPITools.Model public partial class EnumTest : IEquatable, IValidatableObject { /// - /// Defines EnumString + /// Defines EnumStringRequired /// [JsonConverter(typeof(StringEnumConverter))] - public enum EnumStringEnum + public enum EnumStringRequiredEnum { /// /// Enum UPPER for value: UPPER @@ -60,15 +60,15 @@ public enum EnumStringEnum /// - /// Gets or Sets EnumString + /// Gets or Sets EnumStringRequired /// - [DataMember(Name = "enum_string", EmitDefaultValue = false)] - public EnumStringEnum? EnumString { get; set; } + [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } /// - /// Defines EnumStringRequired + /// Defines EnumString /// [JsonConverter(typeof(StringEnumConverter))] - public enum EnumStringRequiredEnum + public enum EnumStringEnum { /// /// Enum UPPER for value: UPPER @@ -92,10 +92,10 @@ public enum EnumStringRequiredEnum /// - /// Gets or Sets EnumStringRequired + /// Gets or Sets EnumString /// - [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)] - public EnumStringRequiredEnum EnumStringRequired { get; set; } + [DataMember(Name = "enum_string", EmitDefaultValue = false)] + public EnumStringEnum EnumString { get; set; } /// /// Defines EnumInteger /// @@ -118,7 +118,7 @@ public enum EnumIntegerEnum /// Gets or Sets EnumInteger /// [DataMember(Name = "enum_integer", EmitDefaultValue = false)] - public EnumIntegerEnum? EnumInteger { get; set; } + public EnumIntegerEnum EnumInteger { get; set; } /// /// Defines EnumIntegerOnly /// @@ -141,7 +141,7 @@ public enum EnumIntegerOnlyEnum /// Gets or Sets EnumIntegerOnly /// [DataMember(Name = "enum_integer_only", EmitDefaultValue = false)] - public EnumIntegerOnlyEnum? EnumIntegerOnly { get; set; } + public EnumIntegerOnlyEnum EnumIntegerOnly { get; set; } /// /// Defines EnumNumber /// @@ -167,31 +167,31 @@ public enum EnumNumberEnum /// Gets or Sets EnumNumber /// [DataMember(Name = "enum_number", EmitDefaultValue = false)] - public EnumNumberEnum? EnumNumber { get; set; } + public EnumNumberEnum EnumNumber { get; set; } /// /// Gets or Sets OuterEnum /// [DataMember(Name = "outerEnum", EmitDefaultValue = true)] - public OuterEnum? OuterEnum { get; set; } + public OuterEnum OuterEnum { get; set; } /// /// Gets or Sets OuterEnumInteger /// [DataMember(Name = "outerEnumInteger", EmitDefaultValue = false)] - public OuterEnumInteger? OuterEnumInteger { get; set; } + public OuterEnumInteger OuterEnumInteger { get; set; } /// /// Gets or Sets OuterEnumDefaultValue /// [DataMember(Name = "outerEnumDefaultValue", EmitDefaultValue = false)] - public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + public OuterEnumDefaultValue OuterEnumDefaultValue { get; set; } /// /// Gets or Sets OuterEnumIntegerDefaultValue /// [DataMember(Name = "outerEnumIntegerDefaultValue", EmitDefaultValue = false)] - public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + public OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue { get; set; } /// /// Initializes a new instance of the class. /// @@ -203,8 +203,8 @@ protected EnumTest() /// /// Initializes a new instance of the class. /// - /// enumString. /// enumStringRequired (required). + /// enumString. /// enumInteger. /// enumIntegerOnly. /// enumNumber. @@ -212,7 +212,7 @@ protected EnumTest() /// outerEnumInteger. /// outerEnumDefaultValue. /// outerEnumIntegerDefaultValue. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumIntegerOnlyEnum? enumIntegerOnly = default(EnumIntegerOnlyEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?), OuterEnumInteger? outerEnumInteger = default(OuterEnumInteger?), OuterEnumDefaultValue? outerEnumDefaultValue = default(OuterEnumDefaultValue?), OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue?)) + public EnumTest(EnumStringRequiredEnum enumStringRequired, EnumStringEnum enumString = default, EnumIntegerEnum enumInteger = default, EnumIntegerOnlyEnum enumIntegerOnly = default, EnumNumberEnum enumNumber = default, OuterEnum outerEnum = default, OuterEnumInteger outerEnumInteger = default, OuterEnumDefaultValue outerEnumDefaultValue = default, OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = default) { this.EnumStringRequired = enumStringRequired; this.EnumString = enumString; @@ -240,8 +240,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class EnumTest {\n"); - sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); @@ -292,8 +292,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index a931c0d6327a..43e72bd635aa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -45,7 +45,7 @@ protected EquilateralTriangle() /// /// shapeType (required). /// triangleType (required). - public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) + public EquilateralTriangle(string shapeType, string triangleType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs index e77d15e06bce..e4d0738adbf6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs @@ -36,7 +36,7 @@ public partial class File : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// Test capitalization. - public File(string sourceURI = default(string)) + public File(string sourceURI = default) { this.SourceURI = sourceURI; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 6808978c49f8..423799cb24e8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -37,7 +37,7 @@ public partial class FileSchemaTestClass : IEquatable, IVal /// /// file. /// files. - public FileSchemaTestClass(File file = default(File), List files = default(List)) + public FileSchemaTestClass(File file = default, List files = default) { this.File = file; this.Files = files; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs index eb38d586bbb7..8b846d403ffb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -43,23 +43,23 @@ protected FormatTest() /// /// Initializes a new instance of the class. /// + /// number (required). + /// _byte (required). + /// date (required). + /// password (required). /// integer. /// int32. /// int64. - /// number (required). /// _float. /// _double. /// _decimal. /// _string. - /// _byte (required). /// binary. - /// date (required). /// dateTime. /// uuid. - /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(decimal number, byte[] _byte, DateTime date, string password, int integer = default, int int32 = default, long int64 = default, float _float = default, double _double = default, decimal _decimal = default, string _string = default, System.IO.Stream binary = default, DateTime dateTime = default, Guid uuid = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default) { this.Number = number; // to ensure "_byte" is required (not null) @@ -88,6 +88,31 @@ protected FormatTest() this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets Number + /// + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)] + public decimal Number { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Date + /// + [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime Date { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)] + public string Password { get; set; } + /// /// Gets or Sets Integer /// @@ -106,12 +131,6 @@ protected FormatTest() [DataMember(Name = "int64", EmitDefaultValue = false)] public long Int64 { get; set; } - /// - /// Gets or Sets Number - /// - [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)] - public decimal Number { get; set; } - /// /// Gets or Sets Float /// @@ -136,25 +155,12 @@ protected FormatTest() [DataMember(Name = "string", EmitDefaultValue = false)] public string String { get; set; } - /// - /// Gets or Sets Byte - /// - [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)] - public byte[] Byte { get; set; } - /// /// Gets or Sets Binary /// [DataMember(Name = "binary", EmitDefaultValue = false)] public System.IO.Stream Binary { get; set; } - /// - /// Gets or Sets Date - /// - [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime Date { get; set; } - /// /// Gets or Sets DateTime /// @@ -167,12 +173,6 @@ protected FormatTest() [DataMember(Name = "uuid", EmitDefaultValue = false)] public Guid Uuid { get; set; } - /// - /// Gets or Sets Password - /// - [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)] - public string Password { get; set; } - /// /// A string that is a 10 digit number. Can have leading zeros. /// @@ -201,20 +201,20 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class FormatTest {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); - sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); - sb.Append(" Byte: ").Append(Byte).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); - sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -260,10 +260,22 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + if (this.Byte != null) + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } + if (this.Date != null) + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); - hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); @@ -271,18 +283,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.String.GetHashCode(); } - if (this.Byte != null) - { - hashCode = (hashCode * 59) + this.Byte.GetHashCode(); - } if (this.Binary != null) { hashCode = (hashCode * 59) + this.Binary.GetHashCode(); } - if (this.Date != null) - { - hashCode = (hashCode * 59) + this.Date.GetHashCode(); - } if (this.DateTime != null) { hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); @@ -291,10 +295,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); } - if (this.Password != null) - { - hashCode = (hashCode * 59) + this.Password.GetHashCode(); - } if (this.PatternWithDigits != null) { hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); @@ -318,6 +318,30 @@ public override int GetHashCode() /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + // Integer (int) maximum if (this.Integer > (int)100) { @@ -342,18 +366,6 @@ public override int GetHashCode() yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } - // Number (decimal) maximum - if (this.Number > (decimal)543.2) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); - } - - // Number (decimal) minimum - if (this.Number < (decimal)32.1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); - } - // Float (float) maximum if (this.Float > (float)987.6) { @@ -385,18 +397,6 @@ public override int GetHashCode() yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } - // Password (string) maxLength - if (this.Password != null && this.Password.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); - } - - // Password (string) minLength - if (this.Password != null && this.Password.Length < 10) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); - } - // PatternWithDigits (string) pattern Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index cee75f3f8157..24b3df864e19 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -48,7 +48,7 @@ protected GrandparentAnimal() /// Initializes a new instance of the class. /// /// petType (required). - public GrandparentAnimal(string petType = default(string)) + public GrandparentAnimal(string petType) { // to ensure "petType" is required (not null) if (petType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs index e8cbb68e2e4c..616877a9f601 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -36,7 +36,7 @@ public partial class HealthCheckResult : IEquatable, IValidat /// Initializes a new instance of the class. /// /// nullableMessage. - public HealthCheckResult(string nullableMessage = default(string)) + public HealthCheckResult(string nullableMessage = default) { this.NullableMessage = nullableMessage; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index ae46f1f0098f..fc8c0d066361 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -36,7 +36,7 @@ public partial class InlineResponseDefault : IEquatable, /// Initializes a new instance of the class. /// /// _string. - public InlineResponseDefault(Foo _string = default(Foo)) + public InlineResponseDefault(Foo _string = default) { this.String = _string; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 50e7ce4aaa8d..d5ff97d769cc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -42,7 +42,7 @@ protected IsoscelesTriangle() { } /// /// shapeType (required). /// triangleType (required). - public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) + public IsoscelesTriangle(string shapeType, string triangleType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs index 00814d110694..adaece91e886 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs @@ -36,7 +36,7 @@ public partial class List : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _123list. - public List(string _123list = default(string)) + public List(string _123list = default) { this._123List = _123list; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs index 8b5a73e77365..b5ab56afe6ae 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -66,7 +66,7 @@ public enum InnerEnum /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + public MapTest(Dictionary> mapMapOfString = default, Dictionary mapOfEnumString = default, Dictionary directMap = default, Dictionary indirectMap = default) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3225727af37b..63145e93f888 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -38,7 +38,7 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatableuuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default, DateTime dateTime = default, Dictionary map = default) { this.Uuid = uuid; this.DateTime = dateTime; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs index 79a49ef91d28..65d373b28745 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -37,7 +37,7 @@ public partial class Model200Response : IEquatable, IValidatab /// /// name. /// _class. - public Model200Response(int name = default(int), string _class = default(string)) + public Model200Response(int name = default, string _class = default) { this.Name = name; this.Class = _class; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs index 1995ec4b1692..c1f5970e0328 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -36,7 +36,7 @@ public partial class ModelClient : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _client. - public ModelClient(string _client = default(string)) + public ModelClient(string _client = default) { this._Client = _client; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs index 0dc21bb656f0..9bb13253bc32 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs @@ -45,7 +45,7 @@ protected Name() /// /// name (required). /// property. - public Name(int name = default(int), string property = default(string)) + public Name(int name, string property = default) { this._Name = name; this.Property = property; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs index 57555c376785..fd0c90505e6a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -47,7 +47,7 @@ public partial class NullableClass : Dictionary, IEquatableobjectNullableProp. /// objectAndItemsNullableProp. /// objectItemsNullable. - public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + public NullableClass(int? integerProp = default, decimal? numberProp = default, bool? booleanProp = default, string stringProp = default, DateTime? dateProp = default, DateTime? datetimeProp = default, List arrayNullableProp = default, List arrayAndItemsNullableProp = default, List arrayItemsNullable = default, Dictionary objectNullableProp = default, Dictionary objectAndItemsNullableProp = default, Dictionary objectItemsNullable = default) : base() { this.IntegerProp = integerProp; this.NumberProp = numberProp; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs index 97f869b0ebc1..7787cb03338d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -36,7 +36,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal justNumber = default(decimal)) + public NumberOnly(decimal justNumber = default) { this.JustNumber = justNumber; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 86ea32998f8c..de7d09291bfe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -39,7 +39,7 @@ public partial class ObjectWithDeprecatedFields : IEquatableid. /// deprecatedRef. /// bars. - public ObjectWithDeprecatedFields(string uuid = default(string), decimal id = default(decimal), DeprecatedObject deprecatedRef = default(DeprecatedObject), List bars = default(List)) + public ObjectWithDeprecatedFields(string uuid = default, decimal id = default, DeprecatedObject deprecatedRef = default, List bars = default) { this.Uuid = uuid; this.Id = id; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs index 5c52482e79b9..8c986b5f6763 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs @@ -65,7 +65,7 @@ public enum StatusEnum /// /// Order Status [DataMember(Name = "status", EmitDefaultValue = false)] - public StatusEnum? Status { get; set; } + public StatusEnum Status { get; set; } /// /// Initializes a new instance of the class. /// @@ -75,7 +75,7 @@ public enum StatusEnum /// shipDate. /// Order Status. /// complete (default to false). - public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) + public Order(long id = default, long petId = default, int quantity = default, DateTime shipDate = default, StatusEnum status = default, bool complete = false) { this.Id = id; this.PetId = petId; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs index 3209f6d6244e..7f4749fe8b5c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -38,7 +38,7 @@ public partial class OuterComposite : IEquatable, IValidatableOb /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) + public OuterComposite(decimal myNumber = default, string myString = default, bool myBoolean = default) { this.MyNumber = myNumber; this.MyString = myString; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs index 31fd118f4f68..c7c27fb4e98d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs @@ -65,7 +65,7 @@ public enum StatusEnum /// /// pet status in the store [DataMember(Name = "status", EmitDefaultValue = false)] - public StatusEnum? Status { get; set; } + public StatusEnum Status { get; set; } /// /// Initializes a new instance of the class. /// @@ -77,13 +77,13 @@ protected Pet() /// /// Initializes a new instance of the class. /// - /// id. - /// category. /// name (required). /// photoUrls (required). + /// id. + /// category. /// tags. /// pet status in the store. - public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(string name, List photoUrls, long id = default, Category category = default, List tags = default, StatusEnum status = default) { // to ensure "name" is required (not null) if (name == null) { @@ -102,18 +102,6 @@ protected Pet() this.AdditionalProperties = new Dictionary(); } - /// - /// Gets or Sets Id - /// - [DataMember(Name = "id", EmitDefaultValue = false)] - public long Id { get; set; } - - /// - /// Gets or Sets Category - /// - [DataMember(Name = "category", EmitDefaultValue = false)] - public Category Category { get; set; } - /// /// Gets or Sets Name /// @@ -126,6 +114,18 @@ protected Pet() [DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = false)] public List PhotoUrls { get; set; } + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public Category Category { get; set; } + /// /// Gets or Sets Tags /// @@ -146,10 +146,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); sb.Append(" Tags: ").Append(Tags).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -195,11 +195,6 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.Category != null) - { - hashCode = (hashCode * 59) + this.Category.GetHashCode(); - } if (this.Name != null) { hashCode = (hashCode * 59) + this.Name.GetHashCode(); @@ -208,6 +203,11 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Category != null) + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Tags != null) { hashCode = (hashCode * 59) + this.Tags.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 4d7c39c4364d..b29e2db36b6b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -44,7 +44,7 @@ protected QuadrilateralInterface() /// Initializes a new instance of the class. /// /// quadrilateralType (required). - public QuadrilateralInterface(string quadrilateralType = default(string)) + public QuadrilateralInterface(string quadrilateralType) { // to ensure "quadrilateralType" is required (not null) if (quadrilateralType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index ad59ca832864..6b4acaddf1b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -36,7 +36,7 @@ public partial class ReadOnlyFirst : IEquatable, IValidatableObje /// Initializes a new instance of the class. /// /// baz. - public ReadOnlyFirst(string baz = default(string)) + public ReadOnlyFirst(string baz = default) { this.Baz = baz; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs index e702e0157030..c862011ba9de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs @@ -36,7 +36,7 @@ public partial class Return : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _return. - public Return(int _return = default(int)) + public Return(int _return = default) { this._Return = _return; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 236839471475..206e0fbe3315 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -45,7 +45,7 @@ protected ScaleneTriangle() /// /// shapeType (required). /// triangleType (required). - public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) + public ScaleneTriangle(string shapeType, string triangleType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs index 92774561aaa5..55788e33f354 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -44,7 +44,7 @@ protected ShapeInterface() /// Initializes a new instance of the class. /// /// shapeType (required). - public ShapeInterface(string shapeType = default(string)) + public ShapeInterface(string shapeType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index fc9b37ce01fb..1398011e13f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -45,7 +45,7 @@ protected SimpleQuadrilateral() /// /// shapeType (required). /// quadrilateralType (required). - public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + public SimpleQuadrilateral(string shapeType, string quadrilateralType) { // to ensure "shapeType" is required (not null) if (shapeType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7800467822ea..e24187da5be7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -37,7 +37,7 @@ public partial class SpecialModelName : IEquatable, IValidatab /// /// specialPropertyName. /// specialModelName. - public SpecialModelName(long specialPropertyName = default(long), string specialModelName = default(string)) + public SpecialModelName(long specialPropertyName = default, string specialModelName = default) { this.SpecialPropertyName = specialPropertyName; this._SpecialModelName = specialModelName; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs index 3df2c02e2cef..cca02fceb327 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs @@ -37,7 +37,7 @@ public partial class Tag : IEquatable, IValidatableObject /// /// id. /// name. - public Tag(long id = default(long), string name = default(string)) + public Tag(long id = default, string name = default) { this.Id = id; this.Name = name; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs index 7f7abb5bc85b..8c62abd8c657 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -44,7 +44,7 @@ protected TriangleInterface() /// Initializes a new instance of the class. /// /// triangleType (required). - public TriangleInterface(string triangleType = default(string)) + public TriangleInterface(string triangleType) { // to ensure "triangleType" is required (not null) if (triangleType == null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs index 5f2a3020c3dd..709d9397d872 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs @@ -47,7 +47,7 @@ public partial class User : IEquatable, IValidatableObject /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. - public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int), Object objectWithNoDeclaredProps = default(Object), Object objectWithNoDeclaredPropsNullable = default(Object), Object anyTypeProp = default(Object), Object anyTypePropNullable = default(Object)) + public User(long id = default, string username = default, string firstName = default, string lastName = default, string email = default, string password = default, string phone = default, int userStatus = default, Object objectWithNoDeclaredProps = default, Object objectWithNoDeclaredPropsNullable = default, Object anyTypeProp = default, Object anyTypePropNullable = default) { this.Id = id; this.Username = username; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs index c30b6dbfabed..2eb7fa28c7fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs @@ -43,10 +43,10 @@ protected Whale() /// /// Initializes a new instance of the class. /// + /// className (required). /// hasBaleen. /// hasTeeth. - /// className (required). - public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) + public Whale(string className, bool hasBaleen = default, bool hasTeeth = default) { // to ensure "className" is required (not null) if (className == null) { @@ -58,6 +58,12 @@ protected Whale() this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] + public string ClassName { get; set; } + /// /// Gets or Sets HasBaleen /// @@ -70,12 +76,6 @@ protected Whale() [DataMember(Name = "hasTeeth", EmitDefaultValue = true)] public bool HasTeeth { get; set; } - /// - /// Gets or Sets ClassName - /// - [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -90,9 +90,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Whale {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -136,12 +136,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); - hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.ClassName != null) { hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); } + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs index 4fb60ed8ddf2..ddb4196e8549 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -63,7 +63,7 @@ public enum TypeEnum /// Gets or Sets Type /// [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + public TypeEnum Type { get; set; } /// /// Initializes a new instance of the class. /// @@ -75,9 +75,9 @@ protected Zebra() /// /// Initializes a new instance of the class. /// - /// type. /// className (required). - public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() + /// type. + public Zebra(string className, TypeEnum type = default) : base() { // to ensure "className" is required (not null) if (className == null) { @@ -109,8 +109,8 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class Zebra {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -154,11 +154,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ClassName != null) { hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); From 52e3265c344f958c74e04056c666b878f603f1b8 Mon Sep 17 00:00:00 2001 From: Laurens-W Date: Tue, 15 Feb 2022 09:31:51 +0100 Subject: [PATCH 065/111] [Java][RestTemplate] Use class level RestTemplate for uri encoding (#11606) * Move static logic to initialization method when no RestTemplate is provided. Otherwise, use the settings from the RestTemplate that was provided. * Move code outside of withXml Run required scripts Co-authored-by: Westerlaken, H.L. (Laurens) --- .../Java/libraries/resttemplate/ApiClient.mustache | 11 +++++------ .../main/java/org/openapitools/client/ApiClient.java | 11 +++++------ .../main/java/org/openapitools/client/ApiClient.java | 11 +++++------ 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index 0b094ccd6a82..6270c6ceb3cd 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -608,12 +608,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return path with placeholders replaced by variables */ public String expandPath(String pathTemplate, Map variables) { - // disable default URL encoding - DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); - uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); - final RestTemplate restTemplate = new RestTemplate(); - restTemplate.setUriTemplateHandler(uriBuilderFactory); - return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); } @@ -788,6 +782,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{/withXml}}{{^withXml}}RestTemplate restTemplate = new RestTemplate();{{/withXml}} // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); + + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); + restTemplate.setUriTemplateHandler(uriBuilderFactory); return restTemplate; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index a26851adcdbf..06309d589f67 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -568,12 +568,6 @@ protected Object selectBody(Object obj, MultiValueMap formParams * @return path with placeholders replaced by variables */ public String expandPath(String pathTemplate, Map variables) { - // disable default URL encoding - DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); - uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); - final RestTemplate restTemplate = new RestTemplate(); - restTemplate.setUriTemplateHandler(uriBuilderFactory); - return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); } @@ -746,6 +740,11 @@ protected RestTemplate buildRestTemplate() { // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); + + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); + restTemplate.setUriTemplateHandler(uriBuilderFactory); return restTemplate; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index efc2083f2d33..97f686f6cfdb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -563,12 +563,6 @@ protected Object selectBody(Object obj, MultiValueMap formParams * @return path with placeholders replaced by variables */ public String expandPath(String pathTemplate, Map variables) { - // disable default URL encoding - DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); - uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); - final RestTemplate restTemplate = new RestTemplate(); - restTemplate.setUriTemplateHandler(uriBuilderFactory); - return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); } @@ -733,6 +727,11 @@ protected RestTemplate buildRestTemplate() { RestTemplate restTemplate = new RestTemplate(); // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); + + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); + restTemplate.setUriTemplateHandler(uriBuilderFactory); return restTemplate; } From 878f6e5709e20f496f04cc4184ef7cf715e9c61f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 15 Feb 2022 16:32:48 +0800 Subject: [PATCH 066/111] [General] Better code format (#11612) * better code format in java tests * better code format in java client codegen * better code format in java model tests * better code format in abstract java codegen * better code format in codegen parameter, property * better code format in codegen response * better code format in codegen model * better code format in default generator * better code format in default codegen * update codegen model --- .../openapitools/codegen/CodegenModel.java | 106 +++++++++++------ .../codegen/CodegenParameter.java | 108 ++++++++++++------ .../openapitools/codegen/CodegenProperty.java | 102 +++++++++++------ .../openapitools/codegen/CodegenResponse.java | 100 +++++++++++----- .../openapitools/codegen/DefaultCodegen.java | 106 +++++++++-------- .../codegen/DefaultGenerator.java | 57 ++++----- .../languages/AbstractJavaCodegen.java | 70 ++++++------ .../codegen/languages/JavaClientCodegen.java | 14 +-- .../codegen/java/AbstractJavaCodegenTest.java | 32 +++--- .../codegen/java/JavaModelTest.java | 32 +++--- 10 files changed, 448 insertions(+), 279 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index 7403002e2d49..25f53be09fb8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.ExternalDocumentation; import java.util.*; + import org.apache.commons.lang3.StringUtils; /** @@ -575,90 +576,114 @@ public void setItems(CodegenProperty items) { } @Override - public boolean getIsModel() { return isModel; } + public boolean getIsModel() { + return isModel; + } @Override - public void setIsModel(boolean isModel) { + public void setIsModel(boolean isModel) { this.isModel = isModel; } @Override - public boolean getIsDate() { return isDate; } + public boolean getIsDate() { + return isDate; + } @Override - public void setIsDate(boolean isDate) { + public void setIsDate(boolean isDate) { this.isDate = isDate; } @Override - public boolean getIsDateTime() { return isDateTime; } + public boolean getIsDateTime() { + return isDateTime; + } @Override - public void setIsDateTime(boolean isDateTime) { + public void setIsDateTime(boolean isDateTime) { this.isDateTime = isDateTime; } @Override - public boolean getIsMap() { return isMap; } + public boolean getIsMap() { + return isMap; + } @Override - public void setIsMap(boolean isMap) { + public void setIsMap(boolean isMap) { this.isMap = isMap; } @Override - public boolean getIsArray() { return isArray; } + public boolean getIsArray() { + return isArray; + } @Override - public void setIsArray(boolean isArray) { + public void setIsArray(boolean isArray) { this.isArray = isArray; } @Override - public boolean getIsShort() { return isShort; } + public boolean getIsShort() { + return isShort; + } @Override - public void setIsShort(boolean isShort) { + public void setIsShort(boolean isShort) { this.isShort = isShort; } @Override - public boolean getIsBoolean() { return isBoolean; } + public boolean getIsBoolean() { + return isBoolean; + } @Override - public void setIsBoolean(boolean isBoolean) { - this.isBoolean= isBoolean; + public void setIsBoolean(boolean isBoolean) { + this.isBoolean = isBoolean; } @Override - public boolean getIsUnboundedInteger() { return isUnboundedInteger; } + public boolean getIsUnboundedInteger() { + return isUnboundedInteger; + } @Override - public void setIsUnboundedInteger(boolean isUnboundedInteger) { + public void setIsUnboundedInteger(boolean isUnboundedInteger) { this.isUnboundedInteger = isUnboundedInteger; } @Override - public boolean getIsPrimitiveType() { return isPrimitiveType; } + public boolean getIsPrimitiveType() { + return isPrimitiveType; + } @Override - public void setIsPrimitiveType(boolean isPrimitiveType) { + public void setIsPrimitiveType(boolean isPrimitiveType) { this.isPrimitiveType = isPrimitiveType; } @Override - public CodegenProperty getAdditionalProperties() { return additionalProperties; } + public CodegenProperty getAdditionalProperties() { + return additionalProperties; + } @Override - public void setAdditionalProperties(CodegenProperty additionalProperties) { + public void setAdditionalProperties(CodegenProperty additionalProperties) { this.additionalProperties = additionalProperties; } @Override - public boolean getHasValidation() { return hasValidation; } + public boolean getHasValidation() { + return hasValidation; + } @Override - public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; } + public void setHasValidation(boolean hasValidation) { + this.hasValidation = hasValidation; + } public List getReadOnlyVars() { return readOnlyVars; @@ -785,7 +810,11 @@ public void setHasRequired(boolean hasRequired) { } @Override - public boolean getHasDiscriminatorWithNonEmptyMapping() { return hasDiscriminatorWithNonEmptyMapping; }; + public boolean getHasDiscriminatorWithNonEmptyMapping() { + return hasDiscriminatorWithNonEmptyMapping; + } + + ; @Override public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { @@ -793,26 +822,32 @@ public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithN } @Override - public boolean getIsString() { return isString; } + public boolean getIsString() { + return isString; + } @Override - public void setIsString(boolean isString) { + public void setIsString(boolean isString) { this.isString = isString; } @Override - public boolean getIsNumber() { return isNumber; } + public boolean getIsNumber() { + return isNumber; + } @Override - public void setIsNumber(boolean isNumber) { + public void setIsNumber(boolean isNumber) { this.isNumber = isNumber; } @Override - public boolean getIsAnyType() { return isAnyType; } + public boolean getIsAnyType() { + return isAnyType; + } @Override - public void setIsAnyType(boolean isAnyType) { + public void setIsAnyType(boolean isAnyType) { this.isAnyType = isAnyType; } @@ -827,10 +862,14 @@ public CodegenComposedSchemas getComposedSchemas() { } @Override - public boolean getHasMultipleTypes() {return hasMultipleTypes; } + public boolean getHasMultipleTypes() { + return hasMultipleTypes; + } @Override - public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; } + public void setHasMultipleTypes(boolean hasMultipleTypes) { + this.hasMultipleTypes = hasMultipleTypes; + } @Override public boolean equals(Object o) { @@ -1043,7 +1082,7 @@ public String toString() { return sb.toString(); } - public void addDiscriminatorMappedModelsImports(){ + public void addDiscriminatorMappedModelsImports() { if (discriminator == null || discriminator.getMappedModels() == null) { return; } @@ -1065,6 +1104,7 @@ public void setEmptyVars(boolean emptyVars) { public boolean getHasItems() { return this.items != null; } + /** * Remove duplicated properties in all variable list */ diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index 8a848eaf9ac1..74d7a2b9ad6b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -560,82 +560,102 @@ public void setItems(CodegenProperty items) { } @Override - public boolean getIsModel() { return isModel; } + public boolean getIsModel() { + return isModel; + } @Override - public void setIsModel(boolean isModel) { + public void setIsModel(boolean isModel) { this.isModel = isModel; } @Override - public boolean getIsDate() { return isDate; } + public boolean getIsDate() { + return isDate; + } @Override - public void setIsDate(boolean isDate) { + public void setIsDate(boolean isDate) { this.isDate = isDate; } @Override - public boolean getIsDateTime() { return isDateTime; } + public boolean getIsDateTime() { + return isDateTime; + } @Override - public void setIsDateTime(boolean isDateTime) { + public void setIsDateTime(boolean isDateTime) { this.isDateTime = isDateTime; } @Override - public boolean getIsMap() { return isMap; } + public boolean getIsMap() { + return isMap; + } @Override - public void setIsMap(boolean isMap) { + public void setIsMap(boolean isMap) { this.isMap = isMap; } @Override - public boolean getIsArray() { return isArray; } + public boolean getIsArray() { + return isArray; + } @Override - public void setIsArray(boolean isArray) { + public void setIsArray(boolean isArray) { this.isArray = isArray; } @Override - public boolean getIsShort() { return isShort; } + public boolean getIsShort() { + return isShort; + } @Override - public void setIsShort(boolean isShort) { + public void setIsShort(boolean isShort) { this.isShort = isShort; } @Override - public boolean getIsBoolean() { return isBoolean; } + public boolean getIsBoolean() { + return isBoolean; + } @Override - public void setIsBoolean(boolean isBoolean) { + public void setIsBoolean(boolean isBoolean) { this.isBoolean = isBoolean; } @Override - public boolean getIsUnboundedInteger() { return isUnboundedInteger; } + public boolean getIsUnboundedInteger() { + return isUnboundedInteger; + } @Override - public void setIsUnboundedInteger(boolean isUnboundedInteger) { + public void setIsUnboundedInteger(boolean isUnboundedInteger) { this.isUnboundedInteger = isUnboundedInteger; } @Override - public boolean getIsPrimitiveType() { return isPrimitiveType; } + public boolean getIsPrimitiveType() { + return isPrimitiveType; + } @Override - public void setIsPrimitiveType(boolean isPrimitiveType) { + public void setIsPrimitiveType(boolean isPrimitiveType) { this.isPrimitiveType = isPrimitiveType; } @Override - public CodegenProperty getAdditionalProperties() { return additionalProperties; } + public CodegenProperty getAdditionalProperties() { + return additionalProperties; + } @Override - public void setAdditionalProperties(CodegenProperty additionalProperties) { + public void setAdditionalProperties(CodegenProperty additionalProperties) { this.additionalProperties = additionalProperties; } @@ -670,10 +690,14 @@ public void setIsNull(boolean isNull) { } @Override - public boolean getHasValidation() { return hasValidation; } + public boolean getHasValidation() { + return hasValidation; + } @Override - public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; } + public void setHasValidation(boolean hasValidation) { + this.hasValidation = hasValidation; + } @Override public boolean getAdditionalPropertiesIsAnyType() { @@ -706,7 +730,11 @@ public void setHasRequired(boolean hasRequired) { } @Override - public boolean getHasDiscriminatorWithNonEmptyMapping() { return hasDiscriminatorWithNonEmptyMapping; }; + public boolean getHasDiscriminatorWithNonEmptyMapping() { + return hasDiscriminatorWithNonEmptyMapping; + } + + ; @Override public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { @@ -714,26 +742,32 @@ public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithN } @Override - public boolean getIsString() { return isString; } + public boolean getIsString() { + return isString; + } @Override - public void setIsString(boolean isString) { + public void setIsString(boolean isString) { this.isString = isString; } @Override - public boolean getIsNumber() { return isNumber; } + public boolean getIsNumber() { + return isNumber; + } @Override - public void setIsNumber(boolean isNumber) { + public void setIsNumber(boolean isNumber) { this.isNumber = isNumber; } @Override - public boolean getIsAnyType() { return isAnyType; } + public boolean getIsAnyType() { + return isAnyType; + } @Override - public void setIsAnyType(boolean isAnyType) { + public void setIsAnyType(boolean isAnyType) { this.isAnyType = isAnyType; } @@ -748,14 +782,22 @@ public CodegenComposedSchemas getComposedSchemas() { } @Override - public boolean getHasMultipleTypes() {return hasMultipleTypes; } + public boolean getHasMultipleTypes() { + return hasMultipleTypes; + } @Override - public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; } + public void setHasMultipleTypes(boolean hasMultipleTypes) { + this.hasMultipleTypes = hasMultipleTypes; + } - public CodegenProperty getSchema() {return schema; } + public CodegenProperty getSchema() { + return schema; + } - public void setSchema(CodegenProperty schema) { this.schema = schema; } + public void setSchema(CodegenProperty schema) { + this.schema = schema; + } public LinkedHashMap getContent() { return content; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java index 8c1bdeb57dca..d184d39b4d27 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java @@ -465,82 +465,102 @@ public void setItems(CodegenProperty items) { } @Override - public CodegenProperty getAdditionalProperties() { return additionalProperties; } + public CodegenProperty getAdditionalProperties() { + return additionalProperties; + } @Override - public void setAdditionalProperties(CodegenProperty additionalProperties) { + public void setAdditionalProperties(CodegenProperty additionalProperties) { this.additionalProperties = additionalProperties; } @Override - public boolean getIsModel() { return isModel; } + public boolean getIsModel() { + return isModel; + } @Override - public void setIsModel(boolean isModel) { + public void setIsModel(boolean isModel) { this.isModel = isModel; } @Override - public boolean getIsDate() { return isDate; } + public boolean getIsDate() { + return isDate; + } @Override - public void setIsDate(boolean isDate) { + public void setIsDate(boolean isDate) { this.isDate = isDate; } @Override - public boolean getIsDateTime() { return isDateTime; } + public boolean getIsDateTime() { + return isDateTime; + } @Override - public void setIsDateTime(boolean isDateTime) { + public void setIsDateTime(boolean isDateTime) { this.isDateTime = isDateTime; } @Override - public boolean getIsMap() { return isMap; } + public boolean getIsMap() { + return isMap; + } @Override - public void setIsMap(boolean isMap) { + public void setIsMap(boolean isMap) { this.isMap = isMap; } @Override - public boolean getIsArray() { return isArray; } + public boolean getIsArray() { + return isArray; + } @Override - public void setIsArray(boolean isArray) { + public void setIsArray(boolean isArray) { this.isArray = isArray; } @Override - public boolean getIsShort() { return isShort; } + public boolean getIsShort() { + return isShort; + } @Override - public void setIsShort(boolean isShort) { + public void setIsShort(boolean isShort) { this.isShort = isShort; } @Override - public boolean getIsBoolean() { return isBoolean; } + public boolean getIsBoolean() { + return isBoolean; + } @Override - public void setIsBoolean(boolean isBoolean) { + public void setIsBoolean(boolean isBoolean) { this.isBoolean = isBoolean; } @Override - public boolean getIsUnboundedInteger() { return isUnboundedInteger; } + public boolean getIsUnboundedInteger() { + return isUnboundedInteger; + } @Override - public void setIsUnboundedInteger(boolean isUnboundedInteger) { + public void setIsUnboundedInteger(boolean isUnboundedInteger) { this.isUnboundedInteger = isUnboundedInteger; } @Override - public boolean getIsPrimitiveType() { return isPrimitiveType; } + public boolean getIsPrimitiveType() { + return isPrimitiveType; + } @Override - public void setIsPrimitiveType(boolean isPrimitiveType) { + public void setIsPrimitiveType(boolean isPrimitiveType) { this.isPrimitiveType = isPrimitiveType; } @@ -743,10 +763,14 @@ public void setIsNull(boolean isNull) { } @Override - public boolean getHasValidation() { return hasValidation; } + public boolean getHasValidation() { + return hasValidation; + } @Override - public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; } + public void setHasValidation(boolean hasValidation) { + this.hasValidation = hasValidation; + } @Override public boolean getAdditionalPropertiesIsAnyType() { @@ -779,7 +803,11 @@ public void setHasRequired(boolean hasRequired) { } @Override - public boolean getHasDiscriminatorWithNonEmptyMapping() { return hasDiscriminatorWithNonEmptyMapping; }; + public boolean getHasDiscriminatorWithNonEmptyMapping() { + return hasDiscriminatorWithNonEmptyMapping; + } + + ; @Override public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { @@ -791,34 +819,44 @@ public boolean getHasItems() { } @Override - public boolean getIsString() { return isString; } + public boolean getIsString() { + return isString; + } @Override - public void setIsString(boolean isString) { + public void setIsString(boolean isString) { this.isString = isString; } @Override - public boolean getIsNumber() { return isNumber; } + public boolean getIsNumber() { + return isNumber; + } @Override - public void setIsNumber(boolean isNumber) { + public void setIsNumber(boolean isNumber) { this.isNumber = isNumber; } @Override - public boolean getIsAnyType() { return isAnyType; } + public boolean getIsAnyType() { + return isAnyType; + } @Override - public void setIsAnyType(boolean isAnyType) { + public void setIsAnyType(boolean isAnyType) { this.isAnyType = isAnyType; } @Override - public boolean getHasMultipleTypes() {return hasMultipleTypes; } + public boolean getHasMultipleTypes() { + return hasMultipleTypes; + } @Override - public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; } + public void setHasMultipleTypes(boolean hasMultipleTypes) { + this.hasMultipleTypes = hasMultipleTypes; + } @Override public String toString() { @@ -972,7 +1010,7 @@ public boolean equals(Object o) { hasDiscriminatorWithNonEmptyMapping == that.hasDiscriminatorWithNonEmptyMapping && getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() && getHasVars() == that.getHasVars() && - getHasRequired() ==that.getHasRequired() && + getHasRequired() == that.getHasRequired() && Objects.equals(composedSchemas, that.composedSchemas) && Objects.equals(openApiType, that.openApiType) && Objects.equals(baseName, that.baseName) && diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index 0f7b111bcabe..f27d5bb13aac 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -337,82 +337,102 @@ public void setItems(CodegenProperty items) { } @Override - public boolean getIsModel() { return isModel; } + public boolean getIsModel() { + return isModel; + } @Override - public boolean getIsArray() { return isArray; } + public boolean getIsArray() { + return isArray; + } @Override - public void setIsArray(boolean isArray) { + public void setIsArray(boolean isArray) { this.isArray = isArray; } @Override - public boolean getIsShort() { return isShort; } + public boolean getIsShort() { + return isShort; + } @Override - public void setIsShort(boolean isShort) { + public void setIsShort(boolean isShort) { this.isShort = isShort; } @Override - public boolean getIsBoolean() { return isBoolean; } + public boolean getIsBoolean() { + return isBoolean; + } @Override - public void setIsBoolean(boolean isBoolean) { + public void setIsBoolean(boolean isBoolean) { this.isBoolean = isBoolean; } @Override - public boolean getIsUnboundedInteger() { return isUnboundedInteger; } + public boolean getIsUnboundedInteger() { + return isUnboundedInteger; + } @Override - public void setIsUnboundedInteger(boolean isUnboundedInteger) { + public void setIsUnboundedInteger(boolean isUnboundedInteger) { this.isUnboundedInteger = isUnboundedInteger; } @Override - public boolean getIsPrimitiveType() { return primitiveType; } + public boolean getIsPrimitiveType() { + return primitiveType; + } @Override - public void setIsPrimitiveType(boolean isPrimitiveType) { + public void setIsPrimitiveType(boolean isPrimitiveType) { this.primitiveType = isPrimitiveType; } @Override - public void setIsModel(boolean isModel) { + public void setIsModel(boolean isModel) { this.isModel = isModel; } @Override - public boolean getIsDate() { return isDate; } + public boolean getIsDate() { + return isDate; + } @Override - public void setIsDate(boolean isDate) { + public void setIsDate(boolean isDate) { this.isDate = isDate; } @Override - public boolean getIsDateTime() { return isDateTime; } + public boolean getIsDateTime() { + return isDateTime; + } @Override - public void setIsDateTime(boolean isDateTime) { + public void setIsDateTime(boolean isDateTime) { this.isDateTime = isDateTime; } @Override - public boolean getIsMap() { return isMap; } + public boolean getIsMap() { + return isMap; + } @Override - public void setIsMap(boolean isMap) { + public void setIsMap(boolean isMap) { this.isMap = isMap; } @Override - public CodegenProperty getAdditionalProperties() { return additionalProperties; } + public CodegenProperty getAdditionalProperties() { + return additionalProperties; + } @Override - public void setAdditionalProperties(CodegenProperty additionalProperties) { + public void setAdditionalProperties(CodegenProperty additionalProperties) { this.additionalProperties = additionalProperties; } @@ -550,10 +570,14 @@ public void setIsNull(boolean isNull) { } @Override - public boolean getHasValidation() { return hasValidation; } + public boolean getHasValidation() { + return hasValidation; + } @Override - public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; } + public void setHasValidation(boolean hasValidation) { + this.hasValidation = hasValidation; + } @Override public boolean getAdditionalPropertiesIsAnyType() { @@ -576,7 +600,11 @@ public void setHasVars(boolean hasVars) { } @Override - public boolean getHasDiscriminatorWithNonEmptyMapping() { return hasDiscriminatorWithNonEmptyMapping; }; + public boolean getHasDiscriminatorWithNonEmptyMapping() { + return hasDiscriminatorWithNonEmptyMapping; + } + + ; @Override public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { @@ -584,26 +612,32 @@ public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithN } @Override - public boolean getIsString() { return isString; } + public boolean getIsString() { + return isString; + } @Override - public void setIsString(boolean isString) { + public void setIsString(boolean isString) { this.isString = isString; } @Override - public boolean getIsNumber() { return isNumber; } + public boolean getIsNumber() { + return isNumber; + } @Override - public void setIsNumber(boolean isNumber) { + public void setIsNumber(boolean isNumber) { this.isNumber = isNumber; } @Override - public boolean getIsAnyType() { return isAnyType; } + public boolean getIsAnyType() { + return isAnyType; + } @Override - public void setIsAnyType(boolean isAnyType) { + public void setIsAnyType(boolean isAnyType) { this.isAnyType = isAnyType; } @@ -618,10 +652,14 @@ public CodegenComposedSchemas getComposedSchemas() { } @Override - public boolean getHasMultipleTypes() {return hasMultipleTypes; } + public boolean getHasMultipleTypes() { + return hasMultipleTypes; + } @Override - public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; } + public void setHasMultipleTypes(boolean hasMultipleTypes) { + this.hasMultipleTypes = hasMultipleTypes; + } @Override public String getBaseType() { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index e5b5908f0c94..ce8b3243795b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -956,8 +956,8 @@ public String escapeText(String input) { // finally escalate characters avoiding code injection return escapeUnsafeCharacters( StringEscapeUtils.unescapeJava( - StringEscapeUtils.escapeJava(input) - .replace("\\/", "/")) + StringEscapeUtils.escapeJava(input) + .replace("\\/", "/")) .replaceAll("[\\t\\n\\r]", " ") .replace("\\", "\\\\") .replace("\"", "\\\"")); @@ -982,8 +982,8 @@ public String escapeTextWhileAllowingNewLines(String input) { // finally escalate characters avoiding code injection return escapeUnsafeCharacters( StringEscapeUtils.unescapeJava( - StringEscapeUtils.escapeJava(input) - .replace("\\/", "/")) + StringEscapeUtils.escapeJava(input) + .replace("\\/", "/")) .replaceAll("[\\t]", " ") .replace("\\", "\\\\") .replace("\"", "\\\"")); @@ -1536,12 +1536,13 @@ public String toModelImport(String name) { /** * Returns the same content as [[toModelImport]] with key the fully-qualified Model name and value the initial input. * In case of union types this method has a key for each separate model and import. + * * @param name the name of the "Model" * @return Map of fully-qualified models. */ @Override - public Map toModelImportMap(String name){ - return Collections.singletonMap(this.toModelImport(name),name); + public Map toModelImportMap(String name) { + return Collections.singletonMap(this.toModelImport(name), name); } /** @@ -1958,7 +1959,7 @@ public String toExampleValue(Schema schema) { /** * Return the default value of the property - * + *

    * Return null if you do NOT want a default value. * Any non-null value will cause {{#defaultValue} check to pass. * @@ -1976,7 +1977,7 @@ public String toDefaultValue(Schema schema) { /** * Return the default value of the parameter - * + *

    * Return null if you do NOT want a default value. * Any non-null value will cause {{#defaultValue} check to pass. * @@ -2401,6 +2402,7 @@ private NamedSchema(String name, Schema s) { this.name = name; this.schema = s; } + private String name; private Schema schema; @@ -2706,7 +2708,7 @@ public CodegenModel fromModel(String name, Schema schema) { m.xmlNamespace = schema.getXml().getNamespace(); m.xmlName = schema.getXml().getName(); } - if (!ModelUtils.isAnyType(schema) && !ModelUtils.isTypeObjectSchema(schema) && !ModelUtils.isArraySchema(schema) && schema.get$ref() == null && schema.getEnum() != null && !schema.getEnum().isEmpty()) { + if (!ModelUtils.isAnyType(schema) && !ModelUtils.isTypeObjectSchema(schema) && !ModelUtils.isArraySchema(schema) && schema.get$ref() == null && schema.getEnum() != null && !schema.getEnum().isEmpty()) { // TODO remove the anyType check here in the future ANyType models can have enums defined m.isEnum = true; // comment out below as allowableValues is not set in post processing model enum @@ -2791,7 +2793,7 @@ public CodegenModel fromModel(String name, Schema schema) { } } - if (m.requiredVars != null && m.requiredVars.size() > 0){ + if (m.requiredVars != null && m.requiredVars.size() > 0) { m.setHasRequired(true); } @@ -2824,7 +2826,7 @@ public int compare(CodegenProperty one, CodegenProperty another) { return m; } - protected void setAddProps(Schema schema, IJsonSchemaValidationProperties property){ + protected void setAddProps(Schema schema, IJsonSchemaValidationProperties property) { if (schema.equals(new Schema())) { // if we are trying to set additionalProperties on an empty schema stop recursing return; @@ -2839,7 +2841,7 @@ protected void setAddProps(Schema schema, IJsonSchemaValidationProperties proper if (schema.getAdditionalProperties() == null) { if (!disallowAdditionalPropertiesIfNotPresent) { isAdditionalPropertiesTrue = true; - addPropProp = fromProperty("", new Schema()); + addPropProp = fromProperty("", new Schema()); additionalPropertiesIsAnyType = true; } } else if (schema.getAdditionalProperties() instanceof Boolean) { @@ -3018,7 +3020,7 @@ private Discriminator recursiveGetDiscriminator(Schema sc, OpenAPI openAPI) { Integer hasDiscriminatorCnt = 0; Integer hasNullTypeCnt = 0; Set discriminatorsPropNames = new HashSet<>(); - for (Schema anyOf : composedSchema.getAnyOf()) { + for (Schema anyOf : composedSchema.getAnyOf()) { if (ModelUtils.isNullType(anyOf)) { // The null type does not have a discriminator. Skip. hasNullTypeCnt++; @@ -3032,7 +3034,7 @@ private Discriminator recursiveGetDiscriminator(Schema sc, OpenAPI openAPI) { } if (discriminatorsPropNames.size() > 1) { LOGGER.warn("The anyOf schemas have conflicting discriminator property names. " + - "anyOf schemas must have the same property name, but found " + String.join(", ", discriminatorsPropNames)); + "anyOf schemas must have the same property name, but found " + String.join(", ", discriminatorsPropNames)); } if (foundDisc != null && (hasDiscriminatorCnt + hasNullTypeCnt) == composedSchema.getAnyOf().size() && discriminatorsPropNames.size() == 1) { disc.setPropertyName(foundDisc.getPropertyName()); @@ -3216,7 +3218,7 @@ protected CodegenDiscriminator createDiscriminator(String schemaName, Schema sch for (MappedModel otherDescendant : otherDescendants) { // add only if the mapping names are not the same boolean matched = false; - for (MappedModel uniqueDescendant: uniqueDescendants) { + for (MappedModel uniqueDescendant : uniqueDescendants) { if (uniqueDescendant.getMappingName().equals(otherDescendant.getMappingName())) { matched = true; break; @@ -3404,7 +3406,7 @@ protected void updatePropertyForString(CodegenProperty property, Schema p) { /** * Convert OAS Property object to Codegen Property object. - * + *

    * The return value is cached. An internal cache is looked up to determine * if the CodegenProperty return value has already been instantiated for * the (String name, Schema p) arguments. @@ -3635,7 +3637,7 @@ public CodegenProperty fromProperty(String name, Schema p) { */ protected void updatePropertyForArray(CodegenProperty property, CodegenProperty innerProperty) { if (innerProperty == null) { - if(LOGGER.isWarnEnabled()) { + if (LOGGER.isWarnEnabled()) { LOGGER.warn("skipping invalid array property {}", Json.pretty(property)); } return; @@ -3670,7 +3672,7 @@ protected void updatePropertyForArray(CodegenProperty property, CodegenProperty */ protected void updatePropertyForMap(CodegenProperty property, CodegenProperty innerProperty) { if (innerProperty == null) { - if(LOGGER.isWarnEnabled()) { + if (LOGGER.isWarnEnabled()) { LOGGER.warn("skipping invalid map property {}", Json.pretty(property)); } return; @@ -3994,7 +3996,7 @@ public CodegenOperation fromOperation(String path, Map headers = response.getHeaders(); if (headers != null) { List responseHeaders = new ArrayList<>(); - for (Entry entry: headers.entrySet()) { + for (Entry entry : headers.entrySet()) { String headerName = entry.getKey(); Header header = entry.getValue(); CodegenParameter responseHeader = heeaderToCodegenParameter(header, headerName, imports, String.format(Locale.ROOT, "%sResponseParameter", r.code)); @@ -4025,7 +4027,7 @@ public CodegenOperation fromOperation(String path, // check if any 4xx or 5xx reponse has an error response object defined if ((Boolean.TRUE.equals(r.is4xx) || Boolean.TRUE.equals(r.is5xx)) && - Boolean.FALSE.equals(r.primitiveType) && Boolean.FALSE.equals(r.simpleType)) { + Boolean.FALSE.equals(r.primitiveType) && Boolean.FALSE.equals(r.simpleType)) { op.hasErrorResponseObject = Boolean.TRUE; } } @@ -4386,7 +4388,7 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { addVarsRequiredVarsAdditionalProps(responseSchema, r); } else if (ModelUtils.isAnyType(responseSchema)) { addVarsRequiredVarsAdditionalProps(responseSchema, r); - } else if (!ModelUtils.isBooleanSchema(responseSchema)){ + } else if (!ModelUtils.isBooleanSchema(responseSchema)) { // referenced schemas LOGGER.debug("Property type is not primitive: {}", cp.dataType); } @@ -4428,13 +4430,13 @@ public CodegenCallback fromCallback(String name, Callback callback, List } Stream.of( - Pair.of("get", pi.getGet()), - Pair.of("head", pi.getHead()), - Pair.of("put", pi.getPut()), - Pair.of("post", pi.getPost()), - Pair.of("delete", pi.getDelete()), - Pair.of("patch", pi.getPatch()), - Pair.of("options", pi.getOptions())) + Pair.of("get", pi.getGet()), + Pair.of("head", pi.getHead()), + Pair.of("put", pi.getPut()), + Pair.of("post", pi.getPost()), + Pair.of("delete", pi.getDelete()), + Pair.of("patch", pi.getPatch()), + Pair.of("options", pi.getOptions())) .filter(p -> p.getValue() != null) .forEach(p -> { String method = p.getKey(); @@ -4498,7 +4500,7 @@ private void updateParameterForMap(CodegenParameter codegenParameter, Schema par } } - protected void updateParameterForString(CodegenParameter codegenParameter, Schema parameterSchema){ + protected void updateParameterForString(CodegenParameter codegenParameter, Schema parameterSchema) { if (ModelUtils.isEmailSchema(parameterSchema)) { codegenParameter.isEmail = true; } else if (ModelUtils.isUUIDSchema(parameterSchema)) { @@ -4752,7 +4754,7 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) codegenParameter.items = fromProperty(codegenParameter.paramName, schema); // TODO Check why schema is actually null for a schema of type object defined inline // https://swagger.io/docs/specification/serialization/ - if(schema != null) { + if (schema != null) { Map> properties = schema.getProperties(); codegenParameter.items.vars = properties.entrySet().stream() @@ -4761,8 +4763,7 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) property.baseName = codegenParameter.baseName + "[" + entry.getKey() + "]"; return property; }).collect(Collectors.toList()); - } - else { + } else { LOGGER.warn( "No object schema found for deepObject parameter{} deepObject won't have specific properties", codegenParameter); @@ -5082,15 +5083,15 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera * of the 'additionalProperties' keyword. Some language generator use class inheritance * to implement additional properties. For example, in Java the generated model class * has 'extends HashMap' to represent the additional properties. - * + *

    * TODO: it's not a good idea to use single class inheritance to implement * additionalProperties. That may work for non-composed schemas, but that does not * work for composed 'allOf' schemas. For example, in Java, if additionalProperties * is set to true (which it should be by default, per OAS spec), then the generated * code has extends HashMap. That wouldn't work for composed 'allOf' schemas. * - * @param model the codegen representation of the OAS schema. - * @param name the name of the model. + * @param model the codegen representation of the OAS schema. + * @param name the name of the model. * @param schema the input OAS schema. */ protected void addParentContainer(CodegenModel model, String name, Schema schema) { @@ -5175,7 +5176,7 @@ protected Map unaliasPropertySchema(Map properti } protected void addVars(CodegenModel m, Map properties, List required, - Map allProperties, List allRequired) { + Map allProperties, List allRequired) { m.hasRequired = false; if (properties != null && !properties.isEmpty()) { @@ -5289,7 +5290,7 @@ protected void addVars(IJsonSchemaValidationProperties m, List * This includes a flat property type (e.g. property type: ReferencedModel) * as well as container type (property type: array of ReferencedModel's) * - * @param model The codegen representation of the OAS schema. + * @param model The codegen representation of the OAS schema. * @param property The codegen representation of the OAS schema's property. */ protected void addImportsForPropertyType(CodegenModel model, CodegenProperty property) { @@ -5505,6 +5506,7 @@ public String getLibrary() { /** * check if current active library equals to passed + * * @param library - library to be compared with * @return {@code true} if passed library is active, {@code false} otherwise */ @@ -6685,7 +6687,7 @@ protected void updateRequestBodyForString(CodegenParameter codegenParameter, Sch } protected String toMediaTypeSchemaName(String contentType, String mediaTypeSchemaSuffix) { - return "SchemaFor" + mediaTypeSchemaSuffix + toModelName(contentType); + return "SchemaFor" + mediaTypeSchemaSuffix + toModelName(contentType); } private CodegenParameter heeaderToCodegenParameter(Header header, String headerName, Set imports, String mediaTypeSchemaSuffix) { @@ -6718,18 +6720,18 @@ protected LinkedHashMap getContent(Content content, Se return null; } LinkedHashMap cmtContent = new LinkedHashMap<>(); - for (Entry contentEntry: content.entrySet()) { + for (Entry contentEntry : content.entrySet()) { MediaType mt = contentEntry.getValue(); LinkedHashMap ceMap = null; - if (mt.getEncoding() != null ) { + if (mt.getEncoding() != null) { ceMap = new LinkedHashMap<>(); Map encMap = mt.getEncoding(); - for (Entry encodingEntry: encMap.entrySet()) { + for (Entry encodingEntry : encMap.entrySet()) { Encoding enc = encodingEntry.getValue(); List headers = new ArrayList<>(); if (enc.getHeaders() != null) { Map encHeaders = enc.getHeaders(); - for (Entry headerEntry: encHeaders.entrySet()) { + for (Entry headerEntry : encHeaders.entrySet()) { String headerName = headerEntry.getKey(); Header header = ModelUtils.getReferencedHeader(this.openAPI, headerEntry.getValue()); CodegenParameter param = heeaderToCodegenParameter(header, headerName, imports, mediaTypeSchemaSuffix); @@ -6852,7 +6854,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S return codegenParameter; } - protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property){ + protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property) { setAddProps(schema, property); if (!"object".equals(schema.getType())) { return; @@ -6994,7 +6996,7 @@ public List fromServerVariables(Map * The additionalProperties keyword is used to control the handling of additional, undeclared * properties, that is, properties whose names are not listed in the properties keyword. * The additionalProperties keyword may be either a boolean or an object. @@ -7314,7 +7316,7 @@ protected boolean isFreeFormObject(Schema schema) { * * @param schema the input schema that may or may not have the additionalProperties keyword. * @return the Schema of the additionalProperties. The null value is returned if no additional - * properties are allowed. + * properties are allowed. */ protected Schema getAdditionalProperties(Schema schema) { return ModelUtils.getAdditionalProperties(openAPI, schema); @@ -7376,7 +7378,7 @@ private List getComposedProperties(List xOfCollection, } List xOf = new ArrayList<>(); int i = 0; - for (Schema xOfSchema: xOfCollection) { + for (Schema xOfSchema : xOfCollection) { CodegenProperty cp = fromProperty(collectionName + "_" + i, xOfSchema); xOf.add(cp); i += 1; @@ -7390,8 +7392,14 @@ public String defaultTemplatingEngine() { } @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVA; } + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.JAVA; + } @Override - public String generatorLanguageVersion() { return null; }; + public String generatorLanguageVersion() { + return null; + } + + ; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index aaa30709e109..b316b55ef9d8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -115,7 +115,7 @@ public Generator opts(ClientOptInput opts) { this.userDefinedTemplates = Collections.unmodifiableList(userFiles); } - TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.config.isEnableMinimalUpdate(),this.config.isSkipOverwrite()); + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.config.isEnableMinimalUpdate(), this.config.isSkipOverwrite()); if (this.dryRun) { this.templateProcessor = new DryRunTemplateManager(templateManagerOptions); @@ -459,7 +459,7 @@ void generateModels(List files, List allModels, List unuse // this use case arises when using interface schemas // generators may choose to make models for use case 2 + 3 Schema refSchema = new Schema(); - refSchema.set$ref("#/components/schemas/"+name); + refSchema.set$ref("#/components/schemas/" + name); Schema unaliasedSchema = config.unaliasSchema(refSchema, config.importMapping()); if (unaliasedSchema.get$ref() == null) { LOGGER.info("Model {} not generated since it's a free-form object", name); @@ -510,7 +510,7 @@ void generateModels(List files, List allModels, List unuse Map modelTemplate = (Map) modelList.get(0); if (modelTemplate != null && modelTemplate.containsKey("model")) { CodegenModel m = (CodegenModel) modelTemplate.get("model"); - if (m.isAlias && !((config instanceof PythonClientCodegen) || (config instanceof PythonExperimentalClientCodegen))) { + if (m.isAlias && !((config instanceof PythonClientCodegen) || (config instanceof PythonExperimentalClientCodegen))) { // alias to number, string, enum, etc, which should not be generated as model // for PythonClientCodegen, all aliases are generated as models continue; // Don't create user-defined classes for aliases @@ -692,7 +692,7 @@ private void generateSupportingFiles(List files, Map bundl } File of = new File(outputFolder); if (!of.isDirectory()) { - if(!dryRun && !of.mkdirs()) { + if (!dryRun && !of.mkdirs()) { once(LOGGER).debug("Output directory {} not created. It {}.", outputFolder, of.exists() ? "already exists." : "may not have appropriate permissions."); } } @@ -806,14 +806,14 @@ Map buildSupportFileBundle(List allOperations, List * Examples: - *

    + *

    * boolean hasOAuthMethods *

    * List<CodegenSecurity> oauthMethods * * @param bundle the map which the booleans and collections will be added */ - void addAuthenticationSwitches(Map bundle){ + void addAuthenticationSwitches(Map bundle) { Map securitySchemeMap = openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null; List authMethods = config.fromSecurity(securitySchemeMap); if (authMethods != null && !authMethods.isEmpty()) { @@ -894,7 +894,7 @@ public List generate() { Map bundle = buildSupportFileBundle(allOperations, allModels); generateSupportingFiles(files, bundle); - if(dryRun) { + if (dryRun) { boolean verbose = Boolean.parseBoolean(GlobalSettings.getProperty("verbose")); StringBuilder sb = new StringBuilder(); @@ -911,9 +911,9 @@ public List generate() { sb.append(System.lineSeparator()); if (verbose) { sb.append(" ") - .append(StringUtils.rightPad(status.getState().getDescription(), 20, ".")) - .append(" ").append(status.getReason()) - .append(System.lineSeparator()); + .append(StringUtils.rightPad(status.getState().getDescription(), 20, ".")) + .append(" ").append(status.getReason()) + .append(System.lineSeparator()); } } catch (IOException e) { LOGGER.debug("Unable to document dry run status for {}.", entry.getKey()); @@ -1031,7 +1031,7 @@ private File processTemplateToFile(Map templateData, String temp if (!absoluteTarget.startsWith(outDir)) { throw new RuntimeException(String.format(Locale.ROOT, "Target files must be generated within the output directory; absoluteTarget=%s outDir=%s", absoluteTarget, outDir)); } - return this.templateProcessor.write(templateData,templateName, target); + return this.templateProcessor.write(templateData, templateName, target); } else { this.templateProcessor.skip(target.toPath(), String.format(Locale.ROOT, "Skipped by %s options supplied by user.", skippedByOption)); return null; @@ -1045,7 +1045,7 @@ private File processTemplateToFile(Map templateData, String temp public Map> processPaths(Paths paths) { Map> ops = new TreeMap<>(); // when input file is not valid and doesn't contain any paths - if(paths == null) { + if (paths == null) { return ops; } for (Map.Entry pathsEntry : paths.entrySet()) { @@ -1198,7 +1198,7 @@ private Map processOperations(CodegenConfig config, String tag, allImports.addAll(op.imports); } - Map mappings = getAllImportsMappings(allImports); + Map mappings = getAllImportsMappings(allImports); Set> imports = toImportsObjects(mappings); //Some codegen implementations rely on a list interface for the imports @@ -1215,16 +1215,17 @@ private Map processOperations(CodegenConfig config, String tag, /** * Transforms a set of imports to a map with key config.toModelImport(import) and value the import string. + * * @param allImports - Set of imports * @return Map of fully qualified import path and initial import. */ - private Map getAllImportsMappings(Set allImports){ - Map result = new HashMap<>(); - allImports.forEach(nextImport->{ + private Map getAllImportsMappings(Set allImports) { + Map result = new HashMap<>(); + allImports.forEach(nextImport -> { String mapping = config.importMapping().get(nextImport); - if(mapping!= null){ - result.put(mapping,nextImport); - }else{ + if (mapping != null) { + result.put(mapping, nextImport); + } else { result.putAll(config.toModelImportMap(nextImport)); } }); @@ -1238,23 +1239,23 @@ private Map getAllImportsMappings(Set allImports){ * @param mappedImports Map of fully qualified import and import * @return The set of unique imports */ - private Set> toImportsObjects(Map mappedImports){ - Set> result = new TreeSet>( - (Comparator>) (o1, o2) -> { - String s1 = o1.get("classname"); - String s2 = o2.get("classname"); - return s1.compareTo(s2); - } + private Set> toImportsObjects(Map mappedImports) { + Set> result = new TreeSet>( + (Comparator>) (o1, o2) -> { + String s1 = o1.get("classname"); + String s2 = o2.get("classname"); + return s1.compareTo(s2); + } ); - mappedImports.entrySet().forEach(mapping->{ + mappedImports.entrySet().forEach(mapping -> { Map im = new LinkedHashMap<>(); im.put("import", mapping.getKey()); im.put("classname", mapping.getValue()); result.add(im); }); return result; - } + } private Map processModels(CodegenConfig config, Map definitions) { Map objs = new HashMap<>(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index a99db97e96af..7ab48af34a90 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -50,7 +50,7 @@ import static org.openapitools.codegen.utils.StringUtils.*; public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig, - DocumentationProviderFeatures { + DocumentationProviderFeatures { private final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class); private static final String ARTIFACT_VERSION_DEFAULT_VALUE = "1.0.0"; @@ -172,14 +172,14 @@ public AbstractJavaCodegen() { ); languageSpecificPrimitives = Sets.newHashSet("String", - "boolean", - "Boolean", - "Double", - "Integer", - "Long", - "Float", - "Object", - "byte[]" + "boolean", + "Boolean", + "Double", + "Integer", + "Long", + "Float", + "Object", + "byte[]" ); instantiationTypes.put("array", "ArrayList"); instantiationTypes.put("set", "LinkedHashSet"); @@ -260,17 +260,17 @@ public AbstractJavaCodegen() { if (null != defaultDocumentationProvider()) { CliOption documentationProviderCliOption = new CliOption(DOCUMENTATION_PROVIDER, - "Select the OpenAPI documentation provider.") - .defaultValue(defaultDocumentationProvider().toCliOptValue()); + "Select the OpenAPI documentation provider.") + .defaultValue(defaultDocumentationProvider().toCliOptValue()); supportedDocumentationProvider().forEach(dp -> - documentationProviderCliOption.addEnum(dp.toCliOptValue(), dp.getDescription())); + documentationProviderCliOption.addEnum(dp.toCliOptValue(), dp.getDescription())); cliOptions.add(documentationProviderCliOption); CliOption annotationLibraryCliOption = new CliOption(ANNOTATION_LIBRARY, - "Select the complementary documentation annotation library.") - .defaultValue(defaultDocumentationProvider().getPreferredAnnotationLibrary().toCliOptValue()); + "Select the complementary documentation annotation library.") + .defaultValue(defaultDocumentationProvider().getPreferredAnnotationLibrary().toCliOptValue()); supportedAnnotationLibraries().forEach(al -> - annotationLibraryCliOption.addEnum(al.toCliOptValue(), al.getDescription())); + annotationLibraryCliOption.addEnum(al.toCliOptValue(), al.getDescription())); cliOptions.add(annotationLibraryCliOption); } } @@ -279,34 +279,34 @@ public AbstractJavaCodegen() { public void processOpts() { super.processOpts(); - if (null != defaultDocumentationProvider()) { + if (null != defaultDocumentationProvider()) { documentationProvider = DocumentationProvider.ofCliOption( - (String)additionalProperties.getOrDefault(DOCUMENTATION_PROVIDER, - defaultDocumentationProvider().toCliOptValue()) + (String) additionalProperties.getOrDefault(DOCUMENTATION_PROVIDER, + defaultDocumentationProvider().toCliOptValue()) ); - if (! supportedDocumentationProvider().contains(documentationProvider)) { + if (!supportedDocumentationProvider().contains(documentationProvider)) { String msg = String.format(Locale.ROOT, - "The [%s] Documentation Provider is not supported by this generator", - documentationProvider.toCliOptValue()); + "The [%s] Documentation Provider is not supported by this generator", + documentationProvider.toCliOptValue()); throw new IllegalArgumentException(msg); } annotationLibrary = AnnotationLibrary.ofCliOption( - (String) additionalProperties.getOrDefault(ANNOTATION_LIBRARY, - documentationProvider.getPreferredAnnotationLibrary().toCliOptValue()) + (String) additionalProperties.getOrDefault(ANNOTATION_LIBRARY, + documentationProvider.getPreferredAnnotationLibrary().toCliOptValue()) ); - if (! supportedAnnotationLibraries().contains(annotationLibrary)) { + if (!supportedAnnotationLibraries().contains(annotationLibrary)) { String msg = String.format(Locale.ROOT, "The Annotation Library [%s] is not supported by this generator", - annotationLibrary.toCliOptValue()); + annotationLibrary.toCliOptValue()); throw new IllegalArgumentException(msg); } - if (! documentationProvider.supportedAnnotationLibraries().contains(annotationLibrary)) { + if (!documentationProvider.supportedAnnotationLibraries().contains(annotationLibrary)) { String msg = String.format(Locale.ROOT, - "The [%s] documentation provider does not support [%s] as complementary annotation library", - documentationProvider.toCliOptValue(), annotationLibrary.toCliOptValue()); + "The [%s] documentation provider does not support [%s] as complementary annotation library", + documentationProvider.toCliOptValue(), annotationLibrary.toCliOptValue()); throw new IllegalArgumentException(msg); } @@ -946,8 +946,8 @@ public String toDefaultValue(Schema schema) { } else if (schema.getDefault() instanceof java.time.OffsetDateTime) { if ("java8".equals(getDateLibrary())) { return String.format(Locale.ROOT, "OffsetDateTime.parse(\"%s\", %s)", - ((java.time.OffsetDateTime) schema.getDefault()).atZoneSameInstant(ZoneId.systemDefault()), - "java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault())"); + ((java.time.OffsetDateTime) schema.getDefault()).atZoneSameInstant(ZoneId.systemDefault()), + "java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault())"); } else { return null; } @@ -984,7 +984,7 @@ public String toDefaultParameterValue(final Schema schema) { if (defaultValue == null) { return null; } - if (defaultValue instanceof Date) { + if (defaultValue instanceof Date) { Date date = (Date) schema.getDefault(); LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); return localDate.toString(); @@ -1403,10 +1403,10 @@ public void preprocessOpenAPI(OpenAPI openAPI) { // - ENUM_A // - ENUM_B Stream.concat( - Stream.of(openAPI.getComponents().getSchemas()), - openAPI.getComponents().getSchemas().values().stream() - .filter(schema -> schema.getProperties() != null) - .map(Schema::getProperties)) + Stream.of(openAPI.getComponents().getSchemas()), + openAPI.getComponents().getSchemas().values().stream() + .filter(schema -> schema.getProperties() != null) + .map(Schema::getProperties)) .forEach(schemas -> schemas.replaceAll( (name, s) -> Stream.of(s) .filter(schema -> schema instanceof ComposedSchema) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index b0251259d7f2..9309415635ad 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -63,9 +63,9 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles"; public static final String DYNAMIC_OPERATIONS = "dynamicOperations"; public static final String SUPPORT_STREAMING = "supportStreaming"; - public static final String GRADLE_PROPERTIES= "gradleProperties"; - public static final String ERROR_OBJECT_TYPE= "errorObjectType"; - public static final String ERROR_OBJECT_SUBTYPE= "errorObjectSubtype"; + public static final String GRADLE_PROPERTIES = "gradleProperties"; + public static final String ERROR_OBJECT_TYPE = "errorObjectType"; + public static final String ERROR_OBJECT_SUBTYPE = "errorObjectSubtype"; public static final String MICROPROFILE_DEFAULT = "default"; public static final String MICROPROFILE_KUMULUZEE = "kumuluzee"; @@ -329,7 +329,7 @@ public void processOpts() { additionalProperties.put(ERROR_OBJECT_TYPE, errorObjectType); if (additionalProperties.containsKey(ERROR_OBJECT_SUBTYPE)) { - this.setErrorObjectSubtype((List)additionalProperties.get(ERROR_OBJECT_SUBTYPE)); + this.setErrorObjectSubtype((List) additionalProperties.get(ERROR_OBJECT_SUBTYPE)); } additionalProperties.put(ERROR_OBJECT_SUBTYPE, errorObjectSubtype); @@ -979,15 +979,15 @@ public void setSupportStreaming(final boolean supportStreaming) { } public void setGradleProperties(final String gradleProperties) { - this.gradleProperties= gradleProperties; + this.gradleProperties = gradleProperties; } public void setErrorObjectType(final String errorObjectType) { - this.errorObjectType= errorObjectType; + this.errorObjectType = errorObjectType; } public void setErrorObjectSubtype(final List errorObjectSubtype) { - this.errorObjectSubtype= errorObjectSubtype; + this.errorObjectSubtype = errorObjectSubtype; } /** diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java index 38a46722e506..d3e45b52fcf2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java @@ -20,10 +20,12 @@ import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.*; + import java.time.OffsetDateTime; import java.time.ZonedDateTime; import java.util.HashSet; import java.util.Set; + import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenParameter; @@ -214,7 +216,7 @@ public void testAdditionalModelTypeAnnotationsSemiColon() throws Exception { final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo;@Bar"); - + codegen.processOpts(); codegen.preprocessOpenAPI(openAPI); @@ -229,14 +231,14 @@ public void testAdditionalModelTypeAnnotationsSemiColon() throws Exception { Collections.sort(sortedAdditionalModelTypeAnnotations); Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); } - + @Test public void testAdditionalModelTypeAnnotationsNewLineLinux() throws Exception { OpenAPI openAPI = TestUtils.createOpenAPI(); final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo\n@Bar"); - + codegen.processOpts(); codegen.preprocessOpenAPI(openAPI); @@ -251,14 +253,14 @@ public void testAdditionalModelTypeAnnotationsNewLineLinux() throws Exception { Collections.sort(sortedAdditionalModelTypeAnnotations); Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); } - + @Test public void testAdditionalModelTypeAnnotationsNewLineWindows() throws Exception { OpenAPI openAPI = TestUtils.createOpenAPI(); final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo\r\n@Bar"); - + codegen.processOpts(); codegen.preprocessOpenAPI(openAPI); @@ -273,17 +275,17 @@ public void testAdditionalModelTypeAnnotationsNewLineWindows() throws Exception Collections.sort(sortedAdditionalModelTypeAnnotations); Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); } - + @Test public void testAdditionalModelTypeAnnotationsMixed() throws Exception { OpenAPI openAPI = TestUtils.createOpenAPI(); final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, " \t @Foo;\r\n@Bar ;\n @Foobar "); - + codegen.processOpts(); codegen.preprocessOpenAPI(openAPI); - + final List additionalModelTypeAnnotations = new ArrayList(); additionalModelTypeAnnotations.add("@Foo"); additionalModelTypeAnnotations.add("@Bar"); @@ -296,17 +298,17 @@ public void testAdditionalModelTypeAnnotationsMixed() throws Exception { Collections.sort(sortedAdditionalModelTypeAnnotations); Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); } - + @Test public void testAdditionalModelTypeAnnotationsNoDuplicate() throws Exception { OpenAPI openAPI = TestUtils.createOpenAPI(); final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo;@Bar;@Foo"); - + codegen.processOpts(); codegen.preprocessOpenAPI(openAPI); - + final List additionalModelTypeAnnotations = new ArrayList(); additionalModelTypeAnnotations.add("@Foo"); additionalModelTypeAnnotations.add("@Bar"); @@ -318,7 +320,7 @@ public void testAdditionalModelTypeAnnotationsNoDuplicate() throws Exception { Collections.sort(sortedAdditionalModelTypeAnnotations); Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); } - + @Test public void toEnumValue() { final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); @@ -529,7 +531,6 @@ public void usesDefaultVersionWhenAdditionalPropertiesVersionIsNull() { } - @Test(description = "tests if default version with snapshot is used when setArtifactVersion is used") public void snapshotVersionAlreadySnapshotTest() { final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); @@ -543,6 +544,7 @@ public void snapshotVersionAlreadySnapshotTest() { Assert.assertEquals(codegen.getArtifactVersion(), "4.1.2-SNAPSHOT"); } + @Test public void toDefaultValueDateTimeLegacyTest() { final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); @@ -551,7 +553,7 @@ public void toDefaultValueDateTimeLegacyTest() { // Test default value for date format DateSchema dateSchema = new DateSchema(); - LocalDate defaultLocalDate = LocalDate.of(2019,2,15); + LocalDate defaultLocalDate = LocalDate.of(2019, 2, 15); Date date = Date.from(defaultLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); dateSchema.setDefault(date); defaultValue = codegen.toDefaultValue(dateSchema); @@ -607,7 +609,7 @@ public void toDefaultValueTest() { // Test default value for date format DateSchema dateSchema = new DateSchema(); - LocalDate defaultLocalDate = LocalDate.of(2019,2,15); + LocalDate defaultLocalDate = LocalDate.of(2019, 2, 15); Date date = Date.from(defaultLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); dateSchema.setDefault(date); defaultValue = codegen.toDefaultValue(dateSchema); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java index 3828d13d1231..366eecacecc6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java @@ -107,11 +107,11 @@ public void simpleModelTest() { @Test(description = "convert a model with list property") public void listPropertyTest() { final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("urls", new ArraySchema() - .items(new StringSchema())) - .addRequiredItem("id"); + .description("a sample model") + .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) + .addProperties("urls", new ArraySchema() + .items(new StringSchema())) + .addRequiredItem("id"); final DefaultCodegen codegen = new JavaClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); codegen.setOpenAPI(openAPI); @@ -138,12 +138,12 @@ public void listPropertyTest() { @Test(description = "convert a model with set property") public void setPropertyTest() { final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("urls", new ArraySchema() - .items(new StringSchema()) - .uniqueItems(true)) - .addRequiredItem("id"); + .description("a sample model") + .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) + .addProperties("urls", new ArraySchema() + .items(new StringSchema()) + .uniqueItems(true)) + .addRequiredItem("id"); final DefaultCodegen codegen = new JavaClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); codegen.setOpenAPI(openAPI); @@ -406,8 +406,8 @@ public void arrayModelWithItemNameTest() { Assert.assertTrue(property.isContainer); final CodegenProperty itemsProperty = property.items; - Assert.assertEquals(itemsProperty.baseName,"child"); - Assert.assertEquals(itemsProperty.name,"child"); + Assert.assertEquals(itemsProperty.baseName, "child"); + Assert.assertEquals(itemsProperty.name, "child"); } @Test(description = "convert an array model") @@ -745,7 +745,7 @@ public void mapWithAnListOfBigDecimalTest() { @DataProvider(name = "modelNames") public static Object[][] primeNumbers() { - return new Object[][] { + return new Object[][]{ {"sample", "Sample"}, {"sample_name", "SampleName"}, {"sample__name", "SampleName"}, @@ -771,7 +771,7 @@ public void modelNameTest(String name, String expectedName) { @DataProvider(name = "classProperties") public static Object[][] classProperties() { - return new Object[][] { + return new Object[][]{ {"class", "getPropertyClass", "setPropertyClass", "propertyClass"}, {"_class", "getPropertyClass", "setPropertyClass", "propertyClass"}, {"__class", "getPropertyClass", "setPropertyClass", "propertyClass"} @@ -1178,7 +1178,7 @@ public void arraySchemaTestInRequestBody() { @Test(description = "convert an array schema in an ApiResponse") public void arraySchemaTestInOperationResponse() { final Schema testSchema = new ArraySchema() - .items(new Schema<>().$ref("#/components/schemas/Pet")); + .items(new Schema<>().$ref("#/components/schemas/Pet")); Operation operation = new Operation().responses( new ApiResponses().addApiResponse("200", new ApiResponse() .description("Ok response") From 5afec1fec785307ce8a6c4db9a709c3590688dab Mon Sep 17 00:00:00 2001 From: cachescrubber <5127753+cachescrubber@users.noreply.github.com> Date: Wed, 16 Feb 2022 04:06:41 +0100 Subject: [PATCH 067/111] Spring hide controller impl (#11611) * hide implementation behind undocumented flag (_api_controller_impl_) to temporarily preserve code. * Generate Samples --- .../codegen/languages/SpringCodegen.java | 2 + .../JavaSpring/apiController.mustache | 6 +- .../openapitools/api/PetApiController.java | 220 ------------ .../openapitools/api/StoreApiController.java | 97 ------ .../openapitools/api/UserApiController.java | 144 -------- .../api/AnotherFakeApiController.java | 31 -- .../openapitools/api/FakeApiController.java | 323 ------------------ .../api/FakeClassnameTestApiController.java | 31 -- .../openapitools/api/PetApiController.java | 193 ----------- .../openapitools/api/StoreApiController.java | 97 ------ .../openapitools/api/UserApiController.java | 144 -------- .../api/AnotherFakeApiController.java | 21 -- .../openapitools/api/FakeApiController.java | 281 --------------- .../api/FakeClassnameTestApiController.java | 21 -- .../openapitools/api/PetApiController.java | 134 -------- .../openapitools/api/StoreApiController.java | 65 ---- .../openapitools/api/UserApiController.java | 122 ------- .../api/AnotherFakeApiController.java | 31 -- .../openapitools/api/FakeApiController.java | 315 ----------------- .../api/FakeClassnameTestApiController.java | 31 -- .../openapitools/api/PetApiController.java | 191 ----------- .../openapitools/api/StoreApiController.java | 97 ------ .../openapitools/api/UserApiController.java | 144 -------- .../api/AnotherFakeApiController.java | 7 - .../openapitools/api/FakeApiController.java | 7 - .../api/FakeClassnameTestApiController.java | 7 - .../openapitools/api/PetApiController.java | 7 - .../openapitools/api/StoreApiController.java | 7 - .../openapitools/api/UserApiController.java | 7 - .../openapitools/api/PetApiController.java | 213 ------------ .../openapitools/api/StoreApiController.java | 90 ----- .../openapitools/api/UserApiController.java | 137 -------- .../api/AnotherFakeApiController.java | 31 -- .../openapitools/api/FakeApiController.java | 323 ------------------ .../api/FakeClassnameTestApiController.java | 31 -- .../openapitools/api/PetApiController.java | 193 ----------- .../openapitools/api/StoreApiController.java | 97 ------ .../openapitools/api/UserApiController.java | 144 -------- .../openapitools/api/PetApiController.java | 220 ------------ .../openapitools/api/StoreApiController.java | 97 ------ .../openapitools/api/UserApiController.java | 144 -------- .../api/AnotherFakeApiController.java | 25 -- .../openapitools/api/FakeApiController.java | 317 ----------------- .../api/FakeClassnameTestApiController.java | 25 -- .../openapitools/api/PetApiController.java | 187 ---------- .../openapitools/api/StoreApiController.java | 91 ----- .../openapitools/api/UserApiController.java | 138 -------- .../api/AnotherFakeApiController.java | 25 -- .../openapitools/api/FakeApiController.java | 317 ----------------- .../api/FakeClassnameTestApiController.java | 25 -- .../openapitools/api/PetApiController.java | 187 ---------- .../openapitools/api/StoreApiController.java | 91 ----- .../openapitools/api/UserApiController.java | 138 -------- .../api/AnotherFakeApiController.java | 15 - .../openapitools/api/FakeApiController.java | 275 --------------- .../api/FakeClassnameTestApiController.java | 15 - .../openapitools/api/PetApiController.java | 128 ------- .../openapitools/api/StoreApiController.java | 59 ---- .../openapitools/api/UserApiController.java | 116 ------- .../api/AnotherFakeApiController.java | 15 - .../openapitools/api/FakeApiController.java | 275 --------------- .../api/FakeClassnameTestApiController.java | 15 - .../openapitools/api/PetApiController.java | 128 ------- .../openapitools/api/StoreApiController.java | 59 ---- .../openapitools/api/UserApiController.java | 116 ------- .../api/AnotherFakeApiController.java | 25 -- .../openapitools/api/FakeApiController.java | 309 ----------------- .../api/FakeClassnameTestApiController.java | 25 -- .../openapitools/api/PetApiController.java | 185 ---------- .../openapitools/api/StoreApiController.java | 91 ----- .../openapitools/api/UserApiController.java | 138 -------- .../api/AnotherFakeApiController.java | 1 - .../openapitools/api/FakeApiController.java | 1 - .../api/FakeClassnameTestApiController.java | 1 - .../openapitools/api/PetApiController.java | 1 - .../openapitools/api/StoreApiController.java | 1 - .../openapitools/api/UserApiController.java | 1 - .../api/AnotherFakeApiController.java | 15 - .../openapitools/api/FakeApiController.java | 275 --------------- .../api/FakeClassnameTestApiController.java | 15 - .../openapitools/api/PetApiController.java | 130 ------- .../openapitools/api/StoreApiController.java | 59 ---- .../openapitools/api/UserApiController.java | 116 ------- .../api/AnotherFakeApiController.java | 15 - .../openapitools/api/FakeApiController.java | 275 --------------- .../api/FakeClassnameTestApiController.java | 15 - .../openapitools/api/PetApiController.java | 130 ------- .../openapitools/api/StoreApiController.java | 59 ---- .../openapitools/api/UserApiController.java | 116 ------- .../api/AnotherFakeApiController.java | 25 -- .../openapitools/api/FakeApiController.java | 317 ----------------- .../api/FakeClassnameTestApiController.java | 25 -- .../openapitools/api/PetApiController.java | 189 ---------- .../openapitools/api/StoreApiController.java | 91 ----- .../openapitools/api/UserApiController.java | 138 -------- .../api/AnotherFakeApiController.java | 25 -- .../openapitools/api/FakeApiController.java | 317 ----------------- .../api/FakeClassnameTestApiController.java | 25 -- .../openapitools/api/PetApiController.java | 189 ---------- .../openapitools/api/StoreApiController.java | 91 ----- .../openapitools/api/UserApiController.java | 138 -------- .../api/AnotherFakeApiController.java | 25 -- .../openapitools/api/FakeApiController.java | 317 ----------------- .../api/FakeClassnameTestApiController.java | 25 -- .../openapitools/api/PetApiController.java | 187 ---------- .../openapitools/api/StoreApiController.java | 91 ----- .../openapitools/api/UserApiController.java | 138 -------- .../api/AnotherFakeApiController.java | 25 -- .../virtualan/api/FakeApiController.java | 317 ----------------- .../api/FakeClassnameTestApiController.java | 25 -- .../virtualan/api/PetApiController.java | 187 ---------- .../virtualan/api/StoreApiController.java | 91 ----- .../virtualan/api/UserApiController.java | 138 -------- .../api/AnotherFakeApiController.java | 25 -- .../openapitools/api/FakeApiController.java | 317 ----------------- .../api/FakeClassnameTestApiController.java | 25 -- .../openapitools/api/PetApiController.java | 187 ---------- .../openapitools/api/StoreApiController.java | 91 ----- .../openapitools/api/UserApiController.java | 138 -------- 119 files changed, 6 insertions(+), 13197 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 8b1a16e4b972..3230786bca85 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -536,6 +536,8 @@ public void processOpts() { additionalProperties.put("lambdaSplitString", new SplitStringLambda()); + // apiController: hide implementation behind undocumented flag to temporarily preserve code + additionalProperties.put("_api_controller_impl_", false); // HEADS-UP: Do not add more template file after this block if (apiFirst) { apiTemplateFiles.clear(); diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache index babbfd3db810..dc64a84fe9e0 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache @@ -3,6 +3,7 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} +{{#_api_controller_impl_}} {{#swagger2AnnotationLibrary}} import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -15,6 +16,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; {{#swagger1AnnotationLibrary}} import io.swagger.annotations.*; {{/swagger1AnnotationLibrary}} +{{/_api_controller_impl_}} import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -80,7 +82,7 @@ public class {{classname}}Controller implements {{classname}} { {{/reactive}} {{/isDelegate}} -{{^reactive}} +{{#_api_controller_impl_}} {{#operation}} /** * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}} @@ -126,6 +128,6 @@ public class {{classname}}Controller implements {{classname}} { } {{/operation}} -{{/reactive}} +{{/_api_controller_impl_}} } {{/operations}} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java index 9004004154bc..b8fa3720a211 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java @@ -3,13 +3,6 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -51,217 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param pet Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param pet Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java index 3f6c13886b8e..1292dc0b721d 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,13 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -51,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{orderId} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{orderId} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param order order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java index 1835681b83ad..ca00184d2a56 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java @@ -4,13 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param user Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param user List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param user List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param user Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, - @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index ab290864b1d8..c2db7ca5a815 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -50,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index ac3a061983f5..5ae5d5fed985 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,13 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -60,320 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index f1c2fbe3f7e5..65b695629d43 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -50,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index 30a27c715125..ea6c56e02c11 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -4,13 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,190 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index 5de51f6ffb58..1292dc0b721d 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,13 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -51,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index 01cf63fdb40a..ca00184d2a56 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -4,13 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index ce0d27ccdbb0..e27e2fc20ea9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -48,18 +41,4 @@ public AnotherFakeApiDelegate getDelegate() { return delegate; } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.call123testSpecialTags(body); - } - } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 346dc2916cd9..726b17779f18 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,13 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -58,278 +51,4 @@ public FakeApiDelegate getDelegate() { return delegate; } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return delegate.createXmlItem(xmlItem); - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return delegate.fakeOuterBooleanSerialize(body); - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - return delegate.fakeOuterCompositeSerialize(body); - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return delegate.fakeOuterNumberSerialize(body); - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return delegate.fakeOuterStringSerialize(body); - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return delegate.testBodyWithFileSchema(body); - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body - ) { - return delegate.testBodyWithQueryParams(query, body); - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClientModel(body); - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param - ) { - return delegate.testInlineAdditionalProperties(param); - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return delegate.testJsonFormData(param, param2); - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - } - } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 0e14303a807d..21e28fe8b213 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -48,18 +41,4 @@ public FakeClassnameTestApiDelegate getDelegate() { return delegate; } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClassname(body); - } - } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index 959b2583c1fb..5ef3de965ff8 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -4,13 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -50,131 +43,4 @@ public PetApiDelegate getDelegate() { return delegate; } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.addPet(body); - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return delegate.deletePet(petId, apiKey); - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status - ) { - return delegate.findPetsByStatus(status); - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - return delegate.findPetsByTags(tags); - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - return delegate.getPetById(petId); - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.updatePet(body); - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return delegate.updatePetWithForm(petId, name, status); - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - return delegate.uploadFile(petId, additionalMetadata, file); - } - } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java index a6172a2884c6..e9e29a41b4f9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,13 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -49,62 +42,4 @@ public StoreApiDelegate getDelegate() { return delegate; } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return delegate.deleteOrder(orderId); - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return delegate.getInventory(); - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - return delegate.getOrderById(orderId); - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - return delegate.placeOrder(body); - } - } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java index 6e56a081a4d7..1b48d4a9444b 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java @@ -4,13 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -50,119 +43,4 @@ public UserApiDelegate getDelegate() { return delegate; } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body - ) { - return delegate.createUser(body); - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithArrayInput(body); - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithListInput(body); - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return delegate.deleteUser(username); - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - return delegate.getUserByName(username); - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return delegate.loginUser(username, password); - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return delegate.logoutUser(); - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return delegate.updateUser(username, body); - } - } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java index ab290864b1d8..c2db7ca5a815 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -50,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java index b3e329f73f08..5ae5d5fed985 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,13 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -60,312 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index f1c2fbe3f7e5..65b695629d43 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -50,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java index c2e45c7d354e..ea6c56e02c11 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java @@ -4,13 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,188 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java index 5de51f6ffb58..1292dc0b721d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,13 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -51,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java index 01cf63fdb40a..ca00184d2a56 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java @@ -4,13 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 210b073fd6ed..e27e2fc20ea9 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java index d62fbcd43c76..726b17779f18 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,13 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index b3a7f55cdc68..21e28fe8b213 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java index 551620b155f1..5ef3de965ff8 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java @@ -4,13 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java index d993e6da6571..e9e29a41b4f9 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,13 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java index 311695aaa73e..1b48d4a9444b 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java @@ -4,13 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java index ed5520cc3cd6..b8fa3720a211 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java @@ -44,217 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param pet Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @Valid @RequestBody Pet pet - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @PathVariable("petId") Long petId, - @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @Valid @RequestParam(value = "tags", required = true) List tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param pet Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @Valid @RequestBody Pet pet - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @PathVariable("petId") Long petId, - @Valid @RequestPart(value = "name", required = false) String name, - @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @PathVariable("petId") Long petId, - @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java index 2a15afd5268b..1292dc0b721d 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java @@ -44,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{orderId} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @PathVariable("orderId") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{orderId} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @PathVariable("orderId") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param order order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @Valid @RequestBody Order order - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java index 75f0db8aab96..ca00184d2a56 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java @@ -45,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param user Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @Valid @RequestBody User user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param user List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @Valid @RequestBody List user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param user List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @Valid @RequestBody List user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param user Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @PathVariable("username") String username, - @Valid @RequestBody User user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java index ab290864b1d8..c2db7ca5a815 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -50,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java index 83577a8d6ed1..5ae5d5fed985 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,13 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -60,320 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index f1c2fbe3f7e5..65b695629d43 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,13 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -50,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java index b11ab4e29e0d..ea6c56e02c11 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java @@ -4,13 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,190 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) Optional apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java index 5de51f6ffb58..1292dc0b721d 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,13 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -51,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java index 01cf63fdb40a..ca00184d2a56 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java @@ -4,13 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java index 9004004154bc..b8fa3720a211 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java @@ -3,13 +3,6 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -51,217 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param pet Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param pet Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java index 3f6c13886b8e..1292dc0b721d 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,13 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -51,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{orderId} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{orderId} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param order order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java index 1835681b83ad..ca00184d2a56 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java @@ -4,13 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param user Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param user List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param user List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param user Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, - @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 225f2f6d443d..c2db7ca5a815 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index 4238e9d938f3..5ae5d5fed985 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -54,320 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index aa2911fd85e6..65b695629d43 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index b42164232455..ea6c56e02c11 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -4,7 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,190 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index d519896475f2..1292dc0b721d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index e63fcb4a8ea4..ca00184d2a56 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 225f2f6d443d..c2db7ca5a815 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index 4238e9d938f3..5ae5d5fed985 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -54,320 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index aa2911fd85e6..65b695629d43 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java index b42164232455..ea6c56e02c11 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java @@ -4,7 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,190 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java index d519896475f2..1292dc0b721d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java index e63fcb4a8ea4..ca00184d2a56 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 893051d77d21..e27e2fc20ea9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -42,18 +41,4 @@ public AnotherFakeApiDelegate getDelegate() { return delegate; } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.call123testSpecialTags(body); - } - } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java index 026c0b7437a6..726b17779f18 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,278 +51,4 @@ public FakeApiDelegate getDelegate() { return delegate; } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return delegate.createXmlItem(xmlItem); - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return delegate.fakeOuterBooleanSerialize(body); - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - return delegate.fakeOuterCompositeSerialize(body); - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return delegate.fakeOuterNumberSerialize(body); - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return delegate.fakeOuterStringSerialize(body); - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return delegate.testBodyWithFileSchema(body); - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return delegate.testBodyWithQueryParams(query, body); - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClientModel(body); - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return delegate.testInlineAdditionalProperties(param); - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return delegate.testJsonFormData(param, param2); - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - } - } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index e1278db7b9f9..21e28fe8b213 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -42,18 +41,4 @@ public FakeClassnameTestApiDelegate getDelegate() { return delegate; } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClassname(body); - } - } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java index b2914a63a077..5ef3de965ff8 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -4,7 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,131 +43,4 @@ public PetApiDelegate getDelegate() { return delegate; } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.addPet(body); - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return delegate.deletePet(petId, apiKey); - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - return delegate.findPetsByStatus(status); - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - return delegate.findPetsByTags(tags); - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - return delegate.getPetById(petId); - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.updatePet(body); - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return delegate.updatePetWithForm(petId, name, status); - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - return delegate.uploadFile(petId, additionalMetadata, file); - } - } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java index f3d02b2f9797..e9e29a41b4f9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -43,62 +42,4 @@ public StoreApiDelegate getDelegate() { return delegate; } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return delegate.deleteOrder(orderId); - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return delegate.getInventory(); - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - return delegate.getOrderById(orderId); - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - return delegate.placeOrder(body); - } - } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java index c58baa5fb00e..1b48d4a9444b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,119 +43,4 @@ public UserApiDelegate getDelegate() { return delegate; } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return delegate.createUser(body); - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithArrayInput(body); - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithListInput(body); - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return delegate.deleteUser(username); - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - return delegate.getUserByName(username); - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return delegate.loginUser(username, password); - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return delegate.logoutUser(); - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return delegate.updateUser(username, body); - } - } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 893051d77d21..e27e2fc20ea9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -42,18 +41,4 @@ public AnotherFakeApiDelegate getDelegate() { return delegate; } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.call123testSpecialTags(body); - } - } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 026c0b7437a6..726b17779f18 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,278 +51,4 @@ public FakeApiDelegate getDelegate() { return delegate; } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return delegate.createXmlItem(xmlItem); - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return delegate.fakeOuterBooleanSerialize(body); - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - return delegate.fakeOuterCompositeSerialize(body); - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return delegate.fakeOuterNumberSerialize(body); - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return delegate.fakeOuterStringSerialize(body); - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return delegate.testBodyWithFileSchema(body); - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return delegate.testBodyWithQueryParams(query, body); - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClientModel(body); - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return delegate.testInlineAdditionalProperties(param); - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return delegate.testJsonFormData(param, param2); - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - } - } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index e1278db7b9f9..21e28fe8b213 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -42,18 +41,4 @@ public FakeClassnameTestApiDelegate getDelegate() { return delegate; } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClassname(body); - } - } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index b2914a63a077..5ef3de965ff8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -4,7 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,131 +43,4 @@ public PetApiDelegate getDelegate() { return delegate; } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.addPet(body); - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return delegate.deletePet(petId, apiKey); - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - return delegate.findPetsByStatus(status); - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - return delegate.findPetsByTags(tags); - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - return delegate.getPetById(petId); - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.updatePet(body); - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return delegate.updatePetWithForm(petId, name, status); - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - return delegate.uploadFile(petId, additionalMetadata, file); - } - } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java index f3d02b2f9797..e9e29a41b4f9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -43,62 +42,4 @@ public StoreApiDelegate getDelegate() { return delegate; } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return delegate.deleteOrder(orderId); - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return delegate.getInventory(); - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - return delegate.getOrderById(orderId); - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - return delegate.placeOrder(body); - } - } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java index c58baa5fb00e..1b48d4a9444b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,119 +43,4 @@ public UserApiDelegate getDelegate() { return delegate; } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return delegate.createUser(body); - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithArrayInput(body); - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithListInput(body); - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return delegate.deleteUser(username); - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - return delegate.getUserByName(username); - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return delegate.loginUser(username, password); - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return delegate.logoutUser(); - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return delegate.updateUser(username, body); - } - } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 225f2f6d443d..c2db7ca5a815 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java index 381013b21a0e..5ae5d5fed985 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -54,312 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index aa2911fd85e6..65b695629d43 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java index d31b06c1d38a..ea6c56e02c11 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java @@ -4,7 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,188 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java index d519896475f2..1292dc0b721d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java index e63fcb4a8ea4..ca00184d2a56 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 3c8824b5c3c4..c9afaab792d8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -3,7 +3,6 @@ import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java index d0bb8a65db51..db9b0dff167e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java @@ -13,7 +13,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 400efe2a2bd3..f98a29c1d782 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -3,7 +3,6 @@ import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java index 65428354fbf4..4b6a806bf6df 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java @@ -5,7 +5,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java index 2ba71bc16709..72b8085628cf 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java @@ -4,7 +4,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java index 191684585cd6..6d3effb9ec3b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java @@ -5,7 +5,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 893051d77d21..e27e2fc20ea9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -42,18 +41,4 @@ public AnotherFakeApiDelegate getDelegate() { return delegate; } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.call123testSpecialTags(body); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 83d7ada53519..726b17779f18 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,278 +51,4 @@ public FakeApiDelegate getDelegate() { return delegate; } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return delegate.createXmlItem(xmlItem); - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return delegate.fakeOuterBooleanSerialize(body); - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - return delegate.fakeOuterCompositeSerialize(body); - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return delegate.fakeOuterNumberSerialize(body); - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return delegate.fakeOuterStringSerialize(body); - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return delegate.testBodyWithFileSchema(body); - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return delegate.testBodyWithQueryParams(query, body); - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClientModel(body); - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return delegate.testInlineAdditionalProperties(param); - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return delegate.testJsonFormData(param, param2); - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index e1278db7b9f9..21e28fe8b213 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -42,18 +41,4 @@ public FakeClassnameTestApiDelegate getDelegate() { return delegate; } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClassname(body); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java index d8d7fa43f0ae..665635623373 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -5,7 +5,6 @@ import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,133 +44,4 @@ public PetApiDelegate getDelegate() { return delegate; } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.addPet(body); - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return delegate.deletePet(petId, apiKey); - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @ApiIgnore final Pageable pageable - ) { - return delegate.findPetsByStatus(status, pageable); - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @ApiIgnore final Pageable pageable - ) { - return delegate.findPetsByTags(tags, pageable); - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - return delegate.getPetById(petId); - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.updatePet(body); - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return delegate.updatePetWithForm(petId, name, status); - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - return delegate.uploadFile(petId, additionalMetadata, file); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index f3d02b2f9797..e9e29a41b4f9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -43,62 +42,4 @@ public StoreApiDelegate getDelegate() { return delegate; } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return delegate.deleteOrder(orderId); - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return delegate.getInventory(); - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - return delegate.getOrderById(orderId); - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - return delegate.placeOrder(body); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index c58baa5fb00e..1b48d4a9444b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,119 +43,4 @@ public UserApiDelegate getDelegate() { return delegate; } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return delegate.createUser(body); - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithArrayInput(body); - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithListInput(body); - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return delegate.deleteUser(username); - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - return delegate.getUserByName(username); - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return delegate.loginUser(username, password); - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return delegate.logoutUser(); - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return delegate.updateUser(username, body); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 893051d77d21..e27e2fc20ea9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -42,18 +41,4 @@ public AnotherFakeApiDelegate getDelegate() { return delegate; } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.call123testSpecialTags(body); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java index 83d7ada53519..726b17779f18 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -52,278 +51,4 @@ public FakeApiDelegate getDelegate() { return delegate; } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return delegate.createXmlItem(xmlItem); - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return delegate.fakeOuterBooleanSerialize(body); - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - return delegate.fakeOuterCompositeSerialize(body); - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return delegate.fakeOuterNumberSerialize(body); - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return delegate.fakeOuterStringSerialize(body); - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return delegate.testBodyWithFileSchema(body); - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return delegate.testBodyWithQueryParams(query, body); - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClientModel(body); - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return delegate.testInlineAdditionalProperties(param); - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return delegate.testJsonFormData(param, param2); - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index e1278db7b9f9..21e28fe8b213 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -42,18 +41,4 @@ public FakeClassnameTestApiDelegate getDelegate() { return delegate; } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - return delegate.testClassname(body); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java index d8d7fa43f0ae..665635623373 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java @@ -5,7 +5,6 @@ import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,133 +44,4 @@ public PetApiDelegate getDelegate() { return delegate; } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.addPet(body); - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return delegate.deletePet(petId, apiKey); - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @ApiIgnore final Pageable pageable - ) { - return delegate.findPetsByStatus(status, pageable); - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @ApiIgnore final Pageable pageable - ) { - return delegate.findPetsByTags(tags, pageable); - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - return delegate.getPetById(petId); - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return delegate.updatePet(body); - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return delegate.updatePetWithForm(petId, name, status); - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - return delegate.uploadFile(petId, additionalMetadata, file); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java index f3d02b2f9797..e9e29a41b4f9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -43,62 +42,4 @@ public StoreApiDelegate getDelegate() { return delegate; } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return delegate.deleteOrder(orderId); - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return delegate.getInventory(); - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - return delegate.getOrderById(orderId); - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - return delegate.placeOrder(body); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java index c58baa5fb00e..1b48d4a9444b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,119 +43,4 @@ public UserApiDelegate getDelegate() { return delegate; } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return delegate.createUser(body); - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithArrayInput(body); - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return delegate.createUsersWithListInput(body); - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return delegate.deleteUser(username); - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - return delegate.getUserByName(username); - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return delegate.loginUser(username, password); - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return delegate.logoutUser(); - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return delegate.updateUser(username, body); - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 225f2f6d443d..c2db7ca5a815 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index f0ae3ff20eac..5ae5d5fed985 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -54,320 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index aa2911fd85e6..65b695629d43 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 59504a7e6241..ab60617a7ee1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -5,7 +5,6 @@ import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -47,192 +46,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @ApiIgnore final Pageable pageable - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @ApiIgnore final Pageable pageable - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index d519896475f2..1292dc0b721d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index e63fcb4a8ea4..ca00184d2a56 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 225f2f6d443d..c2db7ca5a815 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java index f0ae3ff20eac..5ae5d5fed985 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -54,320 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index aa2911fd85e6..65b695629d43 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java index 59504a7e6241..ab60617a7ee1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java @@ -5,7 +5,6 @@ import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -47,192 +46,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @ApiIgnore final Pageable pageable - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @ApiIgnore final Pageable pageable - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java index d519896475f2..1292dc0b721d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java index e63fcb4a8ea4..ca00184d2a56 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 225f2f6d443d..c2db7ca5a815 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java index 0954aacd9ad0..5ae5d5fed985 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -54,320 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index aa2911fd85e6..65b695629d43 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java index f5f401b64fc0..ea6c56e02c11 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java @@ -4,7 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,190 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) Optional apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java index d519896475f2..1292dc0b721d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java index e63fcb4a8ea4..ca00184d2a56 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java index a5fa04c024da..dd5594acb67b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.virtualan.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java index 223654abecfe..d33842e20df7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.virtualan.model.User; import org.openapitools.virtualan.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -54,320 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java index 717cff16ca9e..f4d0eedc19c9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.virtualan.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java index 5b6eae27d4d7..94ea48fcc818 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java @@ -4,7 +4,6 @@ import org.openapitools.virtualan.model.Pet; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,190 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java index acb5a7eb95f6..bc986cbdf0a1 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.virtualan.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java index f6c3ee34fb62..65303c96a8a5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.virtualan.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 225f2f6d443d..c2db7ca5a815 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - public ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java index 4238e9d938f3..5ae5d5fed985 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -54,320 +53,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - public ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - public ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - public ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - public ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - public ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - public ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - public ResponseEntity testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - public ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - public ResponseEntity testEndpointParameters( - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - public ResponseEntity testEnumParameters( - @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Someting wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - public ResponseEntity testGroupParameters( - @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - public ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - public ResponseEntity testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - public ResponseEntity testQueryParameterCollectionFormat( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - public ResponseEntity uploadFileWithRequiredFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index aa2911fd85e6..65b695629d43 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,7 +2,6 @@ import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -44,28 +43,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - public ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java index b42164232455..ea6c56e02c11 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java @@ -4,7 +4,6 @@ import org.openapitools.model.Pet; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,190 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - public ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - public ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - public ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - public ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - public ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - public ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - public ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - public ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java index d519896475f2..1292dc0b721d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java @@ -3,7 +3,6 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -45,94 +44,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - public ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - public ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - public ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - public ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java index e63fcb4a8ea4..ca00184d2a56 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java @@ -4,7 +4,6 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -46,141 +45,4 @@ public Optional getRequest() { return Optional.ofNullable(request); } - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - public ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - public ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - public ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - public ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - public ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - public ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - public ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - public ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - } From 274e4b1be3cec5096e2854f4cb2f5e4a71445525 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Feb 2022 11:07:41 +0800 Subject: [PATCH 068/111] Bump ajv from 6.6.2 to 6.12.6 in /website (#11584) Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.6.2 to 6.12.6. - [Release notes](https://github.com/ajv-validator/ajv/releases) - [Commits](https://github.com/ajv-validator/ajv/compare/v6.6.2...v6.12.6) --- updated-dependencies: - dependency-name: ajv dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/yarn.lock | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/website/yarn.lock b/website/yarn.lock index 15489b0fce1a..0e00292d3b9c 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -1450,26 +1450,16 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@^6.1.0, ajv@^6.10.2: - version "6.11.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.11.0.tgz#c3607cbc8ae392d8a5a536f25b21f8e5f3f87fe9" - integrity sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA== +ajv@^6.1.0, ajv@^6.10.2, ajv@^6.5.5: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.5.5: - version "6.6.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d" - integrity sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - algoliasearch@^3.24.5: version "3.35.1" resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-3.35.1.tgz#297d15f534a3507cab2f5dfb996019cac7568f0c" @@ -3641,15 +3631,10 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - fast-deep-equal@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" - integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-glob@^2.0.2: version "2.2.7" @@ -3675,9 +3660,9 @@ fast-glob@^3.0.3: micromatch "^4.0.2" fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fastq@^1.6.0: version "1.6.0" @@ -9196,9 +9181,9 @@ upper-case@^1.1.1: integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg= uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" From 5bc53ec08c5e531dcabeee3380f4553d6a10bcda Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Feb 2022 11:08:06 +0800 Subject: [PATCH 069/111] Bump shelljs from 0.8.3 to 0.8.5 in /website (#11324) Bumps [shelljs](https://github.com/shelljs/shelljs) from 0.8.3 to 0.8.5. - [Release notes](https://github.com/shelljs/shelljs/releases) - [Changelog](https://github.com/shelljs/shelljs/blob/master/CHANGELOG.md) - [Commits](https://github.com/shelljs/shelljs/compare/v0.8.3...v0.8.5) --- updated-dependencies: - dependency-name: shelljs dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/yarn.lock | 91 +++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 47 deletions(-) diff --git a/website/yarn.lock b/website/yarn.lock index 0e00292d3b9c..4a80123cbb24 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -1774,9 +1774,9 @@ bail@^1.0.0: integrity sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ== balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== base64-js@^1.0.2: version "1.3.0" @@ -4005,34 +4005,10 @@ glob-to-regexp@^0.3.0: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= -glob@^7.0.0, glob@^7.0.5, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.3, glob@^7.1.4: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.2: - version "7.1.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -4674,20 +4650,20 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@~2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= -inherits@2.0.4, inherits@^2.0.0, inherits@~2.0.1: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= ini@^1.3.5, ini@~1.3.0: version "1.3.7" @@ -4727,9 +4703,9 @@ internal-ip@^4.3.0: ipaddr.js "^1.9.0" interpret@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" - integrity sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ= + version "1.4.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" + integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" @@ -4866,6 +4842,13 @@ is-color-stop@^1.0.0: rgb-regex "^1.0.1" rgba-regex "^1.0.0" +is-core-module@^2.8.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" + integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== + dependencies: + has "^1.0.3" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -6554,7 +6537,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6: +path-parse@^1.0.6, path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -7955,7 +7938,16 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.3.2: +resolve@^1.1.6: + version "1.21.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.21.0.tgz#b51adc97f3472e6a5cf4444d34bc9d6b9037591f" + integrity sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA== + dependencies: + is-core-module "^2.8.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +resolve@^1.3.2: version "1.9.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06" integrity sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ== @@ -8279,9 +8271,9 @@ shell-quote@1.7.2: integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== shelljs@^0.8.3: - version "0.8.3" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097" - integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A== + version "0.8.5" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" + integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -8726,6 +8718,11 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + svgo@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.1.1.tgz#12384b03335bcecd85cfa5f4e3375fed671cb985" From d0d0a0505e019629a1bc98b7f64c4bb342ce5b32 Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov <99750332+vlsergey-at-yandex@users.noreply.github.com> Date: Wed, 16 Feb 2022 08:34:11 +0300 Subject: [PATCH 070/111] Support email validation in kotlin-spring (#11617) --- .../src/main/resources/kotlin-spring/api.mustache | 1 + .../main/resources/kotlin-spring/apiInterface.mustache | 1 + .../resources/kotlin-spring/beanValidationModel.mustache | 8 +++++++- .../resources/kotlin-spring/beanValidationPath.mustache | 6 +++++- .../src/main/kotlin/org/openapitools/api/PetApi.kt | 1 + .../src/main/kotlin/org/openapitools/api/StoreApi.kt | 1 + .../src/main/kotlin/org/openapitools/api/UserApi.kt | 1 + .../src/main/kotlin/org/openapitools/model/Category.kt | 1 + .../main/kotlin/org/openapitools/api/PetApiController.kt | 1 + .../kotlin/org/openapitools/api/StoreApiController.kt | 1 + .../main/kotlin/org/openapitools/api/UserApiController.kt | 1 + .../main/kotlin/org/openapitools/api/PetApiController.kt | 1 + .../kotlin/org/openapitools/api/StoreApiController.kt | 1 + .../main/kotlin/org/openapitools/api/UserApiController.kt | 1 + .../main/kotlin/org/openapitools/api/PetApiController.kt | 1 + .../kotlin/org/openapitools/api/StoreApiController.kt | 1 + .../main/kotlin/org/openapitools/api/UserApiController.kt | 1 + 17 files changed, 27 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache index bd9ffd24b70d..9ea6611216fe 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache @@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache index ba447db2d440..365a1fd579dd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache @@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache index 3c8872a804b1..e06238fb17e3 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache @@ -1,4 +1,10 @@ -{{#pattern}} +{{! +format: email +}}{{#isEmail}} + @get:Email +{{/isEmail}}{{! +pattern set +}}{{#pattern}} @get:Pattern(regexp="{{{.}}}"){{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationPath.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationPath.mustache index 212e32d3dbb2..7fe8e0c327b3 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationPath.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationPath.mustache @@ -1,4 +1,8 @@ -{{#pattern}}@Pattern(regexp="{{{.}}}") {{/pattern}}{{! +{{! +format: email +}}{{#isEmail}}@Email {{/isEmail}}{{! +pattern set +}}{{#pattern}}@Pattern(regexp="{{{.}}}") {{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}}@Size(min={{minLength}},max={{maxLength}}) {{/maxLength}}{{/minLength}}{{! minLength set, maxLength not diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index 7fd7d14c7ee1..3115f0adfb98 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index b24e79ee0576..fba10fa0b6bf 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index 0801ae992159..2cbe1742aede 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt index 42348e7084aa..be587aeaeec4 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt @@ -21,6 +21,7 @@ data class Category( @ApiModelProperty(example = "null", value = "") @field:JsonProperty("id") val id: kotlin.Long? = null, + @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(example = "null", value = "") @field:JsonProperty("name") val name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt index a26504324da6..e9ad5c445890 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt index e2be73b4ec33..31f54ce0246e 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt index f7c4144fbdbe..92050c6e481d 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt index 8430a1333aaf..8558f9b4e9e1 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 24dbff458d3f..2b187f5820bc 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt index 9881ade4a160..56cefa696678 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt index a26504324da6..e9ad5c445890 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt index e2be73b4ec33..31f54ce0246e 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt index f7c4144fbdbe..92050c6e481d 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull From c7367c2d34e68ec2aedc93729a00cce43bcb9b14 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 16 Feb 2022 15:09:51 +0800 Subject: [PATCH 071/111] [kotlin] add missing import, better code format for kotlin generators (#11619) * add missing import, better code format for kotlin generators * update kotlin workflow * more kotlin tests * better code format * separate kotlin client, server teets * comment out tests --- ...kotlin.yaml => samples-kotlin-client.yaml} | 11 ++-- .github/workflows/samples-kotlin-server.yaml | 54 +++++++++++++++++++ .../languages/AbstractKotlinCodegen.java | 4 +- .../languages/KotlinClientCodegen.java | 14 ++--- .../languages/KotlinSpringServerCodegen.java | 12 ++--- .../languages/KotlinVertxServerCodegen.java | 2 +- .../codegen/languages/KtormSchemaCodegen.java | 4 +- .../beanValidationModel.mustache | 3 +- .../kotlin-spring/beanValidationPath.mustache | 4 +- .../resources/kotlin-spring/model.mustache | 1 + pom.xml | 19 ------- .../kotlin/org/openapitools/model/Category.kt | 1 + .../openapitools/model/ModelApiResponse.kt | 1 + .../kotlin/org/openapitools/model/Order.kt | 1 + .../main/kotlin/org/openapitools/model/Pet.kt | 1 + .../main/kotlin/org/openapitools/model/Tag.kt | 1 + .../kotlin/org/openapitools/model/User.kt | 1 + .../kotlin/org/openapitools/model/Category.kt | 1 + .../openapitools/model/ModelApiResponse.kt | 1 + .../kotlin/org/openapitools/model/Order.kt | 1 + .../main/kotlin/org/openapitools/model/Pet.kt | 1 + .../main/kotlin/org/openapitools/model/Tag.kt | 1 + .../kotlin/org/openapitools/model/User.kt | 1 + .../kotlin/org/openapitools/model/Category.kt | 1 + .../openapitools/model/ModelApiResponse.kt | 1 + .../kotlin/org/openapitools/model/Order.kt | 1 + .../main/kotlin/org/openapitools/model/Pet.kt | 1 + .../main/kotlin/org/openapitools/model/Tag.kt | 1 + .../kotlin/org/openapitools/model/User.kt | 1 + .../kotlin/org/openapitools/model/Category.kt | 1 + .../openapitools/model/ModelApiResponse.kt | 1 + .../kotlin/org/openapitools/model/Order.kt | 1 + .../main/kotlin/org/openapitools/model/Pet.kt | 1 + .../main/kotlin/org/openapitools/model/Tag.kt | 1 + .../kotlin/org/openapitools/model/User.kt | 1 + 35 files changed, 105 insertions(+), 47 deletions(-) rename .github/workflows/{samples-kotlin.yaml => samples-kotlin-client.yaml} (93%) create mode 100644 .github/workflows/samples-kotlin-server.yaml diff --git a/.github/workflows/samples-kotlin.yaml b/.github/workflows/samples-kotlin-client.yaml similarity index 93% rename from .github/workflows/samples-kotlin.yaml rename to .github/workflows/samples-kotlin-client.yaml index ce20f98a3464..0c6199846320 100644 --- a/.github/workflows/samples-kotlin.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -1,14 +1,10 @@ -name: Samples Kotlin +name: Samples Kotlin cilent on: push: branches: - - master - - '[5-9]+.[0-9]+.x' + - 'samples/client/petstore/kotlin*/**' pull_request: - branches: - - master - - '[5-9]+.[0-9]+.x' paths: - 'samples/client/petstore/kotlin*/**' @@ -17,12 +13,13 @@ env: jobs: build: - name: Build Kotlin + name: Build Kotlin client runs-on: ubuntu-latest strategy: fail-fast: false matrix: sample: + # client - samples/client/petstore/kotlin - samples/client/petstore/kotlin-gson - samples/client/petstore/kotlin-jackson diff --git a/.github/workflows/samples-kotlin-server.yaml b/.github/workflows/samples-kotlin-server.yaml new file mode 100644 index 000000000000..bccd2212ad2f --- /dev/null +++ b/.github/workflows/samples-kotlin-server.yaml @@ -0,0 +1,54 @@ +name: Samples Kotlin server + +on: + push: + branches: + - 'samples/server/petstore/kotlin*/**' + pull_request: + paths: + - 'samples/server/petstore/kotlin*/**' + +env: + GRADLE_VERSION: 6.9 + +jobs: + build: + name: Build Kotlin server + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # server + - samples/server/petstore/kotlin-springboot + - samples/server/petstore/kotlin-springboot-modelMutable + - samples/server/petstore/kotlin-springboot-delegate + - samples/server/petstore/kotlin-springboot-reactive + - samples/server/petstore/kotlin-server/ktor + - samples/server/petstore/kotlin-server/jaxrs-spec + - samples/server/petstore/kotlin-server-modelMutable + # no build.gradle file + #- samples/server/petstore/kotlin-vertx-modelMutable + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 8 + - name: Cache maven dependencies + uses: actions/cache@v2.1.7 + env: + cache-name: maven-repository + with: + path: | + ~/.gradle + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Install Gradle wrapper + uses: eskatos/gradle-command-action@v2 + with: + gradle-version: ${{ env.GRADLE_VERSION }} + build-root-directory: ${{ matrix.sample }} + arguments: wrapper + - name: Build + working-directory: ${{ matrix.sample }} + run: ./gradlew build -x test diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index 0c700f116afb..1999d51bce48 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -1042,5 +1042,7 @@ public String toDefaultValue(Schema schema) { } @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.KOTLIN; } + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.KOTLIN; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 097555f3f8a5..6e0eea1e4844 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -247,7 +247,9 @@ public String getHelp() { return "Generates a Kotlin client."; } - public boolean getGenerateRoomModels() { return generateRoomModels; } + public boolean getGenerateRoomModels() { + return generateRoomModels; + } public void setGenerateRoomModels(Boolean generateRoomModels) { this.generateRoomModels = generateRoomModels; @@ -343,12 +345,10 @@ public void processOpts() { // Set the value to defaults if we haven't overridden if (MULTIPLATFORM.equals(getLibrary())) { setSourceFolder("src/commonMain/kotlin"); - } - else if (JVM_VOLLEY.equals(getLibrary())){ + } else if (JVM_VOLLEY.equals(getLibrary())) { // Android plugin wants it's source in java setSourceFolder("src/main/java"); - } - else { + } else { setSourceFolder(super.sourceFolder); } additionalProperties.put(CodegenConstants.SOURCE_FOLDER, this.sourceFolder); @@ -549,8 +549,8 @@ private void processJVMVolleyLibrary(String infrastructureFolder, String request this.setGenerateRoomModels(convertPropertyToBooleanAndWriteBack(GENERATE_ROOM_MODELS)); // Hide this option behind a property getter and setter in case we need to check it elsewhere if (getGenerateRoomModels()) { - modelTemplateFiles.put("model_room.mustache", "RoomModel.kt"); - supportingFiles.add(new SupportingFile("infrastructure/ITransformForStorage.mustache", infrastructureFolder, "ITransformForStorage.kt")); + modelTemplateFiles.put("model_room.mustache", "RoomModel.kt"); + supportingFiles.add(new SupportingFile("infrastructure/ITransformForStorage.mustache", infrastructureFolder, "ITransformForStorage.kt")); } } else { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index f771ab38ab3a..f9ef3026e60c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -429,7 +429,7 @@ public void processOpts() { if (!this.interfaceOnly) { supportingFiles.add(new SupportingFile("application.mustache", resourceFolder, "application.yaml")); supportingFiles.add(new SupportingFile("springBootApplication.mustache", - sanitizeDirectory(sourceFolder + File.separator + basePackage), "Application.kt")); + sanitizeDirectory(sourceFolder + File.separator + basePackage), "Application.kt")); } } @@ -596,11 +596,11 @@ public void setReturnContainer(final String returnContainer) { final List allParams = operation.allParams; if (allParams != null) { allParams.forEach(param -> - // This is necessary in case 'modelMutable' is enabled, - // to prevent Spring Request handlers from being generated with - // parameters using their Mutable container types. - // See https://github.com/OpenAPITools/openapi-generator/pull/11154#discussion_r793094727 - param.dataType = getNonMutableContainerTypeIfNeeded(param.dataType)); + // This is necessary in case 'modelMutable' is enabled, + // to prevent Spring Request handlers from being generated with + // parameters using their Mutable container types. + // See https://github.com/OpenAPITools/openapi-generator/pull/11154#discussion_r793094727 + param.dataType = getNonMutableContainerTypeIfNeeded(param.dataType)); } doDataTypeAssignment(operation.returnType, new DataTypeAssigner() { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java index 7d50e57b7f0d..6445a7018dcd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java @@ -37,7 +37,7 @@ public class KotlinVertxServerCodegen extends AbstractKotlinCodegen { public static final String PROJECT_NAME = "projectName"; - final Logger LOGGER = LoggerFactory.getLogger(KotlinVertxServerCodegen.class); + final Logger LOGGER = LoggerFactory.getLogger(KotlinVertxServerCodegen.class); public CodegenType getTag() { return CodegenType.SERVER; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java index 73457440d669..b4f1b12081d6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java @@ -1228,5 +1228,7 @@ public String toSrcPath(String packageName) { } @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.KTORM; } + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.KTORM; + } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache index e06238fb17e3..996353148d6c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache @@ -1,8 +1,7 @@ {{! format: email }}{{#isEmail}} - @get:Email -{{/isEmail}}{{! + @get:Email{{/isEmail}}{{! pattern set }}{{#pattern}} @get:Pattern(regexp="{{{.}}}"){{/pattern}}{{! diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationPath.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationPath.mustache index 7fe8e0c327b3..8eb9029b9809 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationPath.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationPath.mustache @@ -1,6 +1,4 @@ -{{! -format: email -}}{{#isEmail}}@Email {{/isEmail}}{{! +{{#isEmail}}@Email {{/isEmail}}{{! pattern set }}{{#pattern}}@Pattern(regexp="{{{.}}}") {{/pattern}}{{! minLength && maxLength set diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache index 37489b1d560e..4dcc67b81b3d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache @@ -6,6 +6,7 @@ import java.util.Objects {{#useBeanValidation}} import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/pom.xml b/pom.xml index fb5c330ba433..5b5ed00e2433 100644 --- a/pom.xml +++ b/pom.xml @@ -1184,7 +1184,6 @@ samples/server/petstore/jaxrs-resteasy/eap-java8 samples/server/petstore/jaxrs-resteasy/joda samples/server/petstore/jaxrs-resteasy/default-value - samples/client/petstore/spring-cloud samples/openapi3/client/petstore/spring-cloud samples/client/petstore/spring-cloud-date-time @@ -1336,24 +1335,6 @@ samples/client/petstore/erlang-client samples/client/petstore/erlang-proper - samples/client/petstore/kotlin - samples/client/petstore/kotlin-gson - samples/client/petstore/kotlin-jackson - samples/client/petstore/kotlin-json-request-string - samples/client/petstore/kotlin-jvm-okhttp4-coroutines - samples/client/petstore/kotlin-moshi-codegen - samples/client/petstore/kotlin-multiplatform - samples/client/petstore/kotlin-nonpublic - samples/client/petstore/kotlin-nullable - samples/client/petstore/kotlin-okhttp3 - samples/client/petstore/kotlin-retrofit2 - samples/client/petstore/kotlin-retrofit2-rx3 - samples/client/petstore/kotlin-string - samples/client/petstore/kotlin-threetenbp - samples/client/petstore/kotlin-uppercase-enum - - samples/server/petstore/kotlin-springboot - diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt index be587aeaeec4..5459864c074b 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 6ada956e84e4..6b3e10c56949 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt index 2de2fa35642b..c81e062d3f9f 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index 6f1084761b27..c37375167f9d 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -7,6 +7,7 @@ import org.openapitools.model.Category import org.openapitools.model.Tag import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Tag.kt index ab8e83484980..1d540aa16773 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Tag.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/User.kt index c083bd85dba8..87e20405d96a 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/User.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt index 106585ec1500..55a87b1bdc58 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 9916aaf62e38..e1564399e529 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt index 2cfdd429793a..8e0ff334563b 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index a1943cde3f3d..40ab9eb34dd8 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt @@ -7,6 +7,7 @@ import org.openapitools.model.Category import org.openapitools.model.Tag import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt index 77fc054dc915..3d93696f37a1 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt index 58ba8f5177b8..a18ff38ef0eb 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt index c76fbbf1e9cd..66d8d45d4667 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 6ada956e84e4..6b3e10c56949 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt index 2de2fa35642b..c81e062d3f9f 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index 22bbe695c0dc..42394bc5a10c 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -7,6 +7,7 @@ import org.openapitools.model.Category import org.openapitools.model.Tag import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt index ab8e83484980..1d540aa16773 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt index c083bd85dba8..87e20405d96a 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index c76fbbf1e9cd..66d8d45d4667 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 6ada956e84e4..6b3e10c56949 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 2de2fa35642b..c81e062d3f9f 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index 22bbe695c0dc..42394bc5a10c 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -7,6 +7,7 @@ import org.openapitools.model.Category import org.openapitools.model.Tag import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index ab8e83484980..1d540aa16773 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index c083bd85dba8..87e20405d96a 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -4,6 +4,7 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email import javax.validation.constraints.Max import javax.validation.constraints.Min import javax.validation.constraints.NotNull From 035736f5c413bbdc8e70f840cc2e8ff32da9a5a8 Mon Sep 17 00:00:00 2001 From: Daniel Schreiber Date: Wed, 16 Feb 2022 08:33:23 +0100 Subject: [PATCH 072/111] [java] No @NotNull annotation for readOnly (required) attributes - fixes #5026 (#10820) --- .../resources/Java/beanValidation.mustache | 2 + .../microprofile/beanValidation.mustache | 2 + .../JavaSpring/beanValidation.mustache | 2 +- .../java/spring/SpringCodegenTest.java | 64 ++++++++++++++++++- .../resources/3_0/spring/issue_5026-b.yaml | 34 ++++++++++ .../test/resources/3_0/spring/issue_5026.yaml | 35 ++++++++++ 6 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/issue_5026-b.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/issue_5026.yaml diff --git a/modules/openapi-generator/src/main/resources/Java/beanValidation.mustache b/modules/openapi-generator/src/main/resources/Java/beanValidation.mustache index 1bc9afa8f68d..47f7109e5bc4 100644 --- a/modules/openapi-generator/src/main/resources/Java/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/Java/beanValidation.mustache @@ -1,5 +1,7 @@ {{#required}} +{{^isReadOnly}} @NotNull +{{/isReadOnly}} {{/required}} {{#isContainer}} {{^isPrimitiveType}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidation.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidation.mustache index c8c6946fef66..f8724b244295 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidation.mustache @@ -1,4 +1,6 @@ {{#required}} +{{^isReadOnly}} @NotNull +{{/isReadOnly}} {{/required}} {{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidation.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidation.mustache index 34c7581d5d43..e427a43a0acd 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidation.mustache @@ -1 +1 @@ -{{#required}}@NotNull {{/required}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}}@Valid {{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}@Valid {{/isPrimitiveType}}{{/isContainer}}{{>beanValidationCore}} \ No newline at end of file +{{#required}}{{^isReadOnly}}@NotNull {{/isReadOnly}}{{/required}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}}@Valid {{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}@Valid {{/isPrimitiveType}}{{/isContainer}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 2c62cecc8c38..f467ee4af5ec 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -793,11 +793,73 @@ public void testConfigFileGeneration() { assertEquals(desFile, DESTINATIONFILE); } } - if(!flag){ + if (!flag) { fail("OpenAPIDocumentationConfig.java not generated"); } } + @Test + public void shouldAddNotNullOnRequiredAttributes() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/issue_5026-b.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java"), "status"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java"), "@NotNull"); + Files.readAllLines(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java")).forEach(System.out::println); + + } + + @Test + public void shouldNotAddNotNullOnReadOnlyAttributes() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/issue_5026.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java"), "status"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java"), "@NotNull"); + Files.readAllLines(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java")).forEach(System.out::println); + + } + @Test public void testTypeMappings() { final SpringCodegen codegen = new SpringCodegen(); diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_5026-b.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_5026-b.yaml new file mode 100644 index 000000000000..1255e667cc29 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_5026-b.yaml @@ -0,0 +1,34 @@ +openapi: 3.0.0 +info: + version: "1.0.0" + title: reactive-spring-boot-request-body-issue +tags: + - name: ReactiveSpringBootRequestBodyIssue +paths: + /some/dummy/endpoint: + post: + tags: + - ReactiveSpringBootRequestBodyIssue + requestBody: + description: request + content: + application/json: + schema: + $ref: '#/components/schemas/Dummy' + required: true + responses: + 200: + description: Successfully created reverse listings for retail + content: + application/json: + schema: + $ref: '#/components/schemas/Dummy' +components: + schemas: + Dummy: + required: + - status + type: object + properties: + status: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_5026.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_5026.yaml new file mode 100644 index 000000000000..2031488ea7a7 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_5026.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: "1.0.0" + title: reactive-spring-boot-request-body-issue +tags: + - name: ReactiveSpringBootRequestBodyIssue +paths: + /some/dummy/endpoint: + post: + tags: + - ReactiveSpringBootRequestBodyIssue + requestBody: + description: request + content: + application/json: + schema: + $ref: '#/components/schemas/Dummy' + required: true + responses: + 200: + description: Successfully created reverse listings for retail + content: + application/json: + schema: + $ref: '#/components/schemas/Dummy' +components: + schemas: + Dummy: + required: + - status + type: object + properties: + status: + type: string + readOnly: true From b165d2dda9dcd9ce2b436ed4545e81dac81e187e Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 16 Feb 2022 10:52:31 -0800 Subject: [PATCH 073/111] [python-experimental] fn + method signature improvements (#11529) * Updates code * Removes java files --- .../python-experimental/api_client.handlebars | 4 +- .../imports_schema_types.handlebars | 2 +- .../model_templates/new.handlebars | 4 +- .../python-experimental/schemas.handlebars | 575 ++++++++++-------- .../call_123_test_special_tags.py | 2 +- .../api/default_api_endpoints/foo_get.py | 2 +- ...ditional_properties_with_array_of_enums.py | 2 +- .../api/fake_api_endpoints/array_model.py | 2 +- .../api/fake_api_endpoints/array_of_enums.py | 2 +- .../body_with_file_schema.py | 2 +- .../body_with_query_params.py | 2 +- .../api/fake_api_endpoints/boolean.py | 2 +- .../case_sensitive_params.py | 2 +- .../api/fake_api_endpoints/client_model.py | 2 +- .../composed_one_of_different_types.py | 2 +- .../fake_api_endpoints/endpoint_parameters.py | 6 +- .../api/fake_api_endpoints/enum_parameters.py | 6 +- .../api/fake_api_endpoints/fake_health_get.py | 2 +- .../fake_api_endpoints/group_parameters.py | 2 +- .../inline_additional_properties.py | 6 +- .../fake_api_endpoints/inline_composition.py | 38 +- .../api/fake_api_endpoints/json_form_data.py | 6 +- .../api/fake_api_endpoints/mammal.py | 2 +- .../number_with_validations.py | 2 +- .../object_model_with_ref_props.py | 2 +- .../parameter_collisions.py | 2 +- .../query_parameter_collection_format.py | 2 +- .../api/fake_api_endpoints/string.py | 2 +- .../api/fake_api_endpoints/string_enum.py | 2 +- .../upload_download_file.py | 2 +- .../api/fake_api_endpoints/upload_file.py | 6 +- .../api/fake_api_endpoints/upload_files.py | 6 +- .../classname.py | 2 +- .../classname.py | 2 +- .../api/pet_api_endpoints/add_pet.py | 2 +- .../api/pet_api_endpoints/delete_pet.py | 2 +- .../pet_api_endpoints/find_pets_by_status.py | 2 +- .../pet_api_endpoints/find_pets_by_tags.py | 2 +- .../api/pet_api_endpoints/get_pet_by_id.py | 2 +- .../api/pet_api_endpoints/update_pet.py | 2 +- .../pet_api_endpoints/update_pet_with_form.py | 6 +- .../api/pet_api_endpoints/upload_file.py | 216 ------- .../upload_file_with_required_file.py | 6 +- .../api/pet_api_endpoints/upload_image.py | 6 +- .../api/store_api_endpoints/delete_order.py | 2 +- .../api/store_api_endpoints/get_inventory.py | 6 +- .../store_api_endpoints/get_order_by_id.py | 2 +- .../api/store_api_endpoints/place_order.py | 2 +- .../api/user_api_endpoints/create_user.py | 2 +- .../create_users_with_array_input.py | 2 +- .../create_users_with_list_input.py | 2 +- .../api/user_api_endpoints/delete_user.py | 2 +- .../user_api_endpoints/get_user_by_name.py | 2 +- .../api/user_api_endpoints/login_user.py | 2 +- .../api/user_api_endpoints/logout_user.py | 2 +- .../api/user_api_endpoints/update_user.py | 2 +- .../petstore_api/api_client.py | 4 +- .../model/additional_properties_class.py | 26 +- ...ditional_properties_with_array_of_enums.py | 6 +- .../petstore_api/model/address.py | 6 +- .../petstore_api/model/animal.py | 6 +- .../petstore_api/model/animal_farm.py | 2 +- .../petstore_api/model/api_response.py | 6 +- .../petstore_api/model/apple.py | 6 +- .../petstore_api/model/apple_req.py | 6 +- .../model/array_holding_any_type.py | 2 +- .../model/array_of_array_of_number_only.py | 6 +- .../petstore_api/model/array_of_enums.py | 2 +- .../model/array_of_number_only.py | 6 +- .../petstore_api/model/array_test.py | 6 +- .../model/array_with_validations_in_items.py | 2 +- .../petstore_api/model/banana.py | 6 +- .../petstore_api/model/banana_req.py | 6 +- .../petstore_api/model/bar.py | 2 +- .../petstore_api/model/basque_pig.py | 6 +- .../petstore_api/model/boolean.py | 2 +- .../petstore_api/model/boolean_enum.py | 2 +- .../petstore_api/model/capitalization.py | 6 +- .../petstore_api/model/cat.py | 6 +- .../petstore_api/model/cat_all_of.py | 6 +- .../petstore_api/model/category.py | 6 +- .../petstore_api/model/child_cat.py | 6 +- .../petstore_api/model/child_cat_all_of.py | 6 +- .../petstore_api/model/class_model.py | 6 +- .../petstore_api/model/client.py | 6 +- .../model/complex_quadrilateral.py | 6 +- .../model/complex_quadrilateral_all_of.py | 6 +- ...d_any_of_different_types_no_validations.py | 6 +- .../petstore_api/model/composed_array.py | 2 +- .../petstore_api/model/composed_bool.py | 6 +- .../petstore_api/model/composed_none.py | 6 +- .../petstore_api/model/composed_number.py | 6 +- .../petstore_api/model/composed_object.py | 6 +- .../model/composed_one_of_different_types.py | 10 +- .../petstore_api/model/composed_string.py | 6 +- .../model/composition_in_property.py | 10 +- .../petstore_api/model/currency.py | 2 +- .../petstore_api/model/danish_pig.py | 6 +- .../petstore_api/model/date_time_test.py | 2 +- .../model/date_time_with_validations.py | 2 +- .../model/date_with_validations.py | 2 +- .../petstore_api/model/decimal_payload.py | 2 +- .../petstore_api/model/dog.py | 6 +- .../petstore_api/model/dog_all_of.py | 6 +- .../petstore_api/model/drawing.py | 6 +- .../petstore_api/model/enum_arrays.py | 6 +- .../petstore_api/model/enum_class.py | 2 +- .../petstore_api/model/enum_test.py | 6 +- .../model/equilateral_triangle.py | 6 +- .../model/equilateral_triangle_all_of.py | 6 +- .../petstore_api/model/file.py | 6 +- .../model/file_schema_test_class.py | 6 +- .../petstore_api/model/foo.py | 6 +- .../petstore_api/model/format_test.py | 6 +- .../petstore_api/model/fruit.py | 6 +- .../petstore_api/model/fruit_req.py | 6 +- .../petstore_api/model/gm_fruit.py | 6 +- .../petstore_api/model/grandparent_animal.py | 6 +- .../petstore_api/model/has_only_read_only.py | 6 +- .../petstore_api/model/health_check_result.py | 10 +- .../model/inline_response_default.py | 6 +- .../petstore_api/model/integer_enum.py | 2 +- .../petstore_api/model/integer_enum_big.py | 2 +- .../model/integer_enum_one_value.py | 2 +- .../model/integer_enum_with_default_value.py | 2 +- .../petstore_api/model/integer_max10.py | 2 +- .../petstore_api/model/integer_min15.py | 2 +- .../petstore_api/model/isosceles_triangle.py | 6 +- .../model/isosceles_triangle_all_of.py | 6 +- .../petstore_api/model/mammal.py | 6 +- .../petstore_api/model/map_test.py | 22 +- ...perties_and_additional_properties_class.py | 10 +- .../petstore_api/model/model200_response.py | 6 +- .../petstore_api/model/model_return.py | 6 +- .../petstore_api/model/money.py | 6 +- .../petstore_api/model/name.py | 6 +- .../model/no_additional_properties.py | 6 +- .../petstore_api/model/nullable_class.py | 66 +- .../petstore_api/model/nullable_shape.py | 6 +- .../petstore_api/model/nullable_string.py | 6 +- .../petstore_api/model/number.py | 2 +- .../petstore_api/model/number_only.py | 6 +- .../model/number_with_validations.py | 2 +- .../petstore_api/model/object_interface.py | 2 +- .../model/object_model_with_ref_props.py | 6 +- .../model/object_with_decimal_properties.py | 6 +- .../object_with_difficultly_named_props.py | 6 +- ...object_with_inline_composition_property.py | 10 +- .../model/object_with_validations.py | 6 +- .../petstore_api/model/order.py | 6 +- .../petstore_api/model/parent_pet.py | 6 +- .../petstore_api/model/pet.py | 6 +- .../petstore_api/model/pig.py | 6 +- .../petstore_api/model/player.py | 6 +- .../petstore_api/model/quadrilateral.py | 6 +- .../model/quadrilateral_interface.py | 6 +- .../petstore_api/model/read_only_first.py | 6 +- .../petstore_api/model/scalene_triangle.py | 6 +- .../model/scalene_triangle_all_of.py | 6 +- .../petstore_api/model/shape.py | 6 +- .../petstore_api/model/shape_or_null.py | 6 +- .../model/simple_quadrilateral.py | 6 +- .../model/simple_quadrilateral_all_of.py | 6 +- .../petstore_api/model/some_object.py | 6 +- .../petstore_api/model/special_model_name.py | 6 +- .../petstore_api/model/string.py | 2 +- .../petstore_api/model/string_boolean_map.py | 6 +- .../petstore_api/model/string_enum.py | 6 +- .../model/string_enum_with_default_value.py | 2 +- .../model/string_with_validation.py | 2 +- .../petstore_api/model/tag.py | 6 +- .../petstore_api/model/triangle.py | 6 +- .../petstore_api/model/triangle_interface.py | 6 +- .../petstore_api/model/user.py | 10 +- .../petstore_api/model/whale.py | 6 +- .../petstore_api/model/zebra.py | 6 +- .../petstore_api/schemas.py | 575 ++++++++++-------- .../tests_manual/test_validate.py | 331 ++++++---- 178 files changed, 1300 insertions(+), 1319 deletions(-) delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file.py diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars index ac1ed1743a57..efcd907513d4 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars @@ -31,7 +31,6 @@ from {{packageName}}.schemas import ( Schema, FileIO, BinarySchema, - InstantiationMetadata, date, datetime, none_type, @@ -807,9 +806,8 @@ class OpenApiResponse: else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) body_schema = self.content[content_type].schema - _instantiation_metadata = InstantiationMetadata(from_server=True, configuration=configuration) deserialized_body = body_schema._from_openapi_data( - body_data, _instantiation_metadata=_instantiation_metadata) + body_data, _configuration=configuration) elif streamed: response.release_conn() diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars index 3225819fd14d..cf2d2d433837 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars @@ -21,7 +21,7 @@ from {{packageName}}.schemas import ( # noqa: F401 BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars index e74461e8043e..a05493c42e3d 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars @@ -22,7 +22,7 @@ def __new__( {{/unless}} {{/unless}} {{/each}} - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, {{#with additionalProperties}} **kwargs: typing.Type[Schema], {{/with}} @@ -46,7 +46,7 @@ def __new__( {{/unless}} {{/unless}} {{/each}} - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, {{#with additionalProperties}} **kwargs, {{/with}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars index 15a4b7b32156..3ebfd802cc2b 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars @@ -2,7 +2,7 @@ {{>partial_header}} -from collections import defaultdict +from collections import defaultdict, abc from datetime import date, datetime, timedelta # noqa: F401 from dataclasses import dataclass import functools @@ -63,21 +63,22 @@ def update(d: dict, u: dict): for k, v in u.items(): if not v: continue - d[k] = d[k] | v - return d + if k not in d: + d[k] = v + else: + d[k] = d[k] | v -class InstantiationMetadata: +class ValidationMetadata(frozendict): """ - A class to store metadata that is needed when instantiating OpenApi Schema subclasses + A class storing metadata that is needed to validate OpenApi Schema payloads """ - def __init__( - self, + def __new__( + cls, path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), from_server: bool = False, configuration: typing.Optional[Configuration] = None, base_classes: typing.FrozenSet[typing.Type] = frozenset(), - path_to_schemas: typing.Optional[typing.Dict[str, typing.Set[typing.Type]]] = None, ): """ Args: @@ -91,23 +92,30 @@ class InstantiationMetadata: - one can disable validation checking base_classes: when deserializing data that matches multiple schemas, this is used to store the schemas that have been traversed. This is used to stop processing when a cycle is seen. - path_to_schemas: a dict that goes from path to a list of classes at each path location """ - self.path_to_item = path_to_item - self.from_server = from_server - self.configuration = configuration - self.base_classes = base_classes - if path_to_schemas is None: - path_to_schemas = defaultdict(set) - self.path_to_schemas = path_to_schemas + return super().__new__( + cls, + path_to_item=path_to_item, + from_server=from_server, + configuration=configuration, + base_classes=base_classes, + ) - def __repr__(self): - return str(self.__dict__) + @property + def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: + return self.get('path_to_item') - def __eq__(self, other): - if not isinstance(other, InstantiationMetadata): - return False - return self.__dict__ == other.__dict__ + @property + def from_server(self) -> bool: + return self.get('from_server') + + @property + def configuration(self) -> typing.Optional[Configuration]: + return self.get('configuration') + + @property + def base_classes(self) -> typing.FrozenSet[typing.Type]: + return self.get('base_classes') class ValidatorBase: @@ -141,30 +149,30 @@ class ValidatorBase: @classmethod def __check_str_validations(cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata): + validation_metadata: ValidationMetadata): - if (cls.__is_json_validation_enabled('maxLength', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('maxLength', validation_metadata.configuration) and 'max_length' in validations and len(input_values) > validations['max_length']): cls.__raise_validation_error_message( value=input_values, constraint_msg="length must be less than or equal to", constraint_value=validations['max_length'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('minLength', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('minLength', validation_metadata.configuration) and 'min_length' in validations and len(input_values) < validations['min_length']): cls.__raise_validation_error_message( value=input_values, constraint_msg="length must be greater than or equal to", constraint_value=validations['min_length'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) checked_value = input_values - if (cls.__is_json_validation_enabled('pattern', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('pattern', validation_metadata.configuration) and 'regex' in validations): for regex_dict in validations['regex']: flags = regex_dict.get('flags', 0) @@ -176,42 +184,42 @@ class ValidatorBase: value=input_values, constraint_msg="must match regular expression", constraint_value=regex_dict['pattern'], - path_to_item=_instantiation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item, additional_txt=" with flags=`{}`".format(flags) ) cls.__raise_validation_error_message( value=input_values, constraint_msg="must match regular expression", constraint_value=regex_dict['pattern'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) @classmethod def __check_tuple_validations( cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata): + validation_metadata: ValidationMetadata): - if (cls.__is_json_validation_enabled('maxItems', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('maxItems', validation_metadata.configuration) and 'max_items' in validations and len(input_values) > validations['max_items']): cls.__raise_validation_error_message( value=input_values, constraint_msg="number of items must be less than or equal to", constraint_value=validations['max_items'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('minItems', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('minItems', validation_metadata.configuration) and 'min_items' in validations and len(input_values) < validations['min_items']): cls.__raise_validation_error_message( value=input_values, constraint_msg="number of items must be greater than or equal to", constraint_value=validations['min_items'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('uniqueItems', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('uniqueItems', validation_metadata.configuration) and 'unique_items' in validations and validations['unique_items'] and input_values): unique_items = [] for item in input_values: @@ -222,41 +230,41 @@ class ValidatorBase: value=input_values, constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", constraint_value='unique_items==True', - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) @classmethod def __check_dict_validations( cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata): + validation_metadata: ValidationMetadata): - if (cls.__is_json_validation_enabled('maxProperties', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('maxProperties', validation_metadata.configuration) and 'max_properties' in validations and len(input_values) > validations['max_properties']): cls.__raise_validation_error_message( value=input_values, constraint_msg="number of properties must be less than or equal to", constraint_value=validations['max_properties'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('minProperties', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('minProperties', validation_metadata.configuration) and 'min_properties' in validations and len(input_values) < validations['min_properties']): cls.__raise_validation_error_message( value=input_values, constraint_msg="number of properties must be greater than or equal to", constraint_value=validations['min_properties'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) @classmethod def __check_numeric_validations( cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata): + validation_metadata: ValidationMetadata): if cls.__is_json_validation_enabled('multipleOf', - _instantiation_metadata.configuration) and 'multiple_of' in validations: + validation_metadata.configuration) and 'multiple_of' in validations: multiple_of_values = validations['multiple_of'] for multiple_of_value in multiple_of_values: if (isinstance(input_values, decimal.Decimal) and @@ -267,7 +275,7 @@ class ValidatorBase: value=input_values, constraint_msg="value must be a multiple of", constraint_value=multiple_of_value, - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) checking_max_or_min_values = {'exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', @@ -277,44 +285,44 @@ class ValidatorBase: max_val = input_values min_val = input_values - if (cls.__is_json_validation_enabled('exclusiveMaximum', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('exclusiveMaximum', validation_metadata.configuration) and 'exclusive_maximum' in validations and max_val >= validations['exclusive_maximum']): cls.__raise_validation_error_message( value=input_values, constraint_msg="must be a value less than", constraint_value=validations['exclusive_maximum'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('maximum', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('maximum', validation_metadata.configuration) and 'inclusive_maximum' in validations and max_val > validations['inclusive_maximum']): cls.__raise_validation_error_message( value=input_values, constraint_msg="must be a value less than or equal to", constraint_value=validations['inclusive_maximum'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('exclusiveMinimum', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('exclusiveMinimum', validation_metadata.configuration) and 'exclusive_minimum' in validations and min_val <= validations['exclusive_minimum']): cls.__raise_validation_error_message( value=input_values, constraint_msg="must be a value greater than", constraint_value=validations['exclusive_maximum'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('minimum', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('minimum', validation_metadata.configuration) and 'inclusive_minimum' in validations and min_val < validations['inclusive_minimum']): cls.__raise_validation_error_message( value=input_values, constraint_msg="must be a value greater than or equal to", constraint_value=validations['inclusive_minimum'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) @classmethod @@ -322,18 +330,18 @@ class ValidatorBase: cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata + validation_metadata: ValidationMetadata ): if isinstance(input_values, str): - cls.__check_str_validations(validations, input_values, _instantiation_metadata) + cls.__check_str_validations(validations, input_values, validation_metadata) elif isinstance(input_values, tuple): - cls.__check_tuple_validations(validations, input_values, _instantiation_metadata) + cls.__check_tuple_validations(validations, input_values, validation_metadata) elif isinstance(input_values, frozendict): - cls.__check_dict_validations(validations, input_values, _instantiation_metadata) + cls.__check_dict_validations(validations, input_values, validation_metadata) elif isinstance(input_values, decimal.Decimal): - cls.__check_numeric_validations(validations, input_values, _instantiation_metadata) + cls.__check_numeric_validations(validations, input_values, validation_metadata) try: - return super()._validate_validations_pass(input_values, _instantiation_metadata) + return super()._validate_validations_pass(input_values, validation_metadata) except AttributeError: return True @@ -342,7 +350,7 @@ class Validator(typing.Protocol): def _validate_validations_pass( cls, input_values, - _instantiation_metadata: InstantiationMetadata + validation_metadata: ValidationMetadata ): pass @@ -353,11 +361,11 @@ def _SchemaValidator(**validations: typing.Union[str, bool, None, int, float, li def _validate_validations_pass( cls, input_values, - _instantiation_metadata: InstantiationMetadata + validation_metadata: ValidationMetadata ): - cls._check_validations_for_types(validations, input_values, _instantiation_metadata) + cls._check_validations_for_types(validations, input_values, validation_metadata) try: - return super()._validate_validations_pass(input_values, _instantiation_metadata) + return super()._validate_validations_pass(input_values, validation_metadata) except AttributeError: return True @@ -589,7 +597,7 @@ class DateBase(StrBase): return DEFAULT_ISOPARSER.parse_isodate(self) @classmethod - def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + def _validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: DEFAULT_ISOPARSER.parse_isodate(arg) @@ -597,16 +605,20 @@ class DateBase(StrBase): except ValueError: raise ApiValueError( "Value does not conform to the required ISO-8601 date format. " - "Invalid value '{}' for type date at {}".format(arg, _instantiation_metadata.path_to_item) + "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) ) @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): """ DateBase _validate """ - cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) - return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + cls._validate_format(arg, validation_metadata=validation_metadata) + return super()._validate(arg, validation_metadata=validation_metadata) class DateTimeBase: @@ -616,7 +628,7 @@ class DateTimeBase: return DEFAULT_ISOPARSER.parse_isodatetime(self) @classmethod - def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + def _validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: DEFAULT_ISOPARSER.parse_isodatetime(arg) @@ -624,16 +636,20 @@ class DateTimeBase: except ValueError: raise ApiValueError( "Value does not conform to the required ISO-8601 datetime format. " - "Invalid value '{}' for type datetime at {}".format(arg, _instantiation_metadata.path_to_item) + "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) ) @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ DateTimeBase _validate """ - cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) - return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + cls._validate_format(arg, validation_metadata=validation_metadata) + return super()._validate(arg, validation_metadata=validation_metadata) class DecimalBase(StrBase): @@ -649,7 +665,7 @@ class DecimalBase(StrBase): return decimal.Decimal(self) @classmethod - def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + def _validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: decimal.Decimal(arg) @@ -657,16 +673,20 @@ class DecimalBase(StrBase): except decimal.InvalidOperation: raise ApiValueError( "Value cannot be converted to a decimal. " - "Invalid value '{}' for type decimal at {}".format(arg, _instantiation_metadata.path_to_item) + "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) ) @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ DecimalBase _validate """ - cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) - return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + cls._validate_format(arg, validation_metadata=validation_metadata) + return super()._validate(arg, validation_metadata=validation_metadata) class NumberBase: @@ -703,7 +723,7 @@ class NumberBase: class ListBase: @classmethod - def _validate_items(cls, list_items, _instantiation_metadata: InstantiationMetadata): + def _validate_items(cls, list_items, validation_metadata: ValidationMetadata): """ Ensures that: - values passed in for items are valid @@ -720,22 +740,26 @@ class ListBase: # if we have definitions for an items schema, use it # otherwise accept anything item_cls = getattr(cls, '_items', AnyTypeSchema) - path_to_schemas = defaultdict(set) + path_to_schemas = {} for i, value in enumerate(list_items): if isinstance(value, item_cls): continue - item_instantiation_metadata = InstantiationMetadata( - from_server=_instantiation_metadata.from_server, - configuration=_instantiation_metadata.configuration, - path_to_item=_instantiation_metadata.path_to_item+(i,) + item_validation_metadata = ValidationMetadata( + from_server=validation_metadata.from_server, + configuration=validation_metadata.configuration, + path_to_item=validation_metadata.path_to_item+(i,) ) other_path_to_schemas = item_cls._validate( - value, _instantiation_metadata=item_instantiation_metadata) + value, validation_metadata=item_validation_metadata) update(path_to_schemas, other_path_to_schemas) return path_to_schemas @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ ListBase _validate We return dynamic classes of different bases depending upon the inputs @@ -751,34 +775,41 @@ class ListBase: ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - arg = args[0] - _path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + _path_to_schemas = super()._validate(arg, validation_metadata=validation_metadata) if not isinstance(arg, tuple): return _path_to_schemas - if cls in _instantiation_metadata.base_classes: + if cls in validation_metadata.base_classes: # we have already moved through this class so stop here return _path_to_schemas - _instantiation_metadata.base_classes |= frozenset({cls}) - other_path_to_schemas = cls._validate_items(arg, _instantiation_metadata=_instantiation_metadata) + updated_vm = ValidationMetadata( + configuration=validation_metadata.configuration, + from_server=validation_metadata.from_server, + path_to_item=validation_metadata.path_to_item, + base_classes=validation_metadata.base_classes | frozenset({cls}) + ) + other_path_to_schemas = cls._validate_items(arg, validation_metadata=updated_vm) update(_path_to_schemas, other_path_to_schemas) return _path_to_schemas @classmethod - def _get_items(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _get_items( + cls: 'Schema', + arg: typing.List[typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): ''' ListBase _get_items ''' - _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata - - list_items = args[0] + list_items = arg cast_items = [] # if we have definitions for an items schema, use it # otherwise accept anything cls_item_cls = getattr(cls, '_items', AnyTypeSchema) for i, value in enumerate(list_items): - item_path_to_item = _instantiation_metadata.path_to_item+(i,) - item_cls = _instantiation_metadata.path_to_schemas.get(item_path_to_item) + item_path_to_item = path_to_item + (i,) + item_cls = path_to_schemas.get(item_path_to_item) if item_cls is None: item_cls = cls_item_cls @@ -786,14 +817,11 @@ class ListBase: cast_items.append(value) continue - item_instantiation_metadata = InstantiationMetadata( - configuration=_instantiation_metadata.configuration, - from_server=_instantiation_metadata.from_server, - path_to_item=item_path_to_item, - path_to_schemas=_instantiation_metadata.path_to_schemas, - ) new_value = item_cls._get_new_instance_without_conversion( - value, _instantiation_metadata=item_instantiation_metadata) + value, + item_path_to_item, + path_to_schemas + ) cast_items.append(new_value) return cast_items @@ -801,12 +829,12 @@ class ListBase: class Discriminable: @classmethod - def _ensure_discriminator_value_present(cls, disc_property_name: str, _instantiation_metadata: InstantiationMetadata, *args): + def _ensure_discriminator_value_present(cls, disc_property_name: str, validation_metadata: ValidationMetadata, *args): if not args or args and disc_property_name not in args[0]: # The input data does not contain the discriminator property raise ApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: {}".format(disc_property_name, _instantiation_metadata.path_to_item) + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) ) @classmethod @@ -900,7 +928,7 @@ class DictBase(Discriminable): ) @classmethod - def _validate_args(cls, arg, _instantiation_metadata: InstantiationMetadata): + def _validate_args(cls, arg, validation_metadata: ValidationMetadata): """ Ensures that: - values passed in for properties are valid @@ -913,7 +941,7 @@ class DictBase(Discriminable): Raises: ApiTypeError - for missing required arguments, or for invalid properties """ - path_to_schemas = defaultdict(set) + path_to_schemas = {} for property_name, value in arg.items(): if property_name in cls._required_property_names or property_name in cls._property_names: schema = getattr(cls, property_name) @@ -921,21 +949,25 @@ class DictBase(Discriminable): schema = cls._additional_properties else: raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( - value, cls, _instantiation_metadata.path_to_item+(property_name,) + value, cls, validation_metadata.path_to_item+(property_name,) )) if isinstance(value, schema): continue - arg_instantiation_metadata = InstantiationMetadata( - from_server=_instantiation_metadata.from_server, - configuration=_instantiation_metadata.configuration, - path_to_item=_instantiation_metadata.path_to_item+(property_name,) + arg_validation_metadata = ValidationMetadata( + from_server=validation_metadata.from_server, + configuration=validation_metadata.configuration, + path_to_item=validation_metadata.path_to_item+(property_name,) ) - other_path_to_schemas = schema._validate(value, _instantiation_metadata=arg_instantiation_metadata) + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) update(path_to_schemas, other_path_to_schemas) return path_to_schemas @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ DictBase _validate We return dynamic classes of different bases depending upon the inputs @@ -951,15 +983,14 @@ class DictBase(Discriminable): ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - if args and isinstance(args[0], cls): + if isinstance(arg, cls): # an instance of the correct type was passed in return {} - arg = args[0] - _path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + _path_to_schemas = super()._validate(arg, validation_metadata=validation_metadata) if not isinstance(arg, frozendict): return _path_to_schemas - cls._validate_arg_presence(args[0]) - other_path_to_schemas = cls._validate_args(args[0], _instantiation_metadata=_instantiation_metadata) + cls._validate_arg_presence(arg) + other_path_to_schemas = cls._validate_args(arg, validation_metadata=validation_metadata) update(_path_to_schemas, other_path_to_schemas) try: _discriminator = cls._discriminator @@ -967,7 +998,7 @@ class DictBase(Discriminable): return _path_to_schemas # discriminator exists disc_prop_name = list(_discriminator.keys())[0] - cls._ensure_discriminator_value_present(disc_prop_name, _instantiation_metadata, *args) + cls._ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) discriminated_cls = cls._get_discriminated_class( disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) if discriminated_cls is None: @@ -976,14 +1007,19 @@ class DictBase(Discriminable): cls.__name__, disc_prop_name, list(_discriminator[disc_prop_name].keys()), - _instantiation_metadata.path_to_item + (disc_prop_name,) + validation_metadata.path_to_item + (disc_prop_name,) ) ) - if discriminated_cls in _instantiation_metadata.base_classes: + if discriminated_cls in validation_metadata.base_classes: # we have already moved through this class so stop here return _path_to_schemas - _instantiation_metadata.base_classes |= frozenset({cls}) - other_path_to_schemas = discriminated_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + updated_vm = ValidationMetadata( + configuration=validation_metadata.configuration, + from_server=validation_metadata.from_server, + path_to_item=validation_metadata.path_to_item, + base_classes=validation_metadata.base_classes | frozenset({cls}) + ) + other_path_to_schemas = discriminated_cls._validate(arg, validation_metadata=updated_vm) update(_path_to_schemas, other_path_to_schemas) return _path_to_schemas @@ -1016,7 +1052,12 @@ class DictBase(Discriminable): return tuple(property_names) @classmethod - def _get_properties(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _get_properties( + cls, + arg: typing.Dict[str, typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): """ DictBase _get_properties, this is how properties are set These values already passed validation @@ -1025,12 +1066,10 @@ class DictBase(Discriminable): # if we have definitions for property schemas convert values using it # otherwise accept anything - _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata - for property_name_js, value in arg.items(): property_cls = getattr(cls, property_name_js, cls._additional_properties) - property_path_to_item = _instantiation_metadata.path_to_item+(property_name_js,) - stored_property_cls = _instantiation_metadata.path_to_schemas.get(property_path_to_item) + property_path_to_item = path_to_item + (property_name_js,) + stored_property_cls = path_to_schemas.get(property_path_to_item) if stored_property_cls: property_cls = stored_property_cls @@ -1038,14 +1077,11 @@ class DictBase(Discriminable): dict_items[property_name_js] = value continue - prop_instantiation_metadata = InstantiationMetadata( - configuration=_instantiation_metadata.configuration, - from_server=_instantiation_metadata.from_server, - path_to_item=property_path_to_item, - path_to_schemas=_instantiation_metadata.path_to_schemas, - ) new_value = property_cls._get_new_instance_without_conversion( - value, _instantiation_metadata=prop_instantiation_metadata) + value, + property_path_to_item, + path_to_schemas + ) dict_items[property_name_js] = new_value return dict_items @@ -1189,7 +1225,11 @@ class Schema: return new_cls @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ Schema _validate Runs all schema validation logic and @@ -1217,21 +1257,21 @@ class Schema: ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - arg = args[0] - base_class = cls.__get_simple_class(arg) failed_type_check_classes = cls._validate_type(base_class) if failed_type_check_classes: raise cls.__get_type_error( arg, - _instantiation_metadata.path_to_item, + validation_metadata.path_to_item, failed_type_check_classes, key_type=False, ) if hasattr(cls, '_validate_validations_pass'): - cls._validate_validations_pass(arg, _instantiation_metadata) - path_to_schemas = defaultdict(set) - path_to_schemas[_instantiation_metadata.path_to_item].add(cls) + cls._validate_validations_pass(arg, validation_metadata) + path_to_schemas = {} + if validation_metadata.path_to_item not in path_to_schemas: + path_to_schemas[validation_metadata.path_to_item] = set() + path_to_schemas[validation_metadata.path_to_item].add(cls) if hasattr(cls, "_enum_by_value"): cls._validate_enum_value(arg) @@ -1240,7 +1280,7 @@ class Schema: if base_class is none_type or base_class is bool: return path_to_schemas - path_to_schemas[_instantiation_metadata.path_to_item].add(base_class) + path_to_schemas[validation_metadata.path_to_item].add(base_class) return path_to_schemas @classmethod @@ -1251,20 +1291,18 @@ class Schema: raise ApiValueError("Invalid value {} passed in to {}, {}".format(arg, cls, cls._enum_value_to_name)) @classmethod - def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): + def __get_new_cls( + cls, + arg, + validation_metadata: ValidationMetadata + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], 'Schema']: """ - PATH 1 - make a new dynamic class and return an instance of that class + Make a new dynamic class and return an instance of that class We are making an instance of cls, but instead of making cls make a new class, new_cls which includes dynamic bases including cls return an instance of that new class - """ - if ( - _instantiation_metadata.path_to_schemas and - _instantiation_metadata.path_to_item in _instantiation_metadata.path_to_schemas): - chosen_new_cls = _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] - return chosen_new_cls - """ + Dict property + List Item Assignment Use cases: 1. value is NOT an instance of the required schema class the value is validated by _validate @@ -1277,8 +1315,10 @@ class Schema: and in list/dict _get_items,_get_properties the value will be directly assigned because value is of the correct type, and validation was run earlier when the instance was created """ - _path_to_schemas = cls._validate(arg, _instantiation_metadata=_instantiation_metadata) + _path_to_schemas = cls._validate(arg, validation_metadata=validation_metadata) # loop through it make a new class for each entry + # do not modify the returned result because it is cached and we would be modifying the cached value + path_to_schemas = {} for path, schema_classes in _path_to_schemas.items(): enum_schema = any( hasattr(this_cls, '_enum_by_value') for this_cls in schema_classes) @@ -1304,7 +1344,7 @@ class Schema: mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) if inheritable_primitive_type and not enum_schema: - _instantiation_metadata.path_to_schemas[path] = mfg_cls + path_to_schemas[path] = mfg_cls continue # Use case: value is None, True, False, or an enum value @@ -1319,18 +1359,23 @@ class Schema: mfg_cls = mfg_cls._class_by_base_class(none_type) else: raise ApiValueError('Unhandled case value={} bases={}'.format(value, mfg_cls.__bases__)) - _instantiation_metadata.path_to_schemas[path] = mfg_cls + path_to_schemas[path] = mfg_cls - return _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] + return path_to_schemas @classmethod - def _get_new_instance_without_conversion(cls, arg, _instantiation_metadata): - # PATH 2 - we have a Dynamic class and we are making an instance of it + def _get_new_instance_without_conversion( + cls: 'Schema', + arg: typing.Any, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + # We have a Dynamic class and we are making an instance of it if issubclass(cls, frozendict): - properties = cls._get_properties(arg, _instantiation_metadata=_instantiation_metadata) + properties = cls._get_properties(arg, path_to_item, path_to_schemas) return super(Schema, cls).__new__(cls, properties) elif issubclass(cls, tuple): - items = cls._get_items(arg, _instantiation_metadata=_instantiation_metadata) + items = cls._get_items(arg, path_to_item, path_to_schemas) return super(Schema, cls).__new__(cls, items) """ str = openapi str, date, and datetime @@ -1361,16 +1406,20 @@ class Schema: io.BufferedReader, bytes ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] + _configuration: typing.Optional[Configuration] ): + """ + Schema _from_openapi_data + """ arg = cast_to_allowed_types(arg, from_server=True) - _instantiation_metadata = InstantiationMetadata(from_server=True) if _instantiation_metadata is None else _instantiation_metadata - if not _instantiation_metadata.from_server: - raise ApiValueError( - 'from_server must be True in this code path, if you need it to be False, use cls()' - ) - new_cls = cls.__get_new_cls(arg, _instantiation_metadata) - new_inst = new_cls._get_new_instance_without_conversion(arg, _instantiation_metadata) + validation_metadata = ValidationMetadata(from_server=True, configuration=_configuration) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata) + new_cls = path_to_schemas[validation_metadata.path_to_item] + new_inst = new_cls._get_new_instance_without_conversion( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) return new_inst @staticmethod @@ -1386,14 +1435,15 @@ class Schema: def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} - def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): """ Schema __new__ Args: args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): the value kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): dict values - _instantiation_metadata: contains the needed from_server, configuration, path_to_item + _configuration: contains the Configuration that enables json schema validation keywords + like minItems, minLength etc """ kwargs = cls.__remove_unsets(kwargs) if not args and not kwargs: @@ -1404,20 +1454,21 @@ class Schema: arg = args[0] else: arg = cls.__get_input_dict(*args, **kwargs) - _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata - if _instantiation_metadata.from_server: - raise ApiValueError( - 'from_server must be False in this code path, if you need it to be True, use cls._from_openapi_data()' - ) - arg = cast_to_allowed_types(arg, from_server=_instantiation_metadata.from_server) - new_cls = cls.__get_new_cls(arg, _instantiation_metadata) - return new_cls._get_new_instance_without_conversion(arg, _instantiation_metadata) + validation_metadata = ValidationMetadata(configuration=_configuration, from_server=False) + arg = cast_to_allowed_types(arg, from_server=validation_metadata.from_server) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata) + new_cls = path_to_schemas[validation_metadata.path_to_item] + return new_cls._get_new_instance_without_conversion( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) def __init__( self, *args: typing.Union[ dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[ dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset ] @@ -1447,6 +1498,8 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal because isinstance(True, int) is True """ return arg + elif isinstance(arg, int): + return decimal.Decimal(arg) elif isinstance(arg, float): decimal_from_float = decimal.Decimal(arg) if decimal_from_float.as_integer_ratio()[1] == 1: @@ -1456,8 +1509,6 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal return decimal_from_float elif type(arg) is list or type(arg) is tuple: return tuple([cast_to_allowed_types(item) for item in arg]) - elif isinstance(arg, int): - return decimal.Decimal(arg) elif arg is None: return arg elif isinstance(arg, (date, datetime)): @@ -1469,6 +1520,8 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal return arg elif isinstance(arg, bytes): return arg + elif isinstance(arg, decimal.Decimal): + return arg elif isinstance(arg, (io.FileIO, io.BufferedReader)): if arg.closed: raise ApiValueError('Invalid file state; file is closed and must be open') @@ -1481,12 +1534,12 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal class ComposedBase(Discriminable): @classmethod - def __get_allof_classes(cls, *args, _instantiation_metadata: InstantiationMetadata): + def __get_allof_classes(cls, *args, validation_metadata: ValidationMetadata): path_to_schemas = defaultdict(set) for allof_cls in cls._composed_schemas['allOf']: - if allof_cls in _instantiation_metadata.base_classes: + if allof_cls in validation_metadata.base_classes: continue - other_path_to_schemas = allof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + other_path_to_schemas = allof_cls._validate(*args, validation_metadata=validation_metadata) update(path_to_schemas, other_path_to_schemas) return path_to_schemas @@ -1495,16 +1548,16 @@ class ComposedBase(Discriminable): cls, *args, discriminated_cls, - _instantiation_metadata: InstantiationMetadata, + validation_metadata: ValidationMetadata, path_to_schemas: typing.Dict[typing.Tuple, typing.Set[typing.Type[Schema]]] ): oneof_classes = [] chosen_oneof_cls = None - original_base_classes = _instantiation_metadata.base_classes - new_base_classes = _instantiation_metadata.base_classes + original_base_classes = validation_metadata.base_classes + new_base_classes = validation_metadata.base_classes path_to_schemas = defaultdict(set) for oneof_cls in cls._composed_schemas['oneOf']: - if oneof_cls in path_to_schemas[_instantiation_metadata.path_to_item]: + if oneof_cls in path_to_schemas[validation_metadata.path_to_item]: oneof_classes.append(oneof_cls) continue if isinstance(args[0], oneof_cls): @@ -1512,10 +1565,9 @@ class ComposedBase(Discriminable): chosen_oneof_cls = oneof_cls oneof_classes.append(oneof_cls) continue - _instantiation_metadata.base_classes = original_base_classes try: - path_to_schemas = oneof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) - new_base_classes = _instantiation_metadata.base_classes + path_to_schemas = oneof_cls._validate(*args, validation_metadata=validation_metadata) + new_base_classes = validation_metadata.base_classes except (ApiValueError, ApiTypeError) as ex: if discriminated_cls is not None and oneof_cls is discriminated_cls: raise ex @@ -1532,7 +1584,6 @@ class ComposedBase(Discriminable): "Invalid inputs given to generate an instance of {}. Multiple " "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) ) - _instantiation_metadata.base_classes = new_base_classes return path_to_schemas @classmethod @@ -1540,14 +1591,14 @@ class ComposedBase(Discriminable): cls, *args, discriminated_cls, - _instantiation_metadata: InstantiationMetadata + validation_metadata: ValidationMetadata ): anyof_classes = [] chosen_anyof_cls = None - original_base_classes = _instantiation_metadata.base_classes + original_base_classes = validation_metadata.base_classes path_to_schemas = defaultdict(set) for anyof_cls in cls._composed_schemas['anyOf']: - if anyof_cls in _instantiation_metadata.base_classes: + if anyof_cls in validation_metadata.base_classes: continue if isinstance(args[0], anyof_cls): # passed in instance is the correct type @@ -1555,14 +1606,13 @@ class ComposedBase(Discriminable): anyof_classes.append(anyof_cls) continue - _instantiation_metadata.base_classes = original_base_classes try: - other_path_to_schemas = anyof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + other_path_to_schemas = anyof_cls._validate(*args, validation_metadata=validation_metadata) except (ApiValueError, ApiTypeError) as ex: if discriminated_cls is not None and anyof_cls is discriminated_cls: raise ex continue - original_base_classes = _instantiation_metadata.base_classes + original_base_classes = validation_metadata.base_classes chosen_anyof_cls = anyof_cls anyof_classes.append(anyof_cls) update(path_to_schemas, other_path_to_schemas) @@ -1574,7 +1624,11 @@ class ComposedBase(Discriminable): return path_to_schemas @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ ComposedBase _validate We return dynamic classes of different bases depending upon the inputs @@ -1590,65 +1644,70 @@ class ComposedBase(Discriminable): ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - if args and isinstance(args[0], Schema) and _instantiation_metadata.from_server is False: - if isinstance(args[0], cls): + if isinstance(arg, Schema) and validation_metadata.from_server is False: + if isinstance(arg, cls): # an instance of the correct type was passed in return {} raise ApiTypeError( 'Incorrect type passed in, required type was {} and passed type was {} at {}'.format( cls, - type(args[0]), - _instantiation_metadata.path_to_item + type(arg), + validation_metadata.path_to_item ) ) # validation checking on types, validations, and enums - path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + path_to_schemas = super()._validate(arg, validation_metadata=validation_metadata) - _instantiation_metadata.base_classes |= frozenset({cls}) + updated_vm = ValidationMetadata( + configuration=validation_metadata.configuration, + from_server=validation_metadata.from_server, + path_to_item=validation_metadata.path_to_item, + base_classes=validation_metadata.base_classes | frozenset({cls}) + ) # process composed schema _discriminator = getattr(cls, '_discriminator', None) discriminated_cls = None - if _discriminator and args and isinstance(args[0], frozendict): + if _discriminator and arg and isinstance(arg, frozendict): disc_property_name = list(_discriminator.keys())[0] - cls._ensure_discriminator_value_present(disc_property_name, _instantiation_metadata, *args) + cls._ensure_discriminator_value_present(disc_property_name, updated_vm, arg) # get discriminated_cls by looking at the dict in the current class discriminated_cls = cls._get_discriminated_class( - disc_property_name=disc_property_name, disc_payload_value=args[0][disc_property_name]) + disc_property_name=disc_property_name, disc_payload_value=arg[disc_property_name]) if discriminated_cls is None: raise ApiValueError( "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( - args[0][disc_property_name], + arg[disc_property_name], cls.__name__, disc_property_name, list(_discriminator[disc_property_name].keys()), - _instantiation_metadata.path_to_item + (disc_property_name,) + updated_vm.path_to_item + (disc_property_name,) ) ) if cls._composed_schemas['allOf']: - other_path_to_schemas = cls.__get_allof_classes(*args, _instantiation_metadata=_instantiation_metadata) + other_path_to_schemas = cls.__get_allof_classes(arg, validation_metadata=updated_vm) update(path_to_schemas, other_path_to_schemas) if cls._composed_schemas['oneOf']: other_path_to_schemas = cls.__get_oneof_class( - *args, + arg, discriminated_cls=discriminated_cls, - _instantiation_metadata=_instantiation_metadata, + validation_metadata=updated_vm, path_to_schemas=path_to_schemas ) update(path_to_schemas, other_path_to_schemas) if cls._composed_schemas['anyOf']: other_path_to_schemas = cls.__get_anyof_classes( - *args, + arg, discriminated_cls=discriminated_cls, - _instantiation_metadata=_instantiation_metadata + validation_metadata=updated_vm ) update(path_to_schemas, other_path_to_schemas) if discriminated_cls is not None: # TODO use an exception from this package here - assert discriminated_cls in path_to_schemas[_instantiation_metadata.path_to_item] + assert discriminated_cls in path_to_schemas[updated_vm.path_to_item] return path_to_schemas @@ -1669,12 +1728,12 @@ class ComposedSchema( _composed_schemas = {} @classmethod - def _from_openapi_data(cls, *args: typing.Any, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs): + def _from_openapi_data(cls, *args: typing.Any, _configuration: typing.Optional[Configuration] = None, **kwargs): if not args: if not kwargs: raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) args = (kwargs, ) - return super()._from_openapi_data(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._from_openapi_data(args[0], _configuration=_configuration) class ListSchema( @@ -1684,10 +1743,10 @@ class ListSchema( ): @classmethod - def _from_openapi_data(cls, arg: typing.List[typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: typing.Union[list, tuple], **kwargs: InstantiationMetadata): + def __new__(cls, arg: typing.Union[list, tuple], **kwargs: ValidationMetadata): return super().__new__(cls, arg, **kwargs) @@ -1698,10 +1757,10 @@ class NoneSchema( ): @classmethod - def _from_openapi_data(cls, arg: None, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: None, _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: None, **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: None, **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1716,10 +1775,10 @@ class NumberSchema( """ @classmethod - def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1733,31 +1792,35 @@ class IntBase(NumberBase): return self._as_int @classmethod - def _validate_format(cls, arg: typing.Optional[decimal.Decimal], _instantiation_metadata: InstantiationMetadata): + def _validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): if isinstance(arg, decimal.Decimal): exponent = arg.as_tuple().exponent if exponent != 0: raise ApiValueError( - "Invalid value '{}' for type integer at {}".format(arg, _instantiation_metadata.path_to_item) + "Invalid value '{}' for type integer at {}".format(arg, validation_metadata.path_to_item) ) @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ IntBase _validate TODO what about types = (int, number) -> IntBase, NumberBase? We could drop int and keep number only """ - cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) - return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + cls._validate_format(arg, validation_metadata=validation_metadata) + return super()._validate(arg, validation_metadata=validation_metadata) class IntSchema(IntBase, NumberSchema): @classmethod - def _from_openapi_data(cls, arg: int, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: int, _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1808,9 +1871,9 @@ class Float32Schema( ): @classmethod - def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None): # todo check format - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + return super()._from_openapi_data(arg, _configuration=_configuration) class Float64Base( @@ -1828,9 +1891,9 @@ class Float64Schema( ): @classmethod - def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None): # todo check format - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + return super()._from_openapi_data(arg, _configuration=_configuration) class StrSchema( @@ -1846,28 +1909,28 @@ class StrSchema( """ @classmethod - def _from_openapi_data(cls, arg: typing.Union[str], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None) -> 'StrSchema': - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: typing.Union[str], _configuration: typing.Optional[Configuration] = None) -> 'StrSchema': + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: typing.Union[str, date, datetime], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[str, date, datetime], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) class DateSchema(DateBase, StrSchema): - def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) class DateTimeSchema(DateTimeBase, StrSchema): - def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) class DecimalSchema(DecimalBase, StrSchema): - def __new__(cls, arg: typing.Union[str], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[str], **kwargs: typing.Union[ValidationMetadata]): """ Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads which can be simple (str) or complex (dicts or lists with nested values) @@ -1886,7 +1949,7 @@ class BytesSchema( """ this class will subclass bytes and is immutable """ - def __new__(cls, arg: typing.Union[bytes], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[bytes], **kwargs: typing.Union[ValidationMetadata]): return super(Schema, cls).__new__(cls, arg) @@ -1911,7 +1974,7 @@ class FileSchema( - to be able to preserve file name info """ - def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: typing.Union[ValidationMetadata]): return super(Schema, cls).__new__(cls, arg) @@ -1946,7 +2009,7 @@ class BinarySchema( ], } - def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg) @@ -1957,10 +2020,10 @@ class BoolSchema( ): @classmethod - def _from_openapi_data(cls, arg: bool, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: bool, _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: bool, **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: bool, **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1986,10 +2049,10 @@ class DictSchema( ): @classmethod - def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, InstantiationMetadata]): + def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): return super().__new__(cls, *args, **kwargs) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py index d8e8700aed00..e76f66f18b84 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py index 2e7164b4db24..d47ac5388904 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py index a980fc167748..2558ab4abfed 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py index c864cb57521e..49b12b8e23eb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py index 581a2cf36b04..3e23d008fbcb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py index 14eb9ddd3553..dcbde8810f60 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py index 30ed8b1c8ff3..298b9d752c15 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py index 3611abb2da57..8b46d4c9e33b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py index 8a8e707648d2..ab3b1178fce9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py @@ -36,7 +36,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py index be63bf5e8a4f..e6f5b673c0b3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py index cd997455196d..1965180d96c7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py index 639c85ec7819..91c0e8af5fba 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -175,7 +175,7 @@ def __new__( dateTime: typing.Union[dateTime, Unset] = unset, password: typing.Union[password, Unset] = unset, callback: typing.Union[callback, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( @@ -190,7 +190,7 @@ def __new__( dateTime=dateTime, password=password, callback=callback, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py index a3ac05fa5f07..1d62e955d524 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -351,7 +351,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], enum_form_string_array: typing.Union[enum_form_string_array, Unset] = unset, enum_form_string: typing.Union[enum_form_string, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( @@ -359,7 +359,7 @@ def __new__( *args, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py index e3970df11dde..fbe36a965b29 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py index bab146a1f469..bcbcbeaf356a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py index 47fb548b1f25..945d58b8e424 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -73,13 +73,13 @@ class SchemaForRequestBodyApplicationJson( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py index 1253597ad0a1..ebb5a6c44c3e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_composition.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -102,13 +102,13 @@ class allOf_0( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'CompositionAtRootSchema': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -154,13 +154,13 @@ class allOf_0( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'someProp': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -169,14 +169,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], someProp: typing.Union[someProp, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'CompositionInPropertySchema': return super().__new__( cls, *args, someProp=someProp, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) RequestRequiredQueryParams = typing.TypedDict( @@ -249,13 +249,13 @@ class allOf_0( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -301,13 +301,13 @@ class allOf_0( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'someProp': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -316,14 +316,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], someProp: typing.Union[someProp, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, *args, someProp=someProp, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -376,13 +376,13 @@ class allOf_0( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -428,13 +428,13 @@ class allOf_0( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'someProp': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -443,14 +443,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], someProp: typing.Union[someProp, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaFor200ResponseBodyMultipartFormData': return super().__new__( cls, *args, someProp=someProp, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py index aac637d1507f..8220d47168f2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -76,13 +76,13 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py index 8ac173426e32..52ea9c264ab7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py index 1826a74b2718..4c4ba65c9abb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py index 77f4b3ad9756..2fc439164a07 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py index e1606beb30e3..bd20c173d4cb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py index 4fef58c1548f..683f9d3c3502 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py @@ -36,7 +36,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py index 318ab585f742..eb3a762d05dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py index 7dc15a2977b8..fdc7c63c29ad 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py index 77527a9eff31..637473cacce6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py index 3dce641e4769..54db5968afdf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -79,14 +79,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, *args, additionalMetadata=additionalMetadata, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py index 2eed478036df..87eac93b2d6a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -81,14 +81,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], files: typing.Union[files, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, *args, files=files, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api_endpoints/classname.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api_endpoints/classname.py index d4839bb9b699..99b59bc4d6bb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api_endpoints/classname.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags123_api_endpoints/classname.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py index d4839bb9b699..99b59bc4d6bb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py index bc2b459c4c19..07edc4a35e83 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py index 8f75bcbd8aa5..04f2de63359d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py index c75db96db9bf..a0c199caefd0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py index 028f8d68d795..a2fdb8cb0d2f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py index ca6e4ae9f750..2ab39b7fcebe 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py index 3c3578420ca6..3510aed29b3c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py index 2961059c15b5..e1241732b393 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -102,7 +102,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], name: typing.Union[name, Unset] = unset, status: typing.Union[status, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( @@ -110,7 +110,7 @@ def __new__( *args, name=name, status=status, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file.py deleted file mode 100644 index faa353d8d30e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file.py +++ /dev/null @@ -1,216 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -import re # noqa: F401 -import sys # noqa: F401 -import typing -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 -from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 - -from petstore_api.schemas import ( # noqa: F401 - AnyTypeSchema, - ComposedSchema, - DictSchema, - ListSchema, - StrSchema, - IntSchema, - Int32Schema, - Int64Schema, - Float32Schema, - Float64Schema, - NumberSchema, - DateSchema, - DateTimeSchema, - BoolSchema, - FileSchema, - NoneSchema, - none_type, - InstantiationMetadata, - Unset, - unset, - ComposedBase, - ListBase, - DictBase, - NoneBase, - StrBase, - IntBase, - NumberBase, - DateBase, - DateTimeBase, - BoolBase, - FileBase, - Schema, - _SchemaValidator, - _SchemaTypeChecker, - _SchemaEnumMaker -) - -from petstore_api.model.api_response import ApiResponse - -# path params -PetIdSchema = Int64Schema -RequestRequiredPathParams = typing.TypedDict( - 'RequestRequiredPathParams', - { - 'petId': PetIdSchema, - } -) -RequestOptionalPathParams = typing.TypedDict( - 'RequestOptionalPathParams', - { - }, - total=False -) - - -class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): - pass - - -request_path_pet_id = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=PetIdSchema, - required=True, -) -# body param - - -class SchemaForRequestBodyMultipartFormData( - DictSchema -): - additionalMetadata = StrSchema - file = FileSchema - - - def __new__( - cls, - *args: typing.Union[dict, frozendict, ], - additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, - file: typing.Union[file, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - **kwargs: typing.Type[Schema], - ): - return super().__new__( - cls, - *args, - additionalMetadata=additionalMetadata, - file=file, - _instantiation_metadata=_instantiation_metadata, - **kwargs, - ) - - -request_body_body = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=SchemaForRequestBodyMultipartFormData), - }, -) -_path = '/pet/{petId}/uploadImage' -_method = 'POST' -_auth = [ - 'petstore_auth', -] -SchemaFor200ResponseBodyApplicationJson = ApiResponse - - -@dataclass -class ApiResponseFor200(api_client.ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] - headers: Unset = unset - - -_response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_status_code_to_response = { - '200': _response_for_200, -} -_all_accept_content_types = ( - 'application/json', -) - - -class UploadFile(api_client.Api): - - def upload_file( - self: api_client.Api, - body: typing.Union[SchemaForRequestBodyMultipartFormData, Unset] = unset, - path_params: RequestPathParams = frozendict(), - content_type: str = 'multipart/form-data', - accept_content_types: typing.Tuple[str] = _all_accept_content_types, - ) -> typing.Union[ - ApiResponseFor200, - api_client.ApiResponseWithoutDeserialization - ]: - """ - uploads an image - Parameters use leading underscores to prevent collisions with user defined - parameters from the source openapi spec - """ - self._verify_typed_dict_inputs(RequestPathParams, path_params) - - _path_params = {} - for parameter in ( - request_path_pet_id, - ): - parameter_data = path_params.get(parameter.name, unset) - if parameter_data is unset: - continue - serialized_data = parameter.serialize(parameter_data) - _path_params.update(serialized_data) - - _headers = HTTPHeaderDict() - # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) - - _fields = None - _body = None - if body is not unset: - serialized_data = request_body_body.serialize(body, content_type) - _headers.add('Content-Type', content_type) - if 'fields' in serialized_data: - _fields = serialized_data['fields'] - elif 'body' in serialized_data: - _body = serialized_data['body'] - response = self.api_client.call_api( - resource_path=_path, - method=_method, - path_params=_path_params, - headers=_headers, - fields=_fields, - body=_body, - auth_settings=_auth, - ) - - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) - - if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) - - return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py index 62404922a6fc..f815449781a5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -105,14 +105,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, *args, additionalMetadata=additionalMetadata, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py index 53751178469a..3e4b5b4e44bf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -103,14 +103,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, *args, additionalMetadata=additionalMetadata, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py index 2ed9303649cd..bd874c07e3ed 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py @@ -36,7 +36,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py index a674b60efe4e..61bfd7dc7d53 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -77,13 +77,13 @@ class SchemaFor200ResponseBodyApplicationJson( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py index bf7861386a3d..b905d60bc29c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py index 881f91dc5c48..f54e82eec398 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py index 7bf386a6936b..3c84f45e584c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py index 22d7f23164a0..c55c22b4258f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py index 558f9086b3cf..644e5c817757 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py index 88b859ff00ba..fba5cf8ddbe9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py @@ -36,7 +36,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py index 9c5583d5c6d8..d5605304c1bc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py index 478b4869d829..da572bf71058 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py index b9aa62e0c2a6..da285ca93740 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py @@ -36,7 +36,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py index 37fed9bcf273..e16227af6b3a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py @@ -37,7 +37,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index 3aa0d288d589..c6918355c9cd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -35,7 +35,6 @@ Schema, FileIO, BinarySchema, - InstantiationMetadata, date, datetime, none_type, @@ -811,9 +810,8 @@ def deserialize(self, response: urllib3.HTTPResponse, configuration: Configurati else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) body_schema = self.content[content_type].schema - _instantiation_metadata = InstantiationMetadata(from_server=True, configuration=configuration) deserialized_body = body_schema._from_openapi_data( - body_data, _instantiation_metadata=_instantiation_metadata) + body_data, _configuration=configuration) elif streamed: response.release_conn() diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index 2c5686051176..6078bb2dbae1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -82,13 +82,13 @@ class map_property( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'map_property': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -107,13 +107,13 @@ class _additional_properties( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> '_additional_properties': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -121,13 +121,13 @@ def __new__( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'map_of_map_property': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) anytype_1 = AnyTypeSchema @@ -145,12 +145,12 @@ class empty_map( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'empty_map': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -163,13 +163,13 @@ class map_with_undeclared_properties_string( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'map_with_undeclared_properties_string': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -185,7 +185,7 @@ def __new__( map_with_undeclared_properties_anytype_3: typing.Union[map_with_undeclared_properties_anytype_3, Unset] = unset, empty_map: typing.Union[empty_map, Unset] = unset, map_with_undeclared_properties_string: typing.Union[map_with_undeclared_properties_string, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'AdditionalPropertiesClass': return super().__new__( @@ -199,6 +199,6 @@ def __new__( map_with_undeclared_properties_anytype_3=map_with_undeclared_properties_anytype_3, empty_map=empty_map, map_with_undeclared_properties_string=map_with_undeclared_properties_string, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py index c94a35d111be..fee5e18bcd0b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -86,13 +86,13 @@ def _items(cls) -> typing.Type['EnumClass']: def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'AdditionalPropertiesWithArrayOfEnums': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py index 4bcd72165671..ed6eb84f2b13 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -77,12 +77,12 @@ class Address( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Address': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index 2e1a97f9ffa4..0a7ee8a9bbfd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -93,7 +93,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], className: className, color: typing.Union[color, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Animal': return super().__new__( @@ -101,7 +101,7 @@ def __new__( *args, className=className, color=color, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index be131584f2c3..cc4fe75682ac 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py index 201a8188f58a..6f88e92b3a5b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -82,7 +82,7 @@ def __new__( code: typing.Union[code, Unset] = unset, type: typing.Union[type, Unset] = unset, message: typing.Union[message, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ApiResponse': return super().__new__( @@ -91,6 +91,6 @@ def __new__( code=code, type=type, message=message, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py index c85b60cf1ce3..14cc41447769 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -107,13 +107,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, None, ], origin: typing.Union[origin, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Apple': return super().__new__( cls, *args, origin=origin, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py index 5e423efafba6..7a783a792618 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -84,12 +84,12 @@ def __new__( *args: typing.Union[dict, frozendict, ], cultivar: cultivar, mealy: typing.Union[mealy, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'AppleReq': return super().__new__( cls, *args, cultivar=cultivar, mealy=mealy, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py index c2edbaeb0efa..bf544e435839 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index b7e1221340d0..aab971e0126c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -88,13 +88,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], ArrayArrayNumber: typing.Union[ArrayArrayNumber, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ArrayOfArrayOfNumberOnly': return super().__new__( cls, *args, ArrayArrayNumber=ArrayArrayNumber, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index e394fe933116..103a013aa955 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 7ff4a959c9cb..bbaa209e0b96 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -83,13 +83,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], ArrayNumber: typing.Union[ArrayNumber, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ArrayOfNumberOnly': return super().__new__( cls, *args, ArrayNumber=ArrayNumber, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index c94a91a879db..fd4f706c77ba 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -111,7 +111,7 @@ def __new__( array_of_string: typing.Union[array_of_string, Unset] = unset, array_array_of_integer: typing.Union[array_array_of_integer, Unset] = unset, array_array_of_model: typing.Union[array_array_of_model, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ArrayTest': return super().__new__( @@ -120,7 +120,7 @@ def __new__( array_of_string=array_of_string, array_array_of_integer=array_array_of_integer, array_array_of_model=array_array_of_model, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py index 79a9aad5fd75..8f55d11fb398 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py index fe60e91a7ba0..599a3f18133a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -81,13 +81,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], lengthCm: lengthCm, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Banana': return super().__new__( cls, *args, lengthCm=lengthCm, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py index bf3fac7cb945..d1d3f423ad20 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -84,12 +84,12 @@ def __new__( *args: typing.Union[dict, frozendict, ], lengthCm: lengthCm, sweet: typing.Union[sweet, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'BananaReq': return super().__new__( cls, *args, lengthCm=lengthCm, sweet=sweet, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py index 81ce5b09a51f..c7227c6d0884 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py index bfff57cb0824..916d0163ba02 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -95,13 +95,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], className: className, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'BasquePig': return super().__new__( cls, *args, className=className, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py index 263bdbdcdd76..4bfefa998fe8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py index c40292d6ee23..32bb99030a46 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py index 1e9d2b12f8d4..2cc55f390797 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -88,7 +88,7 @@ def __new__( Capital_Snake: typing.Union[Capital_Snake, Unset] = unset, SCA_ETH_Flow_Points: typing.Union[SCA_ETH_Flow_Points, Unset] = unset, ATT_NAME: typing.Union[ATT_NAME, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Capitalization': return super().__new__( @@ -100,6 +100,6 @@ def __new__( Capital_Snake=Capital_Snake, SCA_ETH_Flow_Points=SCA_ETH_Flow_Points, ATT_NAME=ATT_NAME, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index 5bcbd3abdad7..170ffbedc345 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -96,13 +96,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Cat': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index 549885a2e27c..e9c7e8ce60c6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -78,13 +78,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], declawed: typing.Union[declawed, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'CatAllOf': return super().__new__( cls, *args, declawed=declawed, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py index 94a7ff0a0c3c..55a23fb99a59 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -83,7 +83,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], name: name, id: typing.Union[id, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Category': return super().__new__( @@ -91,6 +91,6 @@ def __new__( *args, name=name, id=id, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index 3d5cc122bfa1..ba9b39bec117 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -96,13 +96,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ChildCat': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index c152c0f10605..728dfef2ef1b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -78,13 +78,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], name: typing.Union[name, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ChildCatAllOf': return super().__new__( cls, *args, name=name, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py index 4f1e9ed14a54..e487ff57e72f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -79,13 +79,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _class: typing.Union[_class, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ClassModel': return super().__new__( cls, *args, _class=_class, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py index a476e5d92c3b..ca8b37f7cfe0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -78,13 +78,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], client: typing.Union[client, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Client': return super().__new__( cls, *args, client=client, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index 5c1c3815296a..eec32e53e9b3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -96,13 +96,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ComplexQuadrilateral': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py index f91b041e09e1..de77940b972b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -92,13 +92,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], quadrilateralType: typing.Union[quadrilateralType, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ComplexQuadrilateralAllOf': return super().__new__( cls, *args, quadrilateralType=quadrilateralType, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py index bab2f27e022a..d8e8e670f03b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -131,12 +131,12 @@ class anyOf_9( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ComposedAnyOfDifferentTypesNoValidations': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py index 4582184e4653..5fc3f82f5162 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py index 3ea21ab42be9..cd1f5be59c22 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -97,10 +97,10 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[bool, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'ComposedBool': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py index d6a1f7cced53..6915f1d636f1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -97,10 +97,10 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'ComposedNone': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py index 928f58b5bd80..ae586d764f9e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -97,10 +97,10 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[float, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'ComposedNumber': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py index fe8ec7865805..30b78e94cdc8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -97,12 +97,12 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ComposedObject': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py index 071e8b2febfe..f4e40d70397f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -100,13 +100,13 @@ class oneOf_4( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'oneOf_4': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -149,13 +149,13 @@ class oneOf_6( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ComposedOneOfDifferentTypes': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py index 86b17805c8a7..3ddde890852f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -97,10 +97,10 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[str, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'ComposedString': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py index 49fc619cfc2c..22c11f08f12b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composition_in_property.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -109,13 +109,13 @@ class allOf_0( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'someProp': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -124,13 +124,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], someProp: typing.Union[someProp, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'CompositionInProperty': return super().__new__( cls, *args, someProp=someProp, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py index af48c5f606b4..596551cc08c4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py index 938f8b4f88dc..c8af4a13ca86 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -95,13 +95,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], className: className, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'DanishPig': return super().__new__( cls, *args, className=className, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py index fe399c0a759c..0eaa12b59d16 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py index d593ace1dec7..5c527be0d857 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py index 310dad4babf2..1904c75bf5fe 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py index 24c443deeb90..ac7566304df0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index f48bfc6fb33b..8348b37bb385 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -96,13 +96,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Dog': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 88c86c052618..cb9155bfd4c8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -78,13 +78,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], breed: typing.Union[breed, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'DogAllOf': return super().__new__( cls, *args, breed=breed, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index 4d61e721a6bb..ba0c560245ce 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -110,7 +110,7 @@ def __new__( shapeOrNull: typing.Union['ShapeOrNull', Unset] = unset, nullableShape: typing.Union['NullableShape', Unset] = unset, shapes: typing.Union[shapes, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Drawing': return super().__new__( @@ -120,7 +120,7 @@ def __new__( shapeOrNull=shapeOrNull, nullableShape=nullableShape, shapes=shapes, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index 9ea913052e81..6f56d337f9f9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -125,7 +125,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], just_symbol: typing.Union[just_symbol, Unset] = unset, array_enum: typing.Union[array_enum, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'EnumArrays': return super().__new__( @@ -133,6 +133,6 @@ def __new__( *args, just_symbol=just_symbol, array_enum=array_enum, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index 17828f28029b..a8d67b2dab9e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 5f4fa186bc08..3f82faaa3e87 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -209,7 +209,7 @@ def __new__( StringEnumWithDefaultValue: typing.Union['StringEnumWithDefaultValue', Unset] = unset, IntegerEnumWithDefaultValue: typing.Union['IntegerEnumWithDefaultValue', Unset] = unset, IntegerEnumOneValue: typing.Union['IntegerEnumOneValue', Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'EnumTest': return super().__new__( @@ -224,7 +224,7 @@ def __new__( StringEnumWithDefaultValue=StringEnumWithDefaultValue, IntegerEnumWithDefaultValue=IntegerEnumWithDefaultValue, IntegerEnumOneValue=IntegerEnumOneValue, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index 5e96fa2799fa..9b105672ccfd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -96,13 +96,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'EquilateralTriangle': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py index 785966c5dda8..0094bf8a7356 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -92,13 +92,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], triangleType: typing.Union[triangleType, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'EquilateralTriangleAllOf': return super().__new__( cls, *args, triangleType=triangleType, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py index c5c048042c91..0f6d81d67850 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -80,13 +80,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], sourceURI: typing.Union[sourceURI, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'File': return super().__new__( cls, *args, sourceURI=sourceURI, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index a6bf45a144b7..da66de4cea09 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -93,7 +93,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], file: typing.Union['File', Unset] = unset, files: typing.Union[files, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'FileSchemaTestClass': return super().__new__( @@ -101,7 +101,7 @@ def __new__( *args, file=file, files=files, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py index 3535312831d3..e33a34d6e68a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -78,13 +78,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], bar: typing.Union[bar, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Foo': return super().__new__( cls, *args, bar=bar, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py index 4a5e0140489e..33488e9e9da0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -225,7 +225,7 @@ def __new__( pattern_with_digits: typing.Union[pattern_with_digits, Unset] = unset, pattern_with_digits_and_delimiter: typing.Union[pattern_with_digits_and_delimiter, Unset] = unset, noneProp: typing.Union[noneProp, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'FormatTest': return super().__new__( @@ -251,6 +251,6 @@ def __new__( pattern_with_digits=pattern_with_digits, pattern_with_digits_and_delimiter=pattern_with_digits_and_delimiter, noneProp=noneProp, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index 37b155280237..52c5c7aab57b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -98,14 +98,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], color: typing.Union[color, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Fruit': return super().__new__( cls, *args, color=color, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index 6f5098eaaf54..53e0a8b3afc9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -98,13 +98,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'FruitReq': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index 03b81dffb459..b49581a16b62 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -98,14 +98,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], color: typing.Union[color, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'GmFruit': return super().__new__( cls, *args, color=color, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index d99b83df17a8..2e4f462d9da7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -91,14 +91,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], pet_type: pet_type, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'GrandparentAnimal': return super().__new__( cls, *args, pet_type=pet_type, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index bec74170f914..81d3661bd5a4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -80,7 +80,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], bar: typing.Union[bar, Unset] = unset, foo: typing.Union[foo, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'HasOnlyReadOnly': return super().__new__( @@ -88,6 +88,6 @@ def __new__( *args, bar=bar, foo=foo, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py index 28cace6c66df..d91afa53f58c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -85,12 +85,12 @@ class NullableMessage( def __new__( cls, *args: typing.Union[str, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'NullableMessage': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -98,13 +98,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], NullableMessage: typing.Union[NullableMessage, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'HealthCheckResult': return super().__new__( cls, *args, NullableMessage=NullableMessage, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py index 474bc2f1b6bb..6354bbc1b51e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -82,14 +82,14 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], string: typing.Union['Foo', Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'InlineResponseDefault': return super().__new__( cls, *args, string=string, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index f9ce559597f3..c84faf0649f1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py index 2ce5bf788e24..1d40c6b3ecf1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index 2a401beda7b2..101a6b0dfc61 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index 198416fa503a..9c6387d7e308 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py index d553aa4002f7..1458e6f6f0d9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py index d1be99d4e438..d29d444f2f5a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index 3a922c9c856c..2868d6d93522 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -96,13 +96,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'IsoscelesTriangle': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py index 57612019a9e6..f9a96472196b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -92,13 +92,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], triangleType: typing.Union[triangleType, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'IsoscelesTriangleAllOf': return super().__new__( cls, *args, triangleType=triangleType, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index a819f0a5e46f..31525a3ab80f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -108,13 +108,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Mammal': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index 640f40bac9a6..6776bad6d93c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -87,13 +87,13 @@ class _additional_properties( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> '_additional_properties': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -101,13 +101,13 @@ def __new__( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'map_map_of_string': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -141,13 +141,13 @@ def LOWER(cls): def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'map_of_enum_string': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -161,13 +161,13 @@ class direct_map( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'direct_map': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -184,7 +184,7 @@ def __new__( map_of_enum_string: typing.Union[map_of_enum_string, Unset] = unset, direct_map: typing.Union[direct_map, Unset] = unset, indirect_map: typing.Union['StringBooleanMap', Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'MapTest': return super().__new__( @@ -194,7 +194,7 @@ def __new__( map_of_enum_string=map_of_enum_string, direct_map=direct_map, indirect_map=indirect_map, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index ee0bf81b1a0d..de6e82588446 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -88,13 +88,13 @@ def _additional_properties(cls) -> typing.Type['Animal']: def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'map': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -105,7 +105,7 @@ def __new__( uuid: typing.Union[uuid, Unset] = unset, dateTime: typing.Union[dateTime, Unset] = unset, map: typing.Union[map, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'MixedPropertiesAndAdditionalPropertiesClass': return super().__new__( @@ -114,7 +114,7 @@ def __new__( uuid=uuid, dateTime=dateTime, map=map, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py index 98b30389ae44..da8c9d0d86a6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -82,13 +82,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], name: typing.Union[name, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Model200Response': return super().__new__( cls, *args, name=name, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py index a3bfcac60190..6785ae9cef23 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -80,12 +80,12 @@ class ModelReturn( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ModelReturn': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py index aa107446c43d..04afed1a7749 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -88,7 +88,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], amount: amount, currency: currency, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Money': return super().__new__( @@ -96,7 +96,7 @@ def __new__( *args, amount=amount, currency=currency, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py index 3be7a9658b5e..0c8ea4e15aff 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -87,7 +87,7 @@ def __new__( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], name: name, snake_case: typing.Union[snake_case, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Name': return super().__new__( @@ -95,6 +95,6 @@ def __new__( *args, name=name, snake_case=snake_case, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py index a504545ae442..171d2258af55 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -84,12 +84,12 @@ def __new__( *args: typing.Union[dict, frozendict, ], id: id, petId: typing.Union[petId, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'NoAdditionalProperties': return super().__new__( cls, *args, id=id, petId=petId, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py index 821225c10255..4812bccb0c72 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -83,12 +83,12 @@ class integer_prop( def __new__( cls, *args: typing.Union[int, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'integer_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -102,12 +102,12 @@ class number_prop( def __new__( cls, *args: typing.Union[float, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'number_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -121,12 +121,12 @@ class boolean_prop( def __new__( cls, *args: typing.Union[bool, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'boolean_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -140,12 +140,12 @@ class string_prop( def __new__( cls, *args: typing.Union[str, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'string_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -159,12 +159,12 @@ class date_prop( def __new__( cls, *args: typing.Union[None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'date_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -178,12 +178,12 @@ class datetime_prop( def __new__( cls, *args: typing.Union[None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'datetime_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -197,12 +197,12 @@ class array_nullable_prop( def __new__( cls, *args: typing.Union[list, tuple, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'array_nullable_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -216,12 +216,12 @@ class array_and_items_nullable_prop( def __new__( cls, *args: typing.Union[list, tuple, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'array_and_items_nullable_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) @@ -240,13 +240,13 @@ class _items( def __new__( cls, *args: typing.Union[dict, frozendict, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> '_items': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -262,13 +262,13 @@ class object_nullable_prop( def __new__( cls, *args: typing.Union[dict, frozendict, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'object_nullable_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -291,26 +291,26 @@ class _additional_properties( def __new__( cls, *args: typing.Union[dict, frozendict, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> '_additional_properties': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) def __new__( cls, *args: typing.Union[dict, frozendict, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'object_and_items_nullable_prop': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -330,13 +330,13 @@ class _additional_properties( def __new__( cls, *args: typing.Union[dict, frozendict, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> '_additional_properties': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -344,13 +344,13 @@ def __new__( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'object_items_nullable': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -365,13 +365,13 @@ class _additional_properties( def __new__( cls, *args: typing.Union[dict, frozendict, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> '_additional_properties': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -391,7 +391,7 @@ def __new__( object_nullable_prop: typing.Union[object_nullable_prop, Unset] = unset, object_and_items_nullable_prop: typing.Union[object_and_items_nullable_prop, Unset] = unset, object_items_nullable: typing.Union[object_items_nullable, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'NullableClass': return super().__new__( @@ -409,6 +409,6 @@ def __new__( object_nullable_prop=object_nullable_prop, object_and_items_nullable_prop=object_and_items_nullable_prop, object_items_nullable=object_items_nullable, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index 14193cfacbec..a219893fbaa1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -110,13 +110,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'NullableShape': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py index a311a0c656ed..987f2a371596 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -78,10 +78,10 @@ class NullableString( def __new__( cls, *args: typing.Union[str, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'NullableString': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py index 23b3e0befb28..82148f83add9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py index 698cbc0b7846..f34d96909fa3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -78,13 +78,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], JustNumber: typing.Union[JustNumber, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'NumberOnly': return super().__new__( cls, *args, JustNumber=JustNumber, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index 129a0eacb17d..ed0714bf90fb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py index 1a230f98b737..9fc8af65acde 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index b16983b11558..fd9839f9c90a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -88,7 +88,7 @@ def __new__( myNumber: typing.Union['NumberWithValidations', Unset] = unset, myString: typing.Union[myString, Unset] = unset, myBoolean: typing.Union[myBoolean, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ObjectModelWithRefProps': return super().__new__( @@ -97,7 +97,7 @@ def __new__( myNumber=myNumber, myString=myString, myBoolean=myBoolean, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py index c840eab6369f..b9ecbec7b4a7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -86,7 +86,7 @@ def __new__( length: typing.Union[length, Unset] = unset, width: typing.Union[width, Unset] = unset, cost: typing.Union['Money', Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ObjectWithDecimalProperties': return super().__new__( @@ -95,7 +95,7 @@ def __new__( length=length, width=width, cost=cost, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py index 595655019ed7..857143f86488 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -90,12 +90,12 @@ class ObjectWithDifficultlyNamedProps( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ObjectWithDifficultlyNamedProps': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py index 16d6e23cb24e..2318269e8a42 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -109,13 +109,13 @@ class allOf_0( def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'someProp': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) @@ -124,13 +124,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], someProp: typing.Union[someProp, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ObjectWithInlineCompositionProperty': return super().__new__( cls, *args, someProp=someProp, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py index 91be6d02d1a8..4bf41af5c466 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -79,12 +79,12 @@ class ObjectWithValidations( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ObjectWithValidations': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py index 6f06e85a3be2..343ca34cc5cc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -114,7 +114,7 @@ def __new__( shipDate: typing.Union[shipDate, Unset] = unset, status: typing.Union[status, Unset] = unset, complete: typing.Union[complete, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Order': return super().__new__( @@ -126,6 +126,6 @@ def __new__( shipDate=shipDate, status=status, complete=complete, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index d93f03e849f2..20004fa3fc99 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -105,13 +105,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ParentPet': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index acdcad0903e5..400fc3cebe47 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -138,7 +138,7 @@ def __new__( category: typing.Union['Category', Unset] = unset, tags: typing.Union[tags, Unset] = unset, status: typing.Union[status, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Pet': return super().__new__( @@ -150,7 +150,7 @@ def __new__( category=category, tags=tags, status=status, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index 55baf6a7b35c..adfe1fea39f1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -106,13 +106,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Pig': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py index 56b09a2024f2..13871d566de9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -86,7 +86,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], name: typing.Union[name, Unset] = unset, enemyPlayer: typing.Union['Player', Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Player': return super().__new__( @@ -94,6 +94,6 @@ def __new__( *args, name=name, enemyPlayer=enemyPlayer, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index 2aecf52210ef..e127013a4127 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -106,13 +106,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Quadrilateral': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py index 384d18d11812..4b3b3f64070f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -97,7 +97,7 @@ def __new__( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], shapeType: shapeType, quadrilateralType: quadrilateralType, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'QuadrilateralInterface': return super().__new__( @@ -105,6 +105,6 @@ def __new__( *args, shapeType=shapeType, quadrilateralType=quadrilateralType, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py index 5a4c783fa0b8..6813a6a665bf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -80,7 +80,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], bar: typing.Union[bar, Unset] = unset, baz: typing.Union[baz, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ReadOnlyFirst': return super().__new__( @@ -88,6 +88,6 @@ def __new__( *args, bar=bar, baz=baz, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 83fd87c719d5..20af1fdfa5b4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -96,13 +96,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ScaleneTriangle': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py index 5a3d2514eb46..551a5991a805 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -92,13 +92,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], triangleType: typing.Union[triangleType, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ScaleneTriangleAllOf': return super().__new__( cls, *args, triangleType=triangleType, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index b29f83c9976d..4c347898fa84 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -106,13 +106,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Shape': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index 8275e48bb955..0d5e42fcba43 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -110,13 +110,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'ShapeOrNull': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index 273512a90138..e6afc2c14b50 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -96,13 +96,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SimpleQuadrilateral': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py index f45e4a2bb0dd..a84205f2f9f8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -92,13 +92,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], quadrilateralType: typing.Union[quadrilateralType, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SimpleQuadrilateralAllOf': return super().__new__( cls, *args, quadrilateralType=quadrilateralType, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py index 1565cd8b9793..a5103057cdde 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -95,13 +95,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SomeObject': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 09c039f8fe60..1c2c38f7831d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -80,13 +80,13 @@ def __new__( cls, *args: typing.Union[dict, frozendict, ], a: typing.Union[a, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'SpecialModelName': return super().__new__( cls, *args, a=a, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py index 2b661afe3c24..8f0c2b0e0f69 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index cead5d15b7bd..1828f65f8139 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -77,12 +77,12 @@ class StringBooleanMap( def __new__( cls, *args: typing.Union[dict, frozendict, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'StringBooleanMap': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index b96f2559062d..87c168cb0137 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -130,10 +130,10 @@ def DOUBLE_QUOTE_WITH_NEWLINE(cls): def __new__( cls, *args: typing.Union[str, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, ) -> 'StringEnum': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index c2547b157a66..d60c3115eadf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py index 8bbc226e3476..61a533a9d3f5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py index 2e533571785e..7cf869932285 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -80,7 +80,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], id: typing.Union[id, Unset] = unset, name: typing.Union[name, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Tag': return super().__new__( @@ -88,6 +88,6 @@ def __new__( *args, id=id, name=name, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index 115cde5048f3..bf4062c15046 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -108,13 +108,13 @@ def _composed_schemas(cls): def __new__( cls, *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Triangle': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py index 83428cd27113..2c2f274801a4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -97,7 +97,7 @@ def __new__( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], shapeType: shapeType, triangleType: triangleType, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'TriangleInterface': return super().__new__( @@ -105,6 +105,6 @@ def __new__( *args, shapeType=shapeType, triangleType=triangleType, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py index 1de764931197..a8c3355a5c55 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -92,13 +92,13 @@ class objectWithNoDeclaredPropsNullable( def __new__( cls, *args: typing.Union[dict, frozendict, None, ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'objectWithNoDeclaredPropsNullable': return super().__new__( cls, *args, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) anyTypeProp = AnyTypeSchema @@ -120,7 +120,7 @@ def __new__( objectWithNoDeclaredPropsNullable: typing.Union[objectWithNoDeclaredPropsNullable, Unset] = unset, anyTypeProp: typing.Union[anyTypeProp, Unset] = unset, anyTypePropNullable: typing.Union[anyTypePropNullable, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'User': return super().__new__( @@ -138,6 +138,6 @@ def __new__( objectWithNoDeclaredPropsNullable=objectWithNoDeclaredPropsNullable, anyTypeProp=anyTypeProp, anyTypePropNullable=anyTypePropNullable, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py index d33c830522f0..45cee6bfcd9f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -99,7 +99,7 @@ def __new__( className: className, hasBaleen: typing.Union[hasBaleen, Unset] = unset, hasTeeth: typing.Union[hasTeeth, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Whale': return super().__new__( @@ -108,6 +108,6 @@ def __new__( className=className, hasBaleen=hasBaleen, hasTeeth=hasTeeth, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py index 2ea5d4039ce7..3b3fe6cac406 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -38,7 +38,7 @@ BinarySchema, NoneSchema, none_type, - InstantiationMetadata, + Configuration, Unset, unset, ComposedBase, @@ -123,7 +123,7 @@ def __new__( *args: typing.Union[dict, frozendict, ], className: className, type: typing.Union[type, Unset] = unset, - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], ) -> 'Zebra': return super().__new__( @@ -131,6 +131,6 @@ def __new__( *args, className=className, type=type, - _instantiation_metadata=_instantiation_metadata, + _configuration=_configuration, **kwargs, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py index 58ffd544224b..1d0861194acc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py @@ -9,7 +9,7 @@ Generated by: https://openapi-generator.tech """ -from collections import defaultdict +from collections import defaultdict, abc from datetime import date, datetime, timedelta # noqa: F401 from dataclasses import dataclass import functools @@ -70,21 +70,22 @@ def update(d: dict, u: dict): for k, v in u.items(): if not v: continue - d[k] = d[k] | v - return d + if k not in d: + d[k] = v + else: + d[k] = d[k] | v -class InstantiationMetadata: +class ValidationMetadata(frozendict): """ - A class to store metadata that is needed when instantiating OpenApi Schema subclasses + A class storing metadata that is needed to validate OpenApi Schema payloads """ - def __init__( - self, + def __new__( + cls, path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), from_server: bool = False, configuration: typing.Optional[Configuration] = None, base_classes: typing.FrozenSet[typing.Type] = frozenset(), - path_to_schemas: typing.Optional[typing.Dict[str, typing.Set[typing.Type]]] = None, ): """ Args: @@ -98,23 +99,30 @@ def __init__( - one can disable validation checking base_classes: when deserializing data that matches multiple schemas, this is used to store the schemas that have been traversed. This is used to stop processing when a cycle is seen. - path_to_schemas: a dict that goes from path to a list of classes at each path location """ - self.path_to_item = path_to_item - self.from_server = from_server - self.configuration = configuration - self.base_classes = base_classes - if path_to_schemas is None: - path_to_schemas = defaultdict(set) - self.path_to_schemas = path_to_schemas + return super().__new__( + cls, + path_to_item=path_to_item, + from_server=from_server, + configuration=configuration, + base_classes=base_classes, + ) - def __repr__(self): - return str(self.__dict__) + @property + def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: + return self.get('path_to_item') - def __eq__(self, other): - if not isinstance(other, InstantiationMetadata): - return False - return self.__dict__ == other.__dict__ + @property + def from_server(self) -> bool: + return self.get('from_server') + + @property + def configuration(self) -> typing.Optional[Configuration]: + return self.get('configuration') + + @property + def base_classes(self) -> typing.FrozenSet[typing.Type]: + return self.get('base_classes') class ValidatorBase: @@ -148,30 +156,30 @@ def __raise_validation_error_message(value, constraint_msg, constraint_value, pa @classmethod def __check_str_validations(cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata): + validation_metadata: ValidationMetadata): - if (cls.__is_json_validation_enabled('maxLength', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('maxLength', validation_metadata.configuration) and 'max_length' in validations and len(input_values) > validations['max_length']): cls.__raise_validation_error_message( value=input_values, constraint_msg="length must be less than or equal to", constraint_value=validations['max_length'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('minLength', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('minLength', validation_metadata.configuration) and 'min_length' in validations and len(input_values) < validations['min_length']): cls.__raise_validation_error_message( value=input_values, constraint_msg="length must be greater than or equal to", constraint_value=validations['min_length'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) checked_value = input_values - if (cls.__is_json_validation_enabled('pattern', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('pattern', validation_metadata.configuration) and 'regex' in validations): for regex_dict in validations['regex']: flags = regex_dict.get('flags', 0) @@ -183,42 +191,42 @@ def __check_str_validations(cls, value=input_values, constraint_msg="must match regular expression", constraint_value=regex_dict['pattern'], - path_to_item=_instantiation_metadata.path_to_item, + path_to_item=validation_metadata.path_to_item, additional_txt=" with flags=`{}`".format(flags) ) cls.__raise_validation_error_message( value=input_values, constraint_msg="must match regular expression", constraint_value=regex_dict['pattern'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) @classmethod def __check_tuple_validations( cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata): + validation_metadata: ValidationMetadata): - if (cls.__is_json_validation_enabled('maxItems', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('maxItems', validation_metadata.configuration) and 'max_items' in validations and len(input_values) > validations['max_items']): cls.__raise_validation_error_message( value=input_values, constraint_msg="number of items must be less than or equal to", constraint_value=validations['max_items'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('minItems', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('minItems', validation_metadata.configuration) and 'min_items' in validations and len(input_values) < validations['min_items']): cls.__raise_validation_error_message( value=input_values, constraint_msg="number of items must be greater than or equal to", constraint_value=validations['min_items'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('uniqueItems', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('uniqueItems', validation_metadata.configuration) and 'unique_items' in validations and validations['unique_items'] and input_values): unique_items = [] for item in input_values: @@ -229,41 +237,41 @@ def __check_tuple_validations( value=input_values, constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", constraint_value='unique_items==True', - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) @classmethod def __check_dict_validations( cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata): + validation_metadata: ValidationMetadata): - if (cls.__is_json_validation_enabled('maxProperties', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('maxProperties', validation_metadata.configuration) and 'max_properties' in validations and len(input_values) > validations['max_properties']): cls.__raise_validation_error_message( value=input_values, constraint_msg="number of properties must be less than or equal to", constraint_value=validations['max_properties'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('minProperties', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('minProperties', validation_metadata.configuration) and 'min_properties' in validations and len(input_values) < validations['min_properties']): cls.__raise_validation_error_message( value=input_values, constraint_msg="number of properties must be greater than or equal to", constraint_value=validations['min_properties'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) @classmethod def __check_numeric_validations( cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata): + validation_metadata: ValidationMetadata): if cls.__is_json_validation_enabled('multipleOf', - _instantiation_metadata.configuration) and 'multiple_of' in validations: + validation_metadata.configuration) and 'multiple_of' in validations: multiple_of_values = validations['multiple_of'] for multiple_of_value in multiple_of_values: if (isinstance(input_values, decimal.Decimal) and @@ -274,7 +282,7 @@ def __check_numeric_validations( value=input_values, constraint_msg="value must be a multiple of", constraint_value=multiple_of_value, - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) checking_max_or_min_values = {'exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', @@ -284,44 +292,44 @@ def __check_numeric_validations( max_val = input_values min_val = input_values - if (cls.__is_json_validation_enabled('exclusiveMaximum', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('exclusiveMaximum', validation_metadata.configuration) and 'exclusive_maximum' in validations and max_val >= validations['exclusive_maximum']): cls.__raise_validation_error_message( value=input_values, constraint_msg="must be a value less than", constraint_value=validations['exclusive_maximum'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('maximum', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('maximum', validation_metadata.configuration) and 'inclusive_maximum' in validations and max_val > validations['inclusive_maximum']): cls.__raise_validation_error_message( value=input_values, constraint_msg="must be a value less than or equal to", constraint_value=validations['inclusive_maximum'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('exclusiveMinimum', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('exclusiveMinimum', validation_metadata.configuration) and 'exclusive_minimum' in validations and min_val <= validations['exclusive_minimum']): cls.__raise_validation_error_message( value=input_values, constraint_msg="must be a value greater than", constraint_value=validations['exclusive_maximum'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) - if (cls.__is_json_validation_enabled('minimum', _instantiation_metadata.configuration) and + if (cls.__is_json_validation_enabled('minimum', validation_metadata.configuration) and 'inclusive_minimum' in validations and min_val < validations['inclusive_minimum']): cls.__raise_validation_error_message( value=input_values, constraint_msg="must be a value greater than or equal to", constraint_value=validations['inclusive_minimum'], - path_to_item=_instantiation_metadata.path_to_item + path_to_item=validation_metadata.path_to_item ) @classmethod @@ -329,18 +337,18 @@ def _check_validations_for_types( cls, validations, input_values, - _instantiation_metadata: InstantiationMetadata + validation_metadata: ValidationMetadata ): if isinstance(input_values, str): - cls.__check_str_validations(validations, input_values, _instantiation_metadata) + cls.__check_str_validations(validations, input_values, validation_metadata) elif isinstance(input_values, tuple): - cls.__check_tuple_validations(validations, input_values, _instantiation_metadata) + cls.__check_tuple_validations(validations, input_values, validation_metadata) elif isinstance(input_values, frozendict): - cls.__check_dict_validations(validations, input_values, _instantiation_metadata) + cls.__check_dict_validations(validations, input_values, validation_metadata) elif isinstance(input_values, decimal.Decimal): - cls.__check_numeric_validations(validations, input_values, _instantiation_metadata) + cls.__check_numeric_validations(validations, input_values, validation_metadata) try: - return super()._validate_validations_pass(input_values, _instantiation_metadata) + return super()._validate_validations_pass(input_values, validation_metadata) except AttributeError: return True @@ -349,7 +357,7 @@ class Validator(typing.Protocol): def _validate_validations_pass( cls, input_values, - _instantiation_metadata: InstantiationMetadata + validation_metadata: ValidationMetadata ): pass @@ -360,11 +368,11 @@ class SchemaValidator(ValidatorBase): def _validate_validations_pass( cls, input_values, - _instantiation_metadata: InstantiationMetadata + validation_metadata: ValidationMetadata ): - cls._check_validations_for_types(validations, input_values, _instantiation_metadata) + cls._check_validations_for_types(validations, input_values, validation_metadata) try: - return super()._validate_validations_pass(input_values, _instantiation_metadata) + return super()._validate_validations_pass(input_values, validation_metadata) except AttributeError: return True @@ -596,7 +604,7 @@ def as_date(self) -> date: return DEFAULT_ISOPARSER.parse_isodate(self) @classmethod - def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + def _validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: DEFAULT_ISOPARSER.parse_isodate(arg) @@ -604,16 +612,20 @@ def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: In except ValueError: raise ApiValueError( "Value does not conform to the required ISO-8601 date format. " - "Invalid value '{}' for type date at {}".format(arg, _instantiation_metadata.path_to_item) + "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) ) @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): """ DateBase _validate """ - cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) - return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + cls._validate_format(arg, validation_metadata=validation_metadata) + return super()._validate(arg, validation_metadata=validation_metadata) class DateTimeBase: @@ -623,7 +635,7 @@ def as_datetime(self) -> datetime: return DEFAULT_ISOPARSER.parse_isodatetime(self) @classmethod - def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + def _validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: DEFAULT_ISOPARSER.parse_isodatetime(arg) @@ -631,16 +643,20 @@ def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: In except ValueError: raise ApiValueError( "Value does not conform to the required ISO-8601 datetime format. " - "Invalid value '{}' for type datetime at {}".format(arg, _instantiation_metadata.path_to_item) + "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) ) @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ DateTimeBase _validate """ - cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) - return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + cls._validate_format(arg, validation_metadata=validation_metadata) + return super()._validate(arg, validation_metadata=validation_metadata) class DecimalBase(StrBase): @@ -656,7 +672,7 @@ def as_decimal(self) -> decimal.Decimal: return decimal.Decimal(self) @classmethod - def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + def _validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): if isinstance(arg, str): try: decimal.Decimal(arg) @@ -664,16 +680,20 @@ def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: In except decimal.InvalidOperation: raise ApiValueError( "Value cannot be converted to a decimal. " - "Invalid value '{}' for type decimal at {}".format(arg, _instantiation_metadata.path_to_item) + "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) ) @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ DecimalBase _validate """ - cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) - return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + cls._validate_format(arg, validation_metadata=validation_metadata) + return super()._validate(arg, validation_metadata=validation_metadata) class NumberBase: @@ -710,7 +730,7 @@ def as_float(self) -> float: class ListBase: @classmethod - def _validate_items(cls, list_items, _instantiation_metadata: InstantiationMetadata): + def _validate_items(cls, list_items, validation_metadata: ValidationMetadata): """ Ensures that: - values passed in for items are valid @@ -727,22 +747,26 @@ def _validate_items(cls, list_items, _instantiation_metadata: InstantiationMetad # if we have definitions for an items schema, use it # otherwise accept anything item_cls = getattr(cls, '_items', AnyTypeSchema) - path_to_schemas = defaultdict(set) + path_to_schemas = {} for i, value in enumerate(list_items): if isinstance(value, item_cls): continue - item_instantiation_metadata = InstantiationMetadata( - from_server=_instantiation_metadata.from_server, - configuration=_instantiation_metadata.configuration, - path_to_item=_instantiation_metadata.path_to_item+(i,) + item_validation_metadata = ValidationMetadata( + from_server=validation_metadata.from_server, + configuration=validation_metadata.configuration, + path_to_item=validation_metadata.path_to_item+(i,) ) other_path_to_schemas = item_cls._validate( - value, _instantiation_metadata=item_instantiation_metadata) + value, validation_metadata=item_validation_metadata) update(path_to_schemas, other_path_to_schemas) return path_to_schemas @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ ListBase _validate We return dynamic classes of different bases depending upon the inputs @@ -758,34 +782,41 @@ def _validate(cls, *args, _instantiation_metadata: typing.Optional[Instantiation ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - arg = args[0] - _path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + _path_to_schemas = super()._validate(arg, validation_metadata=validation_metadata) if not isinstance(arg, tuple): return _path_to_schemas - if cls in _instantiation_metadata.base_classes: + if cls in validation_metadata.base_classes: # we have already moved through this class so stop here return _path_to_schemas - _instantiation_metadata.base_classes |= frozenset({cls}) - other_path_to_schemas = cls._validate_items(arg, _instantiation_metadata=_instantiation_metadata) + updated_vm = ValidationMetadata( + configuration=validation_metadata.configuration, + from_server=validation_metadata.from_server, + path_to_item=validation_metadata.path_to_item, + base_classes=validation_metadata.base_classes | frozenset({cls}) + ) + other_path_to_schemas = cls._validate_items(arg, validation_metadata=updated_vm) update(_path_to_schemas, other_path_to_schemas) return _path_to_schemas @classmethod - def _get_items(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _get_items( + cls: 'Schema', + arg: typing.List[typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): ''' ListBase _get_items ''' - _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata - - list_items = args[0] + list_items = arg cast_items = [] # if we have definitions for an items schema, use it # otherwise accept anything cls_item_cls = getattr(cls, '_items', AnyTypeSchema) for i, value in enumerate(list_items): - item_path_to_item = _instantiation_metadata.path_to_item+(i,) - item_cls = _instantiation_metadata.path_to_schemas.get(item_path_to_item) + item_path_to_item = path_to_item + (i,) + item_cls = path_to_schemas.get(item_path_to_item) if item_cls is None: item_cls = cls_item_cls @@ -793,14 +824,11 @@ def _get_items(cls, *args, _instantiation_metadata: typing.Optional[Instantiatio cast_items.append(value) continue - item_instantiation_metadata = InstantiationMetadata( - configuration=_instantiation_metadata.configuration, - from_server=_instantiation_metadata.from_server, - path_to_item=item_path_to_item, - path_to_schemas=_instantiation_metadata.path_to_schemas, - ) new_value = item_cls._get_new_instance_without_conversion( - value, _instantiation_metadata=item_instantiation_metadata) + value, + item_path_to_item, + path_to_schemas + ) cast_items.append(new_value) return cast_items @@ -808,12 +836,12 @@ def _get_items(cls, *args, _instantiation_metadata: typing.Optional[Instantiatio class Discriminable: @classmethod - def _ensure_discriminator_value_present(cls, disc_property_name: str, _instantiation_metadata: InstantiationMetadata, *args): + def _ensure_discriminator_value_present(cls, disc_property_name: str, validation_metadata: ValidationMetadata, *args): if not args or args and disc_property_name not in args[0]: # The input data does not contain the discriminator property raise ApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: {}".format(disc_property_name, _instantiation_metadata.path_to_item) + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) ) @classmethod @@ -907,7 +935,7 @@ def _validate_arg_presence(cls, arg): ) @classmethod - def _validate_args(cls, arg, _instantiation_metadata: InstantiationMetadata): + def _validate_args(cls, arg, validation_metadata: ValidationMetadata): """ Ensures that: - values passed in for properties are valid @@ -920,7 +948,7 @@ def _validate_args(cls, arg, _instantiation_metadata: InstantiationMetadata): Raises: ApiTypeError - for missing required arguments, or for invalid properties """ - path_to_schemas = defaultdict(set) + path_to_schemas = {} for property_name, value in arg.items(): if property_name in cls._required_property_names or property_name in cls._property_names: schema = getattr(cls, property_name) @@ -928,21 +956,25 @@ def _validate_args(cls, arg, _instantiation_metadata: InstantiationMetadata): schema = cls._additional_properties else: raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( - value, cls, _instantiation_metadata.path_to_item+(property_name,) + value, cls, validation_metadata.path_to_item+(property_name,) )) if isinstance(value, schema): continue - arg_instantiation_metadata = InstantiationMetadata( - from_server=_instantiation_metadata.from_server, - configuration=_instantiation_metadata.configuration, - path_to_item=_instantiation_metadata.path_to_item+(property_name,) + arg_validation_metadata = ValidationMetadata( + from_server=validation_metadata.from_server, + configuration=validation_metadata.configuration, + path_to_item=validation_metadata.path_to_item+(property_name,) ) - other_path_to_schemas = schema._validate(value, _instantiation_metadata=arg_instantiation_metadata) + other_path_to_schemas = schema._validate(value, validation_metadata=arg_validation_metadata) update(path_to_schemas, other_path_to_schemas) return path_to_schemas @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ DictBase _validate We return dynamic classes of different bases depending upon the inputs @@ -958,15 +990,14 @@ def _validate(cls, *args, _instantiation_metadata: typing.Optional[Instantiation ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - if args and isinstance(args[0], cls): + if isinstance(arg, cls): # an instance of the correct type was passed in return {} - arg = args[0] - _path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + _path_to_schemas = super()._validate(arg, validation_metadata=validation_metadata) if not isinstance(arg, frozendict): return _path_to_schemas - cls._validate_arg_presence(args[0]) - other_path_to_schemas = cls._validate_args(args[0], _instantiation_metadata=_instantiation_metadata) + cls._validate_arg_presence(arg) + other_path_to_schemas = cls._validate_args(arg, validation_metadata=validation_metadata) update(_path_to_schemas, other_path_to_schemas) try: _discriminator = cls._discriminator @@ -974,7 +1005,7 @@ def _validate(cls, *args, _instantiation_metadata: typing.Optional[Instantiation return _path_to_schemas # discriminator exists disc_prop_name = list(_discriminator.keys())[0] - cls._ensure_discriminator_value_present(disc_prop_name, _instantiation_metadata, *args) + cls._ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) discriminated_cls = cls._get_discriminated_class( disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) if discriminated_cls is None: @@ -983,14 +1014,19 @@ def _validate(cls, *args, _instantiation_metadata: typing.Optional[Instantiation cls.__name__, disc_prop_name, list(_discriminator[disc_prop_name].keys()), - _instantiation_metadata.path_to_item + (disc_prop_name,) + validation_metadata.path_to_item + (disc_prop_name,) ) ) - if discriminated_cls in _instantiation_metadata.base_classes: + if discriminated_cls in validation_metadata.base_classes: # we have already moved through this class so stop here return _path_to_schemas - _instantiation_metadata.base_classes |= frozenset({cls}) - other_path_to_schemas = discriminated_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + updated_vm = ValidationMetadata( + configuration=validation_metadata.configuration, + from_server=validation_metadata.from_server, + path_to_item=validation_metadata.path_to_item, + base_classes=validation_metadata.base_classes | frozenset({cls}) + ) + other_path_to_schemas = discriminated_cls._validate(arg, validation_metadata=updated_vm) update(_path_to_schemas, other_path_to_schemas) return _path_to_schemas @@ -1023,7 +1059,12 @@ def _property_names(cls): return tuple(property_names) @classmethod - def _get_properties(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _get_properties( + cls, + arg: typing.Dict[str, typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): """ DictBase _get_properties, this is how properties are set These values already passed validation @@ -1032,12 +1073,10 @@ def _get_properties(cls, arg: typing.Dict[str, typing.Any], _instantiation_metad # if we have definitions for property schemas convert values using it # otherwise accept anything - _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata - for property_name_js, value in arg.items(): property_cls = getattr(cls, property_name_js, cls._additional_properties) - property_path_to_item = _instantiation_metadata.path_to_item+(property_name_js,) - stored_property_cls = _instantiation_metadata.path_to_schemas.get(property_path_to_item) + property_path_to_item = path_to_item + (property_name_js,) + stored_property_cls = path_to_schemas.get(property_path_to_item) if stored_property_cls: property_cls = stored_property_cls @@ -1045,14 +1084,11 @@ def _get_properties(cls, arg: typing.Dict[str, typing.Any], _instantiation_metad dict_items[property_name_js] = value continue - prop_instantiation_metadata = InstantiationMetadata( - configuration=_instantiation_metadata.configuration, - from_server=_instantiation_metadata.from_server, - path_to_item=property_path_to_item, - path_to_schemas=_instantiation_metadata.path_to_schemas, - ) new_value = property_cls._get_new_instance_without_conversion( - value, _instantiation_metadata=prop_instantiation_metadata) + value, + property_path_to_item, + path_to_schemas + ) dict_items[property_name_js] = new_value return dict_items @@ -1196,7 +1232,11 @@ def _class_by_base_class(cls, base_cls: type) -> type: return new_cls @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ Schema _validate Runs all schema validation logic and @@ -1224,21 +1264,21 @@ def _validate(cls, *args, _instantiation_metadata: typing.Optional[Instantiation ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - arg = args[0] - base_class = cls.__get_simple_class(arg) failed_type_check_classes = cls._validate_type(base_class) if failed_type_check_classes: raise cls.__get_type_error( arg, - _instantiation_metadata.path_to_item, + validation_metadata.path_to_item, failed_type_check_classes, key_type=False, ) if hasattr(cls, '_validate_validations_pass'): - cls._validate_validations_pass(arg, _instantiation_metadata) - path_to_schemas = defaultdict(set) - path_to_schemas[_instantiation_metadata.path_to_item].add(cls) + cls._validate_validations_pass(arg, validation_metadata) + path_to_schemas = {} + if validation_metadata.path_to_item not in path_to_schemas: + path_to_schemas[validation_metadata.path_to_item] = set() + path_to_schemas[validation_metadata.path_to_item].add(cls) if hasattr(cls, "_enum_by_value"): cls._validate_enum_value(arg) @@ -1247,7 +1287,7 @@ def _validate(cls, *args, _instantiation_metadata: typing.Optional[Instantiation if base_class is none_type or base_class is bool: return path_to_schemas - path_to_schemas[_instantiation_metadata.path_to_item].add(base_class) + path_to_schemas[validation_metadata.path_to_item].add(base_class) return path_to_schemas @classmethod @@ -1258,20 +1298,18 @@ def _validate_enum_value(cls, arg): raise ApiValueError("Invalid value {} passed in to {}, {}".format(arg, cls, cls._enum_value_to_name)) @classmethod - def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): + def __get_new_cls( + cls, + arg, + validation_metadata: ValidationMetadata + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], 'Schema']: """ - PATH 1 - make a new dynamic class and return an instance of that class + Make a new dynamic class and return an instance of that class We are making an instance of cls, but instead of making cls make a new class, new_cls which includes dynamic bases including cls return an instance of that new class - """ - if ( - _instantiation_metadata.path_to_schemas and - _instantiation_metadata.path_to_item in _instantiation_metadata.path_to_schemas): - chosen_new_cls = _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] - return chosen_new_cls - """ + Dict property + List Item Assignment Use cases: 1. value is NOT an instance of the required schema class the value is validated by _validate @@ -1284,8 +1322,10 @@ def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): and in list/dict _get_items,_get_properties the value will be directly assigned because value is of the correct type, and validation was run earlier when the instance was created """ - _path_to_schemas = cls._validate(arg, _instantiation_metadata=_instantiation_metadata) + _path_to_schemas = cls._validate(arg, validation_metadata=validation_metadata) # loop through it make a new class for each entry + # do not modify the returned result because it is cached and we would be modifying the cached value + path_to_schemas = {} for path, schema_classes in _path_to_schemas.items(): enum_schema = any( hasattr(this_cls, '_enum_by_value') for this_cls in schema_classes) @@ -1311,7 +1351,7 @@ def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) if inheritable_primitive_type and not enum_schema: - _instantiation_metadata.path_to_schemas[path] = mfg_cls + path_to_schemas[path] = mfg_cls continue # Use case: value is None, True, False, or an enum value @@ -1326,18 +1366,23 @@ def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): mfg_cls = mfg_cls._class_by_base_class(none_type) else: raise ApiValueError('Unhandled case value={} bases={}'.format(value, mfg_cls.__bases__)) - _instantiation_metadata.path_to_schemas[path] = mfg_cls + path_to_schemas[path] = mfg_cls - return _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] + return path_to_schemas @classmethod - def _get_new_instance_without_conversion(cls, arg, _instantiation_metadata): - # PATH 2 - we have a Dynamic class and we are making an instance of it + def _get_new_instance_without_conversion( + cls: 'Schema', + arg: typing.Any, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + # We have a Dynamic class and we are making an instance of it if issubclass(cls, frozendict): - properties = cls._get_properties(arg, _instantiation_metadata=_instantiation_metadata) + properties = cls._get_properties(arg, path_to_item, path_to_schemas) return super(Schema, cls).__new__(cls, properties) elif issubclass(cls, tuple): - items = cls._get_items(arg, _instantiation_metadata=_instantiation_metadata) + items = cls._get_items(arg, path_to_item, path_to_schemas) return super(Schema, cls).__new__(cls, items) """ str = openapi str, date, and datetime @@ -1368,16 +1413,20 @@ def _from_openapi_data( io.BufferedReader, bytes ], - _instantiation_metadata: typing.Optional[InstantiationMetadata] + _configuration: typing.Optional[Configuration] ): + """ + Schema _from_openapi_data + """ arg = cast_to_allowed_types(arg, from_server=True) - _instantiation_metadata = InstantiationMetadata(from_server=True) if _instantiation_metadata is None else _instantiation_metadata - if not _instantiation_metadata.from_server: - raise ApiValueError( - 'from_server must be True in this code path, if you need it to be False, use cls()' - ) - new_cls = cls.__get_new_cls(arg, _instantiation_metadata) - new_inst = new_cls._get_new_instance_without_conversion(arg, _instantiation_metadata) + validation_metadata = ValidationMetadata(from_server=True, configuration=_configuration) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata) + new_cls = path_to_schemas[validation_metadata.path_to_item] + new_inst = new_cls._get_new_instance_without_conversion( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) return new_inst @staticmethod @@ -1393,14 +1442,15 @@ def __get_input_dict(*args, **kwargs) -> frozendict: def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} - def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): """ Schema __new__ Args: args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): the value kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): dict values - _instantiation_metadata: contains the needed from_server, configuration, path_to_item + _configuration: contains the Configuration that enables json schema validation keywords + like minItems, minLength etc """ kwargs = cls.__remove_unsets(kwargs) if not args and not kwargs: @@ -1411,20 +1461,21 @@ def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Deci arg = args[0] else: arg = cls.__get_input_dict(*args, **kwargs) - _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata - if _instantiation_metadata.from_server: - raise ApiValueError( - 'from_server must be False in this code path, if you need it to be True, use cls._from_openapi_data()' - ) - arg = cast_to_allowed_types(arg, from_server=_instantiation_metadata.from_server) - new_cls = cls.__get_new_cls(arg, _instantiation_metadata) - return new_cls._get_new_instance_without_conversion(arg, _instantiation_metadata) + validation_metadata = ValidationMetadata(configuration=_configuration, from_server=False) + arg = cast_to_allowed_types(arg, from_server=validation_metadata.from_server) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata) + new_cls = path_to_schemas[validation_metadata.path_to_item] + return new_cls._get_new_instance_without_conversion( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) def __init__( self, *args: typing.Union[ dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], - _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[ dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset ] @@ -1454,6 +1505,8 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal because isinstance(True, int) is True """ return arg + elif isinstance(arg, int): + return decimal.Decimal(arg) elif isinstance(arg, float): decimal_from_float = decimal.Decimal(arg) if decimal_from_float.as_integer_ratio()[1] == 1: @@ -1463,8 +1516,6 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal return decimal_from_float elif type(arg) is list or type(arg) is tuple: return tuple([cast_to_allowed_types(item) for item in arg]) - elif isinstance(arg, int): - return decimal.Decimal(arg) elif arg is None: return arg elif isinstance(arg, (date, datetime)): @@ -1476,6 +1527,8 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal return arg elif isinstance(arg, bytes): return arg + elif isinstance(arg, decimal.Decimal): + return arg elif isinstance(arg, (io.FileIO, io.BufferedReader)): if arg.closed: raise ApiValueError('Invalid file state; file is closed and must be open') @@ -1488,12 +1541,12 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal class ComposedBase(Discriminable): @classmethod - def __get_allof_classes(cls, *args, _instantiation_metadata: InstantiationMetadata): + def __get_allof_classes(cls, *args, validation_metadata: ValidationMetadata): path_to_schemas = defaultdict(set) for allof_cls in cls._composed_schemas['allOf']: - if allof_cls in _instantiation_metadata.base_classes: + if allof_cls in validation_metadata.base_classes: continue - other_path_to_schemas = allof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + other_path_to_schemas = allof_cls._validate(*args, validation_metadata=validation_metadata) update(path_to_schemas, other_path_to_schemas) return path_to_schemas @@ -1502,16 +1555,16 @@ def __get_oneof_class( cls, *args, discriminated_cls, - _instantiation_metadata: InstantiationMetadata, + validation_metadata: ValidationMetadata, path_to_schemas: typing.Dict[typing.Tuple, typing.Set[typing.Type[Schema]]] ): oneof_classes = [] chosen_oneof_cls = None - original_base_classes = _instantiation_metadata.base_classes - new_base_classes = _instantiation_metadata.base_classes + original_base_classes = validation_metadata.base_classes + new_base_classes = validation_metadata.base_classes path_to_schemas = defaultdict(set) for oneof_cls in cls._composed_schemas['oneOf']: - if oneof_cls in path_to_schemas[_instantiation_metadata.path_to_item]: + if oneof_cls in path_to_schemas[validation_metadata.path_to_item]: oneof_classes.append(oneof_cls) continue if isinstance(args[0], oneof_cls): @@ -1519,10 +1572,9 @@ def __get_oneof_class( chosen_oneof_cls = oneof_cls oneof_classes.append(oneof_cls) continue - _instantiation_metadata.base_classes = original_base_classes try: - path_to_schemas = oneof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) - new_base_classes = _instantiation_metadata.base_classes + path_to_schemas = oneof_cls._validate(*args, validation_metadata=validation_metadata) + new_base_classes = validation_metadata.base_classes except (ApiValueError, ApiTypeError) as ex: if discriminated_cls is not None and oneof_cls is discriminated_cls: raise ex @@ -1539,7 +1591,6 @@ def __get_oneof_class( "Invalid inputs given to generate an instance of {}. Multiple " "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) ) - _instantiation_metadata.base_classes = new_base_classes return path_to_schemas @classmethod @@ -1547,14 +1598,14 @@ def __get_anyof_classes( cls, *args, discriminated_cls, - _instantiation_metadata: InstantiationMetadata + validation_metadata: ValidationMetadata ): anyof_classes = [] chosen_anyof_cls = None - original_base_classes = _instantiation_metadata.base_classes + original_base_classes = validation_metadata.base_classes path_to_schemas = defaultdict(set) for anyof_cls in cls._composed_schemas['anyOf']: - if anyof_cls in _instantiation_metadata.base_classes: + if anyof_cls in validation_metadata.base_classes: continue if isinstance(args[0], anyof_cls): # passed in instance is the correct type @@ -1562,14 +1613,13 @@ def __get_anyof_classes( anyof_classes.append(anyof_cls) continue - _instantiation_metadata.base_classes = original_base_classes try: - other_path_to_schemas = anyof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + other_path_to_schemas = anyof_cls._validate(*args, validation_metadata=validation_metadata) except (ApiValueError, ApiTypeError) as ex: if discriminated_cls is not None and anyof_cls is discriminated_cls: raise ex continue - original_base_classes = _instantiation_metadata.base_classes + original_base_classes = validation_metadata.base_classes chosen_anyof_cls = anyof_cls anyof_classes.append(anyof_cls) update(path_to_schemas, other_path_to_schemas) @@ -1581,7 +1631,11 @@ def __get_anyof_classes( return path_to_schemas @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ ComposedBase _validate We return dynamic classes of different bases depending upon the inputs @@ -1597,65 +1651,70 @@ def _validate(cls, *args, _instantiation_metadata: typing.Optional[Instantiation ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - if args and isinstance(args[0], Schema) and _instantiation_metadata.from_server is False: - if isinstance(args[0], cls): + if isinstance(arg, Schema) and validation_metadata.from_server is False: + if isinstance(arg, cls): # an instance of the correct type was passed in return {} raise ApiTypeError( 'Incorrect type passed in, required type was {} and passed type was {} at {}'.format( cls, - type(args[0]), - _instantiation_metadata.path_to_item + type(arg), + validation_metadata.path_to_item ) ) # validation checking on types, validations, and enums - path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + path_to_schemas = super()._validate(arg, validation_metadata=validation_metadata) - _instantiation_metadata.base_classes |= frozenset({cls}) + updated_vm = ValidationMetadata( + configuration=validation_metadata.configuration, + from_server=validation_metadata.from_server, + path_to_item=validation_metadata.path_to_item, + base_classes=validation_metadata.base_classes | frozenset({cls}) + ) # process composed schema _discriminator = getattr(cls, '_discriminator', None) discriminated_cls = None - if _discriminator and args and isinstance(args[0], frozendict): + if _discriminator and arg and isinstance(arg, frozendict): disc_property_name = list(_discriminator.keys())[0] - cls._ensure_discriminator_value_present(disc_property_name, _instantiation_metadata, *args) + cls._ensure_discriminator_value_present(disc_property_name, updated_vm, arg) # get discriminated_cls by looking at the dict in the current class discriminated_cls = cls._get_discriminated_class( - disc_property_name=disc_property_name, disc_payload_value=args[0][disc_property_name]) + disc_property_name=disc_property_name, disc_payload_value=arg[disc_property_name]) if discriminated_cls is None: raise ApiValueError( "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( - args[0][disc_property_name], + arg[disc_property_name], cls.__name__, disc_property_name, list(_discriminator[disc_property_name].keys()), - _instantiation_metadata.path_to_item + (disc_property_name,) + updated_vm.path_to_item + (disc_property_name,) ) ) if cls._composed_schemas['allOf']: - other_path_to_schemas = cls.__get_allof_classes(*args, _instantiation_metadata=_instantiation_metadata) + other_path_to_schemas = cls.__get_allof_classes(arg, validation_metadata=updated_vm) update(path_to_schemas, other_path_to_schemas) if cls._composed_schemas['oneOf']: other_path_to_schemas = cls.__get_oneof_class( - *args, + arg, discriminated_cls=discriminated_cls, - _instantiation_metadata=_instantiation_metadata, + validation_metadata=updated_vm, path_to_schemas=path_to_schemas ) update(path_to_schemas, other_path_to_schemas) if cls._composed_schemas['anyOf']: other_path_to_schemas = cls.__get_anyof_classes( - *args, + arg, discriminated_cls=discriminated_cls, - _instantiation_metadata=_instantiation_metadata + validation_metadata=updated_vm ) update(path_to_schemas, other_path_to_schemas) if discriminated_cls is not None: # TODO use an exception from this package here - assert discriminated_cls in path_to_schemas[_instantiation_metadata.path_to_item] + assert discriminated_cls in path_to_schemas[updated_vm.path_to_item] return path_to_schemas @@ -1676,12 +1735,12 @@ class ComposedSchema( _composed_schemas = {} @classmethod - def _from_openapi_data(cls, *args: typing.Any, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs): + def _from_openapi_data(cls, *args: typing.Any, _configuration: typing.Optional[Configuration] = None, **kwargs): if not args: if not kwargs: raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) args = (kwargs, ) - return super()._from_openapi_data(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._from_openapi_data(args[0], _configuration=_configuration) class ListSchema( @@ -1691,10 +1750,10 @@ class ListSchema( ): @classmethod - def _from_openapi_data(cls, arg: typing.List[typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: typing.Union[list, tuple], **kwargs: InstantiationMetadata): + def __new__(cls, arg: typing.Union[list, tuple], **kwargs: ValidationMetadata): return super().__new__(cls, arg, **kwargs) @@ -1705,10 +1764,10 @@ class NoneSchema( ): @classmethod - def _from_openapi_data(cls, arg: None, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: None, _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: None, **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: None, **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1723,10 +1782,10 @@ class NumberSchema( """ @classmethod - def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1740,31 +1799,35 @@ def as_int(self) -> int: return self._as_int @classmethod - def _validate_format(cls, arg: typing.Optional[decimal.Decimal], _instantiation_metadata: InstantiationMetadata): + def _validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): if isinstance(arg, decimal.Decimal): exponent = arg.as_tuple().exponent if exponent != 0: raise ApiValueError( - "Invalid value '{}' for type integer at {}".format(arg, _instantiation_metadata.path_to_item) + "Invalid value '{}' for type integer at {}".format(arg, validation_metadata.path_to_item) ) @classmethod - def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _validate( + cls, + arg, + validation_metadata: ValidationMetadata, + ): """ IntBase _validate TODO what about types = (int, number) -> IntBase, NumberBase? We could drop int and keep number only """ - cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) - return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + cls._validate_format(arg, validation_metadata=validation_metadata) + return super()._validate(arg, validation_metadata=validation_metadata) class IntSchema(IntBase, NumberSchema): @classmethod - def _from_openapi_data(cls, arg: int, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: int, _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1815,9 +1878,9 @@ class Float32Schema( ): @classmethod - def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None): # todo check format - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + return super()._from_openapi_data(arg, _configuration=_configuration) class Float64Base( @@ -1835,9 +1898,9 @@ class Float64Schema( ): @classmethod - def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None): # todo check format - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + return super()._from_openapi_data(arg, _configuration=_configuration) class StrSchema( @@ -1853,28 +1916,28 @@ class StrSchema( """ @classmethod - def _from_openapi_data(cls, arg: typing.Union[str], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None) -> 'StrSchema': - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: typing.Union[str], _configuration: typing.Optional[Configuration] = None) -> 'StrSchema': + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: typing.Union[str, date, datetime], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[str, date, datetime], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) class DateSchema(DateBase, StrSchema): - def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) class DateTimeSchema(DateTimeBase, StrSchema): - def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) class DecimalSchema(DecimalBase, StrSchema): - def __new__(cls, arg: typing.Union[str], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[str], **kwargs: typing.Union[ValidationMetadata]): """ Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads which can be simple (str) or complex (dicts or lists with nested values) @@ -1893,7 +1956,7 @@ class BytesSchema( """ this class will subclass bytes and is immutable """ - def __new__(cls, arg: typing.Union[bytes], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[bytes], **kwargs: typing.Union[ValidationMetadata]): return super(Schema, cls).__new__(cls, arg) @@ -1918,7 +1981,7 @@ class FileSchema( - to be able to preserve file name info """ - def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: typing.Union[ValidationMetadata]): return super(Schema, cls).__new__(cls, arg) @@ -1953,7 +2016,7 @@ def _composed_schemas(cls): ], } - def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg) @@ -1964,10 +2027,10 @@ class BoolSchema( ): @classmethod - def _from_openapi_data(cls, arg: bool, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: bool, _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, arg: bool, **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: bool, **kwargs: typing.Union[ValidationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1993,10 +2056,10 @@ class DictSchema( ): @classmethod - def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): - return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): + return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, InstantiationMetadata]): + def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): return super().__new__(cls, *args, **kwargs) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py index 32a7f60d1caa..c628ddfb76dc 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py @@ -12,7 +12,9 @@ from petstore_api.model.string_enum import StringEnum from petstore_api.model.number_with_validations import NumberWithValidations from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType -from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems +from petstore_api.model.array_with_validations_in_items import ( + ArrayWithValidationsInItems, +) from petstore_api.model.foo import Foo from petstore_api.model.animal import Animal from petstore_api.model.dog import Dog @@ -29,7 +31,7 @@ StrSchema, NumberSchema, Schema, - InstantiationMetadata, + ValidationMetadata, Int64Schema, StrBase, NumberBase, @@ -38,140 +40,174 @@ frozendict, ) -class TestValidateResults(unittest.TestCase): +class TestValidateResults(unittest.TestCase): def test_str_validate(self): - im = InstantiationMetadata() - path_to_schemas = StringWithValidation._validate('abcdefg', _instantiation_metadata=im) - assert path_to_schemas == {('args[0]',): set([StringWithValidation, str])} + vm = ValidationMetadata() + path_to_schemas = StringWithValidation._validate( + "abcdefg", validation_metadata=vm + ) + assert path_to_schemas == {("args[0]",): set([StringWithValidation, str])} def test_number_validate(self): - im = InstantiationMetadata() - path_to_schemas = NumberWithValidations._validate(Decimal(11), _instantiation_metadata=im) - assert path_to_schemas == {('args[0]',): set([NumberWithValidations, Decimal])} + vm = ValidationMetadata() + path_to_schemas = NumberWithValidations._validate( + Decimal(11), validation_metadata=vm + ) + assert path_to_schemas == {("args[0]",): set([NumberWithValidations, Decimal])} def test_str_enum_validate(self): - im = InstantiationMetadata() - path_to_schemas = StringEnum._validate('placed', _instantiation_metadata=im) - assert path_to_schemas == {('args[0]',): set([StringEnum])} + vm = ValidationMetadata() + path_to_schemas = StringEnum._validate("placed", validation_metadata=vm) + assert path_to_schemas == {("args[0]",): set([StringEnum])} def test_nullable_enum_validate(self): - im = InstantiationMetadata() - path_to_schemas = StringEnum._validate(None, _instantiation_metadata=im) - assert path_to_schemas == {('args[0]',): set([StringEnum])} + vm = ValidationMetadata() + path_to_schemas = StringEnum._validate(None, validation_metadata=vm) + assert path_to_schemas == {("args[0]",): set([StringEnum])} def test_empty_list_validate(self): - im = InstantiationMetadata() - path_to_schemas = ArrayHoldingAnyType._validate((), _instantiation_metadata=im) - assert path_to_schemas == {('args[0]',): set([ArrayHoldingAnyType, tuple])} + vm = ValidationMetadata() + path_to_schemas = ArrayHoldingAnyType._validate((), validation_metadata=vm) + assert path_to_schemas == {("args[0]",): set([ArrayHoldingAnyType, tuple])} def test_list_validate(self): - im = InstantiationMetadata() - path_to_schemas = ArrayHoldingAnyType._validate((Decimal(1), 'a'), _instantiation_metadata=im) + vm = ValidationMetadata() + path_to_schemas = ArrayHoldingAnyType._validate( + (Decimal(1), "a"), validation_metadata=vm + ) assert path_to_schemas == { - ('args[0]',): set([ArrayHoldingAnyType, tuple]), - ('args[0]', 0): set([AnyTypeSchema, Decimal]), - ('args[0]', 1): set([AnyTypeSchema, str]) + ("args[0]",): set([ArrayHoldingAnyType, tuple]), + ("args[0]", 0): set([AnyTypeSchema, Decimal]), + ("args[0]", 1): set([AnyTypeSchema, str]), } def test_empty_dict_validate(self): - im = InstantiationMetadata() - path_to_schemas = Foo._validate(frozendict({}), _instantiation_metadata=im) - assert path_to_schemas == {('args[0]',): set([Foo, frozendict])} + vm = ValidationMetadata() + path_to_schemas = Foo._validate(frozendict({}), validation_metadata=vm) + assert path_to_schemas == {("args[0]",): set([Foo, frozendict])} def test_dict_validate(self): - im = InstantiationMetadata() - path_to_schemas = Foo._validate(frozendict({'bar': 'a', 'additional': Decimal(0)}), _instantiation_metadata=im) + vm = ValidationMetadata() + path_to_schemas = Foo._validate( + frozendict({"bar": "a", "additional": Decimal(0)}), + validation_metadata=vm, + ) assert path_to_schemas == { - ('args[0]',): set([Foo, frozendict]), - ('args[0]', 'bar'): set([StrSchema, str]), - ('args[0]', 'additional'): set([AnyTypeSchema, Decimal]) + ("args[0]",): set([Foo, frozendict]), + ("args[0]", "bar"): set([StrSchema, str]), + ("args[0]", "additional"): set([AnyTypeSchema, Decimal]), } def test_discriminated_dict_validate(self): - im = InstantiationMetadata() - path_to_schemas = Animal._validate(frozendict(className='Dog', color='black'), _instantiation_metadata=im) + vm = ValidationMetadata() + path_to_schemas = Animal._validate( + frozendict(className="Dog", color="black"), validation_metadata=vm + ) assert path_to_schemas == { - ('args[0]',): set([Animal, Dog, DogAllOf, frozendict]), - ('args[0]', 'className'): set([StrSchema, AnyTypeSchema, str]), - ('args[0]', 'color'): set([StrSchema, AnyTypeSchema, str]), + ("args[0]",): set([Animal, Dog, DogAllOf, frozendict]), + ("args[0]", "className"): set([StrSchema, AnyTypeSchema, str]), + ("args[0]", "color"): set([StrSchema, AnyTypeSchema, str]), } def test_bool_enum_validate(self): - im = InstantiationMetadata() - path_to_schemas = BooleanEnum._validate(True, _instantiation_metadata=im) - assert path_to_schemas == { - ('args[0]',): set([BooleanEnum]) - } + vm = ValidationMetadata() + path_to_schemas = BooleanEnum._validate(True, validation_metadata=vm) + assert path_to_schemas == {("args[0]",): set([BooleanEnum])} def test_oneof_composition_pig_validate(self): - im = InstantiationMetadata() - path_to_schemas = Pig._validate(frozendict(className='DanishPig'), _instantiation_metadata=im) + vm = ValidationMetadata() + path_to_schemas = Pig._validate( + frozendict(className="DanishPig"), validation_metadata=vm + ) assert path_to_schemas == { - ('args[0]',): set([Pig, DanishPig, frozendict]), - ('args[0]', 'className'): set([DanishPig.className, AnyTypeSchema, str]), + ("args[0]",): set([Pig, DanishPig, frozendict]), + ("args[0]", "className"): set([DanishPig.className, AnyTypeSchema, str]), } def test_anyof_composition_gm_fruit_validate(self): - im = InstantiationMetadata() - path_to_schemas = GmFruit._validate(frozendict(cultivar='GoldenDelicious', lengthCm=Decimal(10)), _instantiation_metadata=im) + vm = ValidationMetadata() + path_to_schemas = GmFruit._validate( + frozendict(cultivar="GoldenDelicious", lengthCm=Decimal(10)), + validation_metadata=vm, + ) assert path_to_schemas == { - ('args[0]',): set([GmFruit, Apple, Banana, frozendict]), - ('args[0]', 'cultivar'): set([Apple.cultivar, AnyTypeSchema, str]), - ('args[0]', 'lengthCm'): set([AnyTypeSchema, NumberSchema, Decimal]), + ("args[0]",): set([GmFruit, Apple, Banana, frozendict]), + ("args[0]", "cultivar"): set([Apple.cultivar, AnyTypeSchema, str]), + ("args[0]", "lengthCm"): set([AnyTypeSchema, NumberSchema, Decimal]), } + class TestValidateCalls(unittest.TestCase): def test_empty_list_validate(self): - return_value = {('args[0]',): set([ArrayHoldingAnyType, tuple])} - with patch.object(Schema, '_validate', return_value=return_value) as mock_validate: - instance = ArrayHoldingAnyType([]) - assert mock_validate.call_count == 1 - - with patch.object(Schema, '_validate', return_value=return_value) as mock_validate: - ArrayHoldingAnyType._from_openapi_data([]) - assert mock_validate.call_count == 1 + return_value = {("args[0]",): set([ArrayHoldingAnyType, tuple])} + with patch.object( + Schema, "_validate", return_value=return_value + ) as mock_validate: + instance = ArrayHoldingAnyType([]) + assert mock_validate.call_count == 1 + + with patch.object( + Schema, "_validate", return_value=return_value + ) as mock_validate: + ArrayHoldingAnyType._from_openapi_data([]) + assert mock_validate.call_count == 1 def test_empty_dict_validate(self): - return_value = {('args[0]',): set([Foo, frozendict])} - with patch.object(Schema, '_validate', return_value=return_value) as mock_validate: - instance = Foo({}) - assert mock_validate.call_count == 1 - - with patch.object(Schema, '_validate', return_value=return_value) as mock_validate: - Foo._from_openapi_data({}) - assert mock_validate.call_count == 1 + return_value = {("args[0]",): set([Foo, frozendict])} + with patch.object( + Schema, "_validate", return_value=return_value + ) as mock_validate: + instance = Foo({}) + assert mock_validate.call_count == 1 + + with patch.object( + Schema, "_validate", return_value=return_value + ) as mock_validate: + Foo._from_openapi_data({}) + assert mock_validate.call_count == 1 def test_list_validate_direct_instantiation(self): expected_call_by_index = { 0: [ ArrayWithValidationsInItems, - ((Decimal('7'),),), - InstantiationMetadata(path_to_item=('args[0]',)) + ((Decimal("7"),),), + ValidationMetadata(path_to_item=("args[0]",)), ], 1: [ ArrayWithValidationsInItems._items, - (Decimal('7'),), - InstantiationMetadata(path_to_item=('args[0]', 0)) - ] + (Decimal("7"),), + ValidationMetadata(path_to_item=("args[0]", 0)), + ], } call_index = 0 result_by_call_index = { - 0: defaultdict(set, [( ('args[0]',), set([ArrayWithValidationsInItems, tuple]))] ), - 1: defaultdict(set, [( ('args[0]', 0), set([ArrayWithValidationsInItems._items, Decimal]) )] ), + 0: defaultdict( + set, [(("args[0]",), set([ArrayWithValidationsInItems, tuple]))] + ), + 1: defaultdict( + set, + [(("args[0]", 0), set([ArrayWithValidationsInItems._items, Decimal]))], + ), } @classmethod - def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def new_validate( + cls, + *args, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): nonlocal call_index - assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + assert [cls, args, validation_metadata] == expected_call_by_index[ + call_index + ] result = result_by_call_index.get(call_index) call_index += 1 if result is None: - raise petstore_api.ApiValueError('boom') + raise petstore_api.ApiValueError("boom") return result - with patch.object(Schema, '_validate', new=new_validate): + with patch.object(Schema, "_validate", new=new_validate): ArrayWithValidationsInItems([7]) def test_list_validate_direct_instantiation_cast_item(self): @@ -179,152 +215,191 @@ def test_list_validate_direct_instantiation_cast_item(self): expected_call_by_index = { 0: [ ArrayWithValidationsInItems, - ((Decimal('7'),),), - InstantiationMetadata(path_to_item=('args[0]',)) + ((Decimal("7"),),), + ValidationMetadata(path_to_item=("args[0]",)), ], } call_index = 0 result_by_call_index = { - 0: defaultdict(set, [( ('args[0]',), set([ArrayWithValidationsInItems, tuple]))] ), + 0: defaultdict( + set, [(("args[0]",), set([ArrayWithValidationsInItems, tuple]))] + ), } @classmethod - def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def new_validate( + cls, + *args, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): nonlocal call_index - assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + assert [cls, args, validation_metadata] == expected_call_by_index[ + call_index + ] result = result_by_call_index.get(call_index) call_index += 1 if result is None: - raise petstore_api.ApiValueError('boom') + raise petstore_api.ApiValueError("boom") return result item = ArrayWithValidationsInItems._items(7) - with patch.object(Schema, '_validate', new=new_validate): + with patch.object(Schema, "_validate", new=new_validate): ArrayWithValidationsInItems([item]) def test_list_validate_from_openai_data_instantiation(self): expected_call_by_index = { 0: [ ArrayWithValidationsInItems, - ((Decimal('7'),),), - InstantiationMetadata(path_to_item=('args[0]',), from_server=True) + ((Decimal("7"),),), + ValidationMetadata(path_to_item=("args[0]",), from_server=True), ], 1: [ ArrayWithValidationsInItems._items, - (Decimal('7'),), - InstantiationMetadata(path_to_item=('args[0]', 0), from_server=True) - ] + (Decimal("7"),), + ValidationMetadata(path_to_item=("args[0]", 0), from_server=True), + ], } call_index = 0 result_by_call_index = { - 0: defaultdict(set, [( ('args[0]',), set([ArrayWithValidationsInItems, tuple]))] ), - 1: defaultdict(set, [( ('args[0]', 0), set([ArrayWithValidationsInItems._items, Decimal]) )] ), + 0: defaultdict( + set, [(("args[0]",), set([ArrayWithValidationsInItems, tuple]))] + ), + 1: defaultdict( + set, + [(("args[0]", 0), set([ArrayWithValidationsInItems._items, Decimal]))], + ), } @classmethod - def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def new_validate( + cls, + *args, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): nonlocal call_index - assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + assert [cls, args, validation_metadata] == expected_call_by_index[ + call_index + ] result = result_by_call_index.get(call_index) call_index += 1 if result is None: - raise petstore_api.ApiValueError('boom') + raise petstore_api.ApiValueError("boom") return result - with patch.object(Schema, '_validate', new=new_validate): + with patch.object(Schema, "_validate", new=new_validate): ArrayWithValidationsInItems._from_openapi_data([7]) def test_dict_validate_direct_instantiation(self): expected_call_by_index = { 0: [ Foo, - (frozendict({'bar': 'a'}),), - InstantiationMetadata(path_to_item=('args[0]',)) + (frozendict({"bar": "a"}),), + ValidationMetadata(path_to_item=("args[0]",)), ], 1: [ StrSchema, - ('a',), - InstantiationMetadata(path_to_item=('args[0]', 'bar')) - ] + ("a",), + ValidationMetadata(path_to_item=("args[0]", "bar")), + ], } call_index = 0 result_by_call_index = { - 0: defaultdict(set, [( ('args[0]',), set([Foo, frozendict]))] ), - 1: defaultdict(set, [( ('args[0]', 'bar'), set([StrSchema, str]) )] ), + 0: defaultdict(set, [(("args[0]",), set([Foo, frozendict]))]), + 1: defaultdict(set, [(("args[0]", "bar"), set([StrSchema, str]))]), } @classmethod - def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def new_validate( + cls, + *args, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): nonlocal call_index - assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + assert [cls, args, validation_metadata] == expected_call_by_index[ + call_index + ] result = result_by_call_index.get(call_index) call_index += 1 if result is None: - raise petstore_api.ApiValueError('boom') + raise petstore_api.ApiValueError("boom") return result - with patch.object(Schema, '_validate', new=new_validate): - Foo(bar='a') + with patch.object(Schema, "_validate", new=new_validate): + Foo(bar="a") def test_dict_validate_direct_instantiation_cast_item(self): expected_call_by_index = { 0: [ Foo, - (frozendict({'bar': 'a'}),), - InstantiationMetadata(path_to_item=('args[0]',)) + (frozendict({"bar": "a"}),), + ValidationMetadata(path_to_item=("args[0]",)), ], } call_index = 0 result_by_call_index = { - 0: defaultdict(set, [( ('args[0]',), set([Foo, frozendict]))] ), + 0: defaultdict(set, [(("args[0]",), set([Foo, frozendict]))]), } @classmethod - def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def new_validate( + cls, + *args, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): nonlocal call_index - assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + assert [cls, args, validation_metadata] == expected_call_by_index[ + call_index + ] result = result_by_call_index.get(call_index) call_index += 1 if result is None: - raise petstore_api.ApiValueError('boom') + raise petstore_api.ApiValueError("boom") return result - bar = StrSchema('a') - with patch.object(Schema, '_validate', new=new_validate): + bar = StrSchema("a") + with patch.object(Schema, "_validate", new=new_validate): Foo(bar=bar) def test_dict_validate_from_openapi_data_instantiation(self): expected_call_by_index = { 0: [ Foo, - (frozendict({'bar': 'a'}),), - InstantiationMetadata(path_to_item=('args[0]',), from_server=True) + (frozendict({"bar": "a"}),), + ValidationMetadata(path_to_item=("args[0]",), from_server=True), ], 1: [ StrSchema, - ('a',), - InstantiationMetadata(path_to_item=('args[0]', 'bar'), from_server=True) - ] + ("a",), + ValidationMetadata( + path_to_item=("args[0]", "bar"), from_server=True + ), + ], } call_index = 0 result_by_call_index = { - 0: defaultdict(set, [( ('args[0]',), set([Foo, frozendict]))] ), - 1: defaultdict(set, [( ('args[0]', 'bar'), set([StrSchema, str]) )] ), + 0: defaultdict(set, [(("args[0]",), set([Foo, frozendict]))]), + 1: defaultdict(set, [(("args[0]", "bar"), set([StrSchema, str]))]), } @classmethod - def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def new_validate( + cls, + *args, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): nonlocal call_index - assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + assert [cls, args, validation_metadata] == expected_call_by_index[ + call_index + ] result = result_by_call_index.get(call_index) call_index += 1 if result is None: - raise petstore_api.ApiValueError('boom') + raise petstore_api.ApiValueError("boom") return result - with patch.object(Schema, '_validate', new=new_validate): - Foo._from_openapi_data({'bar': 'a'}) + with patch.object(Schema, "_validate", new=new_validate): + Foo._from_openapi_data({"bar": "a"}) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() From 986446c1d5e7b2c16c667ed18b6c95b2679268f5 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 17 Feb 2022 14:05:25 +0800 Subject: [PATCH 074/111] Migrate JAX-RS server tests to Github action (#11632) * remove spring tests from pom.xml * test jaxrs in github action * trigger build * Revert "trigger build" This reverts commit a9c444fe5b4452ceb9483c1ee067ca07b3f5c462. --- .github/workflows/samples-jaxrs.yaml | 59 ++++++++++++++++++++++++++++ pom.xml | 40 ------------------- 2 files changed, 59 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/samples-jaxrs.yaml diff --git a/.github/workflows/samples-jaxrs.yaml b/.github/workflows/samples-jaxrs.yaml new file mode 100644 index 000000000000..1000251d19b5 --- /dev/null +++ b/.github/workflows/samples-jaxrs.yaml @@ -0,0 +1,59 @@ +name: Samples JAX-RS + +on: + push: + paths: + - 'samples/server/petstore/jaxrs*/**' + pull_request: + paths: + - 'samples/server/petstore/jaxrs*/**' +jobs: + build: + name: Build JAX-RS + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # servers + - samples/server/petstore/jaxrs/jersey2 + - samples/server/petstore/jaxrs/jersey2-useTags + - samples/server/petstore/jaxrs-jersey + - samples/server/petstore/jaxrs-spec + - samples/server/petstore/jaxrs-spec-interface + - samples/server/petstore/jaxrs-spec-interface-response + - samples/server/petstore/jaxrs-jersey + - samples/server/petstore/jaxrs-spec + - samples/server/petstore/jaxrs-spec-interface + - samples/server/petstore/jaxrs-spec-interface-response + - samples/server/petstore/jaxrs/jersey1 + - samples/server/petstore/jaxrs/jersey1-useTags + - samples/server/petstore/jaxrs-datelib-j8 + - samples/server/petstore/jaxrs-resteasy/default + - samples/server/petstore/jaxrs-resteasy/eap + - samples/server/petstore/jaxrs-resteasy/eap-joda + - samples/server/petstore/jaxrs-resteasy/eap-java8 + - samples/server/petstore/jaxrs-resteasy/joda + - samples/server/petstore/jaxrs-resteasy/default-value + - samples/server/petstore/jaxrs-cxf + - samples/server/petstore/jaxrs-cxf-annotated-base-path + - samples/server/petstore/jaxrs-cxf-cdi + - samples/server/petstore/jaxrs-cxf-cdi-default-value + - samples/server/petstore/jaxrs-cxf-non-spring-app + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 8 + - name: Cache maven dependencies + uses: actions/cache@v2.1.7 + env: + cache-name: maven-repository + with: + path: | + ~/.m2 + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Build + working-directory: ${{ matrix.sample }} + run: mvn clean package diff --git a/pom.xml b/pom.xml index 5b5ed00e2433..4bedd2157d13 100644 --- a/pom.xml +++ b/pom.xml @@ -1160,52 +1160,12 @@ - samples/server/petstore/jaxrs/jersey2 - samples/server/petstore/jaxrs/jersey2-useTags samples/server/petstore/java-camel - samples/server/petstore/jaxrs-jersey - samples/server/petstore/jaxrs-spec - samples/server/petstore/jaxrs-spec-interface - samples/server/petstore/jaxrs-spec-interface-response samples/server/petstore/java-vertx-web samples/server/petstore/java-inflector samples/server/petstore/java-pkmst samples/server/petstore/java-undertow - samples/server/petstore/jaxrs/jersey1 - samples/server/petstore/jaxrs/jersey1-useTags - - samples/server/petstore/jaxrs-datelib-j8 - samples/server/petstore/jaxrs-resteasy/default - samples/server/petstore/jaxrs-resteasy/eap - samples/server/petstore/jaxrs-resteasy/eap-joda - samples/server/petstore/jaxrs-resteasy/eap-java8 - samples/server/petstore/jaxrs-resteasy/joda - samples/server/petstore/jaxrs-resteasy/default-value - samples/client/petstore/spring-cloud - samples/openapi3/client/petstore/spring-cloud - samples/client/petstore/spring-cloud-date-time - samples/openapi3/client/petstore/spring-cloud-date-time - samples/server/petstore/springboot - samples/server/petstore/spring-boot-nullable-set - samples/openapi3/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/springboot-useoptional - samples/openapi3/server/petstore/springboot-useoptional - samples/server/petstore/springboot-reactive - samples/openapi3/server/petstore/springboot-reactive - samples/server/petstore/springboot-implicitHeaders - samples/openapi3/server/petstore/springboot-implicitHeaders - samples/server/petstore/springboot-delegate - samples/openapi3/server/petstore/springboot-delegate - samples/server/petstore/jaxrs-cxf - samples/server/petstore/jaxrs-cxf-annotated-base-path - samples/server/petstore/jaxrs-cxf-cdi - samples/server/petstore/jaxrs-cxf-cdi-default-value - samples/server/petstore/jaxrs-cxf-non-spring-app - samples/server/petstore/java-msf4j From 0a68d83f95f28dde967a0cfc36a774432e47fe3a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 17 Feb 2022 15:30:14 +0800 Subject: [PATCH 075/111] [Java] move some client tests to Github actions (#11634) * more java client tests in github actino * trigger build * Revert "trigger build" This reverts commit 023f8cc725b663490050899978b4d67f95495398. * move java client tests to github action --- .../workflows/samples-java-client-jdk11.yaml | 23 +++++++++++++++++-- pom.xml | 19 --------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml index ba45ec604483..7907118eb48c 100644 --- a/.github/workflows/samples-java-client-jdk11.yaml +++ b/.github/workflows/samples-java-client-jdk11.yaml @@ -3,10 +3,10 @@ name: Samples Java Client JDK11 on: push: paths: - - 'samples/client/petstore/java/native**' + - 'samples/client/petstore/java*/**' pull_request: paths: - - 'samples/client/petstore/java/native**' + - 'samples/client/petstore/java*/**' jobs: build: name: Build Java Client JDK11 @@ -16,8 +16,27 @@ jobs: matrix: sample: # clients + - samples/client/petstore/jaxrs-cxf-client - samples/client/petstore/java/native - samples/client/petstore/java/native-async + - samples/client/petstore/java/retrofit2 + - samples/client/petstore/java/retrofit2rx2 + - samples/client/petstore/java/retrofit2rx3 + - samples/client/petstore/java/retrofit2-play26 + - samples/client/petstore/java/resttemplate + - samples/client/petstore/java/resttemplate-withXml + - samples/client/petstore/java/webclient + - samples/client/petstore/java/webclient-nulable-arrays + - samples/client/petstore/java/vertx + - samples/client/petstore/java/jersey2-java8-localdatetime + - samples/client/petstore/java/resteasy + - samples/client/petstore/java/google-api-client + - samples/client/petstore/java/rest-assured + - samples/client/petstore/java/rest-assured-jackson + - samples/client/petstore/java/microprofile-rest-client + - samples/client/petstore/java/apache-httpclient + - samples/client/petstore/java/feign + - samples/client/petstore/java/jersey1 steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 diff --git a/pom.xml b/pom.xml index 4bedd2157d13..5bcea3d88086 100644 --- a/pom.xml +++ b/pom.xml @@ -1255,29 +1255,10 @@ samples/client/petstore/scala-sttp samples/client/petstore/scala-httpclient samples/client/petstore/clojure - samples/client/petstore/java/feign - samples/client/petstore/java/jersey1 samples/client/petstore/java/jersey2-java8 samples/openapi3/client/petstore/java/jersey2-java8 samples/client/others/java/okhttp-gson-streaming samples/client/petstore/java/okhttp-gson - samples/client/petstore/java/retrofit2 - samples/client/petstore/java/retrofit2rx2 - samples/client/petstore/java/retrofit2rx3 - samples/client/petstore/java/retrofit2-play26 - samples/client/petstore/jaxrs-cxf-client - samples/client/petstore/java/resttemplate - samples/client/petstore/java/resttemplate-withXml - samples/client/petstore/java/webclient - samples/client/petstore/java/webclient-nulable-arrays - samples/client/petstore/java/vertx - samples/client/petstore/java/jersey2-java8-localdatetime - samples/client/petstore/java/resteasy - samples/client/petstore/java/google-api-client - samples/client/petstore/java/rest-assured - samples/client/petstore/java/rest-assured-jackson - samples/client/petstore/java/microprofile-rest-client - samples/client/petstore/java/apache-httpclient From b979eccf680a5b7f64c284221a5d2c868a4400ad Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 17 Feb 2022 15:49:34 +0800 Subject: [PATCH 076/111] Add Github action file to test Java clients (#11633) * add github action file to test java clients * update tests --- .../codegen/languages/JavaClientCodegen.java | 1 + .../main/resources/Java/maven.yml.mustache | 31 +++++++++++++++++++ .../codegen/DefaultGeneratorTest.java | 2 +- .../codegen/java/JavaClientCodegenTest.java | 12 +++---- .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../java/feign/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../java/feign/.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../java/jersey1/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../java/jersey1/.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../jersey2-java8/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../jersey2-java8/.openapi-generator/FILES | 1 + .../native-async/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../native-async/.openapi-generator/FILES | 1 + .../java/native/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../java/native/.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../okhttp-gson/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../java/okhttp-gson/.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../rest-assured/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../rest-assured/.openapi-generator/FILES | 1 + .../java/resteasy/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../java/resteasy/.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../resttemplate/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../resttemplate/.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../retrofit2-play26/.openapi-generator/FILES | 1 + .../retrofit2/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../java/retrofit2/.openapi-generator/FILES | 1 + .../retrofit2rx2/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../retrofit2rx2/.openapi-generator/FILES | 1 + .../retrofit2rx3/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../retrofit2rx3/.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../java/vertx/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../java/vertx/.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../webclient/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../java/webclient/.openapi-generator/FILES | 1 + .../jersey2-java8/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../jersey2-java8/.openapi-generator/FILES | 1 + .../.github/workflows/maven.yml | 30 ++++++++++++++++++ .../.openapi-generator/FILES | 1 + .../jersey2-java8/.github/workflows/maven.yml | 30 ++++++++++++++++++ .../jersey2-java8/.openapi-generator/FILES | 1 + 62 files changed, 938 insertions(+), 7 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/Java/maven.yml.mustache create mode 100644 samples/client/others/java/okhttp-gson-streaming/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/apache-httpclient/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/feign-no-nullable/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/feign/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/google-api-client/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/jersey1/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/jersey2-java8/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/native-async/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/native/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/okhttp-gson/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/rest-assured-jackson/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/rest-assured/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/resteasy/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/resttemplate-withXml/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/resttemplate/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/retrofit2-play26/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/retrofit2/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/retrofit2rx2/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/retrofit2rx3/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/vertx-no-nullable/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/vertx/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/webclient-nulable-arrays/.github/workflows/maven.yml create mode 100644 samples/client/petstore/java/webclient/.github/workflows/maven.yml create mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.github/workflows/maven.yml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.github/workflows/maven.yml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/.github/workflows/maven.yml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 9309415635ad..264f8b41bbf2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -350,6 +350,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("ApiClient.mustache", invokerFolder, "ApiClient.java")); supportingFiles.add(new SupportingFile("ServerConfiguration.mustache", invokerFolder, "ServerConfiguration.java")); supportingFiles.add(new SupportingFile("ServerVariable.mustache", invokerFolder, "ServerVariable.java")); + supportingFiles.add(new SupportingFile("maven.yml.mustache", ".github/workflows", "maven.yml")); if (dynamicOperations) { supportingFiles.add(new SupportingFile("openapi.mustache", projectFolder + "/resources/openapi", "openapi.yaml")); supportingFiles.add(new SupportingFile("apiOperation.mustache", invokerFolder, "ApiOperation.java")); diff --git a/modules/openapi-generator/src/main/resources/Java/maven.yml.mustache b/modules/openapi-generator/src/main/resources/Java/maven.yml.mustache new file mode 100644 index 000000000000..f3c4733c306c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/maven.yml.mustache @@ -0,0 +1,31 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build {{{appName}}} + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + {{=< >=}} + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java index f112a670c313..71b63ea25c26 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java @@ -64,7 +64,7 @@ public void testIgnoreFileProcessing() throws IOException { List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 43); + Assert.assertEquals(files.size(), 44); // Check expected generated files // api sanity check diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index d328a4d6ae13..c62cbdd5616c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -290,7 +290,7 @@ public void testGeneratePing() throws Exception { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 39); + Assert.assertEquals(files.size(), 40); TestUtils.ensureContainsFile(files, output, ".gitignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); @@ -358,7 +358,7 @@ public void testGeneratePingSomeObj() throws Exception { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 42); + Assert.assertEquals(files.size(), 43); TestUtils.ensureContainsFile(files, output, ".gitignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); @@ -429,7 +429,7 @@ public void testJdkHttpClient() throws Exception { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 31); + Assert.assertEquals(files.size(), 32); validateJavaSourceFiles(files); TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), @@ -496,7 +496,7 @@ public void testJdkHttpAsyncClient() throws Exception { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 34); + Assert.assertEquals(files.size(), 35); validateJavaSourceFiles(files); Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/PingApi.java"); @@ -998,7 +998,7 @@ public void testAllowModelWithNoProperties() throws Exception { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 48); + Assert.assertEquals(files.size(), 49); TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/RealCommand.java"); TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/Command.java"); @@ -1270,7 +1270,7 @@ public void testNativeClientWhiteSpacePathParamEncoding() throws IOException { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 34); + Assert.assertEquals(files.size(), 35); validateJavaSourceFiles(files); TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"), diff --git a/samples/client/others/java/okhttp-gson-streaming/.github/workflows/maven.yml b/samples/client/others/java/okhttp-gson-streaming/.github/workflows/maven.yml new file mode 100644 index 000000000000..46aa8645591f --- /dev/null +++ b/samples/client/others/java/okhttp-gson-streaming/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build ping some object + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/FILES b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/FILES index 77e02d36f052..1f0129a4d8c9 100644 --- a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/FILES +++ b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/apache-httpclient/.github/workflows/maven.yml b/samples/client/petstore/java/apache-httpclient/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES index e8b75caa79f0..18764e6e506e 100644 --- a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/feign-no-nullable/.github/workflows/maven.yml b/samples/client/petstore/java/feign-no-nullable/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/FILES b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/FILES index 60e36d2d8c20..e552623e40cf 100644 --- a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/FILES +++ b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/feign/.github/workflows/maven.yml b/samples/client/petstore/java/feign/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/feign/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/feign/.openapi-generator/FILES b/samples/client/petstore/java/feign/.openapi-generator/FILES index 69579e43df66..72c610ee9180 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/FILES +++ b/samples/client/petstore/java/feign/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/google-api-client/.github/workflows/maven.yml b/samples/client/petstore/java/google-api-client/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/FILES b/samples/client/petstore/java/google-api-client/.openapi-generator/FILES index 2c1fbc8c4a0c..80a873b2dc99 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/FILES +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/jersey1/.github/workflows/maven.yml b/samples/client/petstore/java/jersey1/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/jersey1/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/FILES b/samples/client/petstore/java/jersey1/.openapi-generator/FILES index e8b75caa79f0..18764e6e506e 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey1/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.github/workflows/maven.yml b/samples/client/petstore/java/jersey2-java8-localdatetime/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/FILES b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/FILES index 7869f0a5550f..c1aca24c49d6 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/jersey2-java8/.github/workflows/maven.yml b/samples/client/petstore/java/jersey2-java8/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES b/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES index 7869f0a5550f..c1aca24c49d6 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/native-async/.github/workflows/maven.yml b/samples/client/petstore/java/native-async/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/native-async/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/native-async/.openapi-generator/FILES b/samples/client/petstore/java/native-async/.openapi-generator/FILES index f25839d05a58..9f46a0d9907c 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/FILES +++ b/samples/client/petstore/java/native-async/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/native/.github/workflows/maven.yml b/samples/client/petstore/java/native/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/native/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/native/.openapi-generator/FILES b/samples/client/petstore/java/native/.openapi-generator/FILES index f25839d05a58..9f46a0d9907c 100644 --- a/samples/client/petstore/java/native/.openapi-generator/FILES +++ b/samples/client/petstore/java/native/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES index f21fe42c6bcf..6421a5fdb8d2 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-parcelableModel/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES index a2155ab98abb..2d7bc290cd0a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/okhttp-gson/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES index 79249be8d257..46193871c2ea 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/rest-assured-jackson/.github/workflows/maven.yml b/samples/client/petstore/java/rest-assured-jackson/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES index fdaf5d993029..420708916e96 100644 --- a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES +++ b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/rest-assured/.github/workflows/maven.yml b/samples/client/petstore/java/rest-assured/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/FILES b/samples/client/petstore/java/rest-assured/.openapi-generator/FILES index 7aca148823e9..5839b8a8576a 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/FILES +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/resteasy/.github/workflows/maven.yml b/samples/client/petstore/java/resteasy/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/resteasy/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/FILES b/samples/client/petstore/java/resteasy/.openapi-generator/FILES index 4f43b35a7380..53a946978178 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/FILES +++ b/samples/client/petstore/java/resteasy/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/resttemplate-withXml/.github/workflows/maven.yml b/samples/client/petstore/java/resttemplate-withXml/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES index fc83fa09e36d..399977b8b4f7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/resttemplate/.github/workflows/maven.yml b/samples/client/petstore/java/resttemplate/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES index fc83fa09e36d..399977b8b4f7 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/FILES +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/retrofit2-play26/.github/workflows/maven.yml b/samples/client/petstore/java/retrofit2-play26/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES index 7dee55296a72..efc123c78ce7 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/retrofit2/.github/workflows/maven.yml b/samples/client/petstore/java/retrofit2/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2/.openapi-generator/FILES index 4c09d573d497..bdac9a27ea59 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/retrofit2rx2/.github/workflows/maven.yml b/samples/client/petstore/java/retrofit2rx2/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES index 4c09d573d497..bdac9a27ea59 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/retrofit2rx3/.github/workflows/maven.yml b/samples/client/petstore/java/retrofit2rx3/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/FILES index 4c09d573d497..bdac9a27ea59 100644 --- a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/vertx-no-nullable/.github/workflows/maven.yml b/samples/client/petstore/java/vertx-no-nullable/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/FILES b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/FILES index 71b0a60e2803..c588a14f162b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/FILES +++ b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/vertx/.github/workflows/maven.yml b/samples/client/petstore/java/vertx/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/vertx/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/vertx/.openapi-generator/FILES b/samples/client/petstore/java/vertx/.openapi-generator/FILES index 71b0a60e2803..c588a14f162b 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/FILES +++ b/samples/client/petstore/java/vertx/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/webclient-nulable-arrays/.github/workflows/maven.yml b/samples/client/petstore/java/webclient-nulable-arrays/.github/workflows/maven.yml new file mode 100644 index 000000000000..c617d2e4fb26 --- /dev/null +++ b/samples/client/petstore/java/webclient-nulable-arrays/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Minimal Example + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/FILES b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/FILES index eaed93f7b084..4f38a796a270 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/client/petstore/java/webclient/.github/workflows/maven.yml b/samples/client/petstore/java/webclient/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/client/petstore/java/webclient/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/webclient/.openapi-generator/FILES b/samples/client/petstore/java/webclient/.openapi-generator/FILES index e0a4c162f501..4e0bb18ff087 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.github/workflows/maven.yml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.github/workflows/maven.yml new file mode 100644 index 000000000000..423ba386e8fd --- /dev/null +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Extension x-auth-id-alias + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/FILES b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/FILES index 6277d88f5ab6..bd814473a6e9 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/FILES +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.github/workflows/maven.yml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.github/workflows/maven.yml new file mode 100644 index 000000000000..2f79e716371e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build test + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/FILES b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/FILES index c209475dd6e8..164e9f57c019 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.github/workflows/maven.yml b/samples/openapi3/client/petstore/java/jersey2-java8/.github/workflows/maven.yml new file mode 100644 index 000000000000..89fbd4999bc1 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES index defcfc521a20..d9a7d4789da6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/maven.yml .gitignore .travis.yml README.md From 6d9e34972113f3afc93f0a7872e1b7a2f9a71fb6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 17 Feb 2022 19:45:31 +0800 Subject: [PATCH 077/111] Update kotlin vertx server dependencies (#11631) * update kotlin vertx dep to newer versions * update kotlin to newer version --- .../resources/kotlin-vertx-server/pom.mustache | 15 +++++++-------- .../petstore/kotlin-vertx-modelMutable/pom.xml | 15 +++++++-------- samples/server/petstore/kotlin/vertx/pom.xml | 15 +++++++-------- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache index 1daf924bb137..e26747f3da75 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache @@ -12,16 +12,15 @@ UTF-8 1.8 - 1.3.10 + 1.6.10 true 1.3.5 - 4.13 - 3.4.1 - 3.8.1 + 4.13.2 + 3.9.12 + 3.10.0 1.0.2 - 2.3 - 2.7.4 - 3.6.0 + 3.2.4 + 2.13.1 @@ -188,4 +187,4 @@ - \ No newline at end of file + diff --git a/samples/server/petstore/kotlin-vertx-modelMutable/pom.xml b/samples/server/petstore/kotlin-vertx-modelMutable/pom.xml index f7dce917e48f..4bf0da66ad81 100644 --- a/samples/server/petstore/kotlin-vertx-modelMutable/pom.xml +++ b/samples/server/petstore/kotlin-vertx-modelMutable/pom.xml @@ -12,16 +12,15 @@ UTF-8 1.8 - 1.3.10 + 1.6.10 true 1.3.5 - 4.13 - 3.4.1 - 3.8.1 + 4.13.2 + 3.9.12 + 3.10.0 1.0.2 - 2.3 - 2.7.4 - 3.6.0 + 3.2.4 + 2.13.1 @@ -188,4 +187,4 @@ - \ No newline at end of file + diff --git a/samples/server/petstore/kotlin/vertx/pom.xml b/samples/server/petstore/kotlin/vertx/pom.xml index f7dce917e48f..4bf0da66ad81 100644 --- a/samples/server/petstore/kotlin/vertx/pom.xml +++ b/samples/server/petstore/kotlin/vertx/pom.xml @@ -12,16 +12,15 @@ UTF-8 1.8 - 1.3.10 + 1.6.10 true 1.3.5 - 4.13 - 3.4.1 - 3.8.1 + 4.13.2 + 3.9.12 + 3.10.0 1.0.2 - 2.3 - 2.7.4 - 3.6.0 + 3.2.4 + 2.13.1 @@ -188,4 +187,4 @@ - \ No newline at end of file + From f1ad3a89e6d078c9cc378fb6759445ad47ea221c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cerm=C3=A1k?= Date: Thu, 17 Feb 2022 17:32:34 +0100 Subject: [PATCH 078/111] [Protobuf-Schema] Add enum prefix (#11548) * [Protobuf-Schema] Add enum prefix * [Protobuf-Schema] Documentation updated * [Protobuf-Schema] Samples updated --- .../languages/ProtobufSchemaCodegen.java | 53 ++++++++++++++++--- .../protobuf-schema/models/order.proto | 6 +-- .../petstore/protobuf-schema/models/pet.proto | 6 +-- 3 files changed, 51 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 769d143091d3..4d8e4657e748 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -209,26 +209,62 @@ public String toOperationId(String operationId) { return camelize(sanitizeName(operationId)); } - public void addUnknownToAllowableValues(Map allowableValues, String name) { + /** + * Adds prefix to the enum allowable values + * NOTE: Enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it. Therefore, enum value must be unique + * + * @param allowableValues allowable values + * @param prefix added prefix + */ + public void addEnumValuesPrefix(Map allowableValues, String prefix){ + if(allowableValues.containsKey("enumVars")) { + List> enumVars = (List>)allowableValues.get("enumVars"); + + for(Map value : enumVars) { + String name = (String)value.get("name"); + value.put("name", prefix + "_" + name); + value.put("value", "\"" + prefix + "_" + name + "\""); + } + } + + if(allowableValues.containsKey("values")) { + List values = (List)allowableValues.get("values"); + for(String value : values) { + value = prefix + "_" + value; + } + } + } + + /** + * Adds unknown value to the enum allowable values + * + * @param allowableValues allowable values + */ + public void addUnknownToAllowableValues(Map allowableValues) { if(startEnumsWithUnknown) { if(allowableValues.containsKey("enumVars")) { List> enumVars = (List>)allowableValues.get("enumVars"); - + HashMap unknown = new HashMap(); - unknown.put("name", name + "_UNKNOWN"); + unknown.put("name", "UNKNOWN"); unknown.put("isString", "false"); - unknown.put("value", "\"" + name + "_UNKNOWN\""); + unknown.put("value", "\"UNKNOWN\""); enumVars.add(0, unknown); } if(allowableValues.containsKey("values")) { List values = (List)allowableValues.get("values"); - values.add(0, name + "_UNKNOWN"); + values.add(0, "UNKNOWN"); } } } + /** + * Iterates enum vars and puts index to them + * + * @param enumVars list of enum vars + */ public void addEnumIndexes(List> enumVars) { int enumIndex = 0; for (Map enumVar : enumVars) { @@ -248,8 +284,8 @@ public Map postProcessModels(Map objs) { if(cm.isEnum) { Map allowableValues = cm.getAllowableValues(); - addUnknownToAllowableValues(allowableValues, cm.getClassname()); - + addUnknownToAllowableValues(allowableValues); + addEnumValuesPrefix(allowableValues, cm.getClassname()); if (allowableValues.containsKey("enumVars")) { List> enumVars = (List>)allowableValues.get("enumVars"); addEnumIndexes(enumVars); @@ -277,7 +313,8 @@ else if (Boolean.TRUE.equals(var.isNullable && var.isPrimitiveType)) { } if (var.isEnum) { - addUnknownToAllowableValues(var.allowableValues, var.getEnumName()); + addUnknownToAllowableValues(var.allowableValues); + addEnumValuesPrefix(var.allowableValues, var.getEnumName()); if(var.allowableValues.containsKey("enumVars")) { List> enumVars = (List>) var.allowableValues.get("enumVars"); diff --git a/samples/config/petstore/protobuf-schema/models/order.proto b/samples/config/petstore/protobuf-schema/models/order.proto index 27cded1f00e1..4ca4bff35d4d 100644 --- a/samples/config/petstore/protobuf-schema/models/order.proto +++ b/samples/config/petstore/protobuf-schema/models/order.proto @@ -25,9 +25,9 @@ message Order { // Order Status enum StatusEnum { - PLACED = 0; - APPROVED = 1; - DELIVERED = 2; + StatusEnum_PLACED = 0; + StatusEnum_APPROVED = 1; + StatusEnum_DELIVERED = 2; } StatusEnum status = 355610639; diff --git a/samples/config/petstore/protobuf-schema/models/pet.proto b/samples/config/petstore/protobuf-schema/models/pet.proto index 41ed4b7a9fc5..e92a0ca33d6f 100644 --- a/samples/config/petstore/protobuf-schema/models/pet.proto +++ b/samples/config/petstore/protobuf-schema/models/pet.proto @@ -29,9 +29,9 @@ message Pet { // pet status in the store enum StatusEnum { - AVAILABLE = 0; - PENDING = 1; - SOLD = 2; + StatusEnum_AVAILABLE = 0; + StatusEnum_PENDING = 1; + StatusEnum_SOLD = 2; } StatusEnum status = 355610639; From 1b8dae18b8f30a5dd075fd618050b1e73bc17ae4 Mon Sep 17 00:00:00 2001 From: Ran Halprin Date: Thu, 17 Feb 2022 08:47:28 -0800 Subject: [PATCH 079/111] typescript-fetch: Support deprecated parameters, operations (#11523) Co-authored-by: Ran Halprin --- .../src/main/resources/typescript-fetch/apis.mustache | 3 +++ .../resources/typescript-fetch/modelGenericInterfaces.mustache | 3 +++ 2 files changed, 6 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index bbdf2edf4a35..a34af7338dcc 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -46,6 +46,9 @@ export interface {{classname}}Interface { * @param {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} * @param {*} [options] Override http request option. + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} * @throws {RequiredError} * @memberof {{classname}}Interface */ diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache index c2b7823f7c23..f75eb0a0c5f4 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache @@ -12,6 +12,9 @@ export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{ * {{#lambda.indented_star_4}}{{{unescapedDescription}}}{{/lambda.indented_star_4}} * @type {{=<% %>=}}{<%&datatype%>}<%={{ }}=%> * @memberof {{classname}} + {{#deprecated}} + * @deprecated + {{/deprecated}} */ {{#isReadOnly}}readonly {{/isReadOnly}}{{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}; {{/vars}} From d00a5c304f66e149d50e4c083253cd0e666a300d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 18 Feb 2022 00:53:42 +0800 Subject: [PATCH 080/111] update samples --- .../builds/default-v3.0/models/ObjectWithDeprecatedFields.ts | 3 +++ .../typescript-fetch/builds/with-interfaces/apis/PetApi.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts index c14eb976bfad..1ea8d319f116 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts @@ -36,18 +36,21 @@ export interface ObjectWithDeprecatedFields { * * @type {number} * @memberof ObjectWithDeprecatedFields + * @deprecated */ id?: number; /** * * @type {DeprecatedObject} * @memberof ObjectWithDeprecatedFields + * @deprecated */ deprecatedRef?: DeprecatedObject; /** * * @type {Array} * @memberof ObjectWithDeprecatedFields + * @deprecated */ bars?: Array; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts index 9c3628a326d2..c102e434f853 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts @@ -119,6 +119,7 @@ export interface PetApiInterface { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApiInterface */ From 03cca89b80e534f7cf66026ed03fd6a8885c86d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Cebri=C3=A1n=20Gonz=C3=A1lez?= Date: Fri, 18 Feb 2022 04:09:00 +0100 Subject: [PATCH 081/111] :pencil2: Fixed typo error on java generator config-help command (#11644) Fix the typo error "proeprties" to properties inside the gradleProperties config for java generator --- docs/generators/java.md | 2 +- .../org/openapitools/codegen/languages/JavaClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/java.md b/docs/generators/java.md index 8e4aabdef1f3..3f6417f32f8e 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -44,7 +44,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| |errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| -|gradleProperties|Append additional Gradle proeprties to the gradle.properties file| |null| +|gradleProperties|Append additional Gradle properties to the gradle.properties file| |null| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 264f8b41bbf2..63f49f9a3fc4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -156,7 +156,7 @@ public JavaClientCodegen() { cliOptions.add(CliOption.newBoolean(USE_ABSTRACTION_FOR_FILES, "Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, libraries")); cliOptions.add(CliOption.newBoolean(DYNAMIC_OPERATIONS, "Generate operations dynamically at runtime from an OAS", this.dynamicOperations)); cliOptions.add(CliOption.newBoolean(SUPPORT_STREAMING, "Support streaming endpoint (beta)", this.supportStreaming)); - cliOptions.add(CliOption.newString(GRADLE_PROPERTIES, "Append additional Gradle proeprties to the gradle.properties file")); + cliOptions.add(CliOption.newString(GRADLE_PROPERTIES, "Append additional Gradle properties to the gradle.properties file")); cliOptions.add(CliOption.newString(ERROR_OBJECT_TYPE, "Error Object type. (This option is for okhttp-gson-next-gen only)")); cliOptions.add(CliOption.newString(CONFIG_KEY, "Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.")); From 1f6b3eb604e927e01bfc0d0d3d745d83b4fc9982 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 18 Feb 2022 11:20:09 +0800 Subject: [PATCH 082/111] Remove go-deprecated generator (#11645) * remove go-deprecated generator * update doc --- docs/generators.md | 1 - docs/generators/flash-deprecated.md | 193 ------------- docs/generators/go-deprecated.md | 224 --------------- docs/generators/kotlin-server-deprecated.md | 272 ------------------ docs/generators/php-silex-deprecated.md | 236 --------------- .../typescript-angularjs-deprecated.md | 253 ---------------- .../languages/GoDeprecatedClientCodegen.java | 255 ---------------- .../org.openapitools.codegen.CodegenConfig | 1 - .../codegen/go/GoClientCodegenTest.java | 11 +- .../codegen/go/GoClientOptionsTest.java | 8 +- .../openapitools/codegen/go/GoModelTest.java | 22 +- .../options/GoClientOptionsProvider.java | 7 +- 12 files changed, 25 insertions(+), 1458 deletions(-) delete mode 100644 docs/generators/flash-deprecated.md delete mode 100644 docs/generators/go-deprecated.md delete mode 100644 docs/generators/kotlin-server-deprecated.md delete mode 100644 docs/generators/php-silex-deprecated.md delete mode 100644 docs/generators/typescript-angularjs-deprecated.md delete mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoDeprecatedClientCodegen.java diff --git a/docs/generators.md b/docs/generators.md index 4dda7bc557fa..c1f09094dbc8 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -30,7 +30,6 @@ The following generators are available: * [erlang-client](generators/erlang-client.md) * [erlang-proper](generators/erlang-proper.md) * [go](generators/go.md) -* [go-deprecated (deprecated)](generators/go-deprecated.md) * [groovy](generators/groovy.md) * [haskell-http-client](generators/haskell-http-client.md) * [java](generators/java.md) diff --git a/docs/generators/flash-deprecated.md b/docs/generators/flash-deprecated.md deleted file mode 100644 index 7969d5f8e0ef..000000000000 --- a/docs/generators/flash-deprecated.md +++ /dev/null @@ -1,193 +0,0 @@ ---- -title: Documentation for the flash-deprecated Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | flash-deprecated | pass this to the generate command after -g | -| generator stability | DEPRECATED | | -| generator type | CLIENT | | -| generator language | Flash | | -| generator default templating engine | mustache | | -| helpTxt | Generates a Flash (ActionScript) client library (beta). IMPORTANT: this generator has been deprecated in v5.x | | - -## 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 | -| ------ | ----------- | ------ | ------- | -|invokerPackage|root package for generated code| |null| -|packageName|flash package name (convention: package.name)| |org.openapitools| -|packageVersion|flash package version| |1.0.0| -|sourceFolder|source folder for generated code. e.g. flash| |null| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | -|File|flash.filesystem.File| - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | - - -## LANGUAGE PRIMITIVES - -
      -
    • Array
    • -
    • Boolean
    • -
    • Date
    • -
    • Dictionary
    • -
    • Number
    • -
    • String
    • -
    - -## RESERVED WORDS - -
      -
    • add
    • -
    • and
    • -
    • break
    • -
    • continue
    • -
    • delete
    • -
    • do
    • -
    • else
    • -
    • eq
    • -
    • for
    • -
    • function
    • -
    • ge
    • -
    • gt
    • -
    • if
    • -
    • ifframeloaded
    • -
    • in
    • -
    • le
    • -
    • lt
    • -
    • ne
    • -
    • new
    • -
    • not
    • -
    • on
    • -
    • onclipevent
    • -
    • or
    • -
    • return
    • -
    • telltarget
    • -
    • this
    • -
    • typeof
    • -
    • var
    • -
    • void
    • -
    • while
    • -
    • with
    • -
    - -## 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 -|Array|✓|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 - -### 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 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/go-deprecated.md b/docs/generators/go-deprecated.md deleted file mode 100644 index e72c7b7f8475..000000000000 --- a/docs/generators/go-deprecated.md +++ /dev/null @@ -1,224 +0,0 @@ ---- -title: Documentation for the go-deprecated Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | go-deprecated | pass this to the generate command after -g | -| generator stability | DEPRECATED | | -| generator type | CLIENT | | -| generator language | Go | | -| generator default templating engine | mustache | | -| helpTxt | Generates a Go client library (beta). NOTE: this generator has been deprecated. Please use `go` client generator instead. | | - -## 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 | -| ------ | ----------- | ------ | ------- | -|enumClassPrefix|Prefix enum with class name| |false| -|generateInterfaces|Generate interfaces for api classes| |false| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|isGoSubmodule|whether the generated Go module is a submodule| |false| -|packageName|Go package name (convention: lowercase).| |openapi| -|packageVersion|Go package version.| |1.0.0| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false| -|withAWSV4Signature|whether to include AWS v4 signature support| |false| -|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default in GitHub PRs and diffs| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | - - -## LANGUAGE PRIMITIVES - -
      -
    • bool
    • -
    • byte
    • -
    • complex128
    • -
    • complex64
    • -
    • float32
    • -
    • float64
    • -
    • int
    • -
    • int32
    • -
    • int64
    • -
    • interface{}
    • -
    • map[string]interface{}
    • -
    • rune
    • -
    • string
    • -
    • uint
    • -
    • uint32
    • -
    • uint64
    • -
    - -## RESERVED WORDS - -
      -
    • bool
    • -
    • break
    • -
    • byte
    • -
    • case
    • -
    • chan
    • -
    • complex128
    • -
    • complex64
    • -
    • const
    • -
    • continue
    • -
    • default
    • -
    • defer
    • -
    • else
    • -
    • error
    • -
    • fallthrough
    • -
    • float32
    • -
    • float64
    • -
    • for
    • -
    • func
    • -
    • go
    • -
    • goto
    • -
    • if
    • -
    • import
    • -
    • int
    • -
    • int16
    • -
    • int32
    • -
    • int64
    • -
    • int8
    • -
    • interface
    • -
    • map
    • -
    • nil
    • -
    • package
    • -
    • range
    • -
    • return
    • -
    • rune
    • -
    • select
    • -
    • string
    • -
    • struct
    • -
    • switch
    • -
    • type
    • -
    • uint
    • -
    • uint16
    • -
    • uint32
    • -
    • uint64
    • -
    • uint8
    • -
    • uintptr
    • -
    • var
    • -
    - -## 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 -|Array|✓|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 - -### 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 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/kotlin-server-deprecated.md b/docs/generators/kotlin-server-deprecated.md deleted file mode 100644 index f612a372854c..000000000000 --- a/docs/generators/kotlin-server-deprecated.md +++ /dev/null @@ -1,272 +0,0 @@ ---- -title: Documentation for the kotlin-server-deprecated Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | kotlin-server-deprecated | pass this to the generate command after -g | -| generator stability | DEPRECATED | | -| generator type | SERVER | | -| generator language | Kotlin | | -| generator default templating engine | mustache | | -| helpTxt | Generates a Kotlin server (Ktor v1.1.3). IMPORTANT: this generator has been deprecated. Please migrate to `kotlin-server` which supports Ktor v1.5.2+. | | - -## 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 | -| ------ | ----------- | ------ | ------- | -|apiSuffix|suffix for api classes| |Api| -|artifactId|Generated artifact id (name of jar).| |kotlin-server-deprecated| -|artifactVersion|Generated artifact's package version.| |1.0.0| -|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| -|featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true| -|featureCORS|Ktor by default provides an interceptor for implementing proper support for Cross-Origin Resource Sharing (CORS). See enable-cors.org.| |false| -|featureCompression|Adds ability to compress outgoing content using gzip, deflate or custom encoder and thus reduce size of the response.| |true| -|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false| -|featureHSTS|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |true| -|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| -|library|library template (sub-template)|
    **ktor**
    ktor framework
    |ktor| -|modelMutable|Create mutable models| |false| -|packageName|Generated artifact package name.| |org.openapitools.server| -|parcelizeModels|toggle "@Parcelize" for generated models| |null| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| -|sourceFolder|source folder for generated code| |src/main/kotlin| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | -|BigDecimal|java.math.BigDecimal| -|Date|java.time.LocalDate| -|DateTime|java.time.OffsetDateTime| -|File|java.io.File| -|LocalDate|java.time.LocalDate| -|LocalDateTime|java.time.LocalDateTime| -|LocalTime|java.time.LocalTime| -|Timestamp|java.sql.Timestamp| -|URI|java.net.URI| -|UUID|java.util.UUID| - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | -|array|kotlin.collections.ArrayList| -|list|kotlin.collections.ArrayList| -|map|kotlin.collections.HashMap| - - -## LANGUAGE PRIMITIVES - -
      -
    • kotlin.Array
    • -
    • kotlin.Boolean
    • -
    • kotlin.Byte
    • -
    • kotlin.ByteArray
    • -
    • kotlin.Char
    • -
    • kotlin.Double
    • -
    • kotlin.Float
    • -
    • kotlin.Int
    • -
    • kotlin.Long
    • -
    • kotlin.Short
    • -
    • kotlin.String
    • -
    • kotlin.collections.List
    • -
    • kotlin.collections.Map
    • -
    • kotlin.collections.MutableList
    • -
    • kotlin.collections.MutableMap
    • -
    • kotlin.collections.MutableSet
    • -
    • kotlin.collections.Set
    • -
    - -## RESERVED WORDS - -
      -
    • ApiResponse
    • -
    • abstract
    • -
    • actual
    • -
    • annotation
    • -
    • as
    • -
    • break
    • -
    • class
    • -
    • companion
    • -
    • const
    • -
    • constructor
    • -
    • continue
    • -
    • crossinline
    • -
    • data
    • -
    • delegate
    • -
    • do
    • -
    • dynamic
    • -
    • else
    • -
    • enum
    • -
    • expect
    • -
    • external
    • -
    • false
    • -
    • field
    • -
    • final
    • -
    • finally
    • -
    • for
    • -
    • fun
    • -
    • if
    • -
    • import
    • -
    • in
    • -
    • infix
    • -
    • init
    • -
    • inline
    • -
    • inner
    • -
    • interface
    • -
    • internal
    • -
    • is
    • -
    • it
    • -
    • lateinit
    • -
    • noinline
    • -
    • null
    • -
    • object
    • -
    • open
    • -
    • operator
    • -
    • out
    • -
    • override
    • -
    • package
    • -
    • param
    • -
    • private
    • -
    • property
    • -
    • protected
    • -
    • public
    • -
    • receiver
    • -
    • reified
    • -
    • return
    • -
    • sealed
    • -
    • setparam
    • -
    • super
    • -
    • suspend
    • -
    • tailrec
    • -
    • this
    • -
    • throw
    • -
    • true
    • -
    • try
    • -
    • typealias
    • -
    • typeof
    • -
    • val
    • -
    • value
    • -
    • var
    • -
    • vararg
    • -
    • when
    • -
    • where
    • -
    • while
    • -
    - -## 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 -|Array|✓|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 - -### 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 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/php-silex-deprecated.md b/docs/generators/php-silex-deprecated.md deleted file mode 100644 index 38d5c63f1125..000000000000 --- a/docs/generators/php-silex-deprecated.md +++ /dev/null @@ -1,236 +0,0 @@ ---- -title: Documentation for the php-silex-deprecated Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | php-silex-deprecated | pass this to the generate command after -g | -| generator stability | DEPRECATED | | -| generator type | SERVER | | -| generator language | PHP | | -| generator default templating engine | mustache | | -| helpTxt | Generates a PHP Silex server library. IMPORTANT NOTE: this generator is no longer actively maintained. | | - -## 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| -|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| -|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| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | -|array|array| -|map|map| - - -## LANGUAGE PRIMITIVES - -
      -
    • DateTime
    • -
    • boolean
    • -
    • double
    • -
    • float
    • -
    • int
    • -
    • integer
    • -
    • mixed
    • -
    • number
    • -
    • object
    • -
    • string
    • -
    - -## RESERVED WORDS - -
      -
    • __halt_compiler
    • -
    • abstract
    • -
    • and
    • -
    • array
    • -
    • as
    • -
    • break
    • -
    • callable
    • -
    • case
    • -
    • catch
    • -
    • class
    • -
    • clone
    • -
    • const
    • -
    • continue
    • -
    • declare
    • -
    • default
    • -
    • die
    • -
    • do
    • -
    • echo
    • -
    • else
    • -
    • elseif
    • -
    • empty
    • -
    • enddeclare
    • -
    • endfor
    • -
    • endforeach
    • -
    • endif
    • -
    • endswitch
    • -
    • endwhile
    • -
    • eval
    • -
    • exit
    • -
    • extends
    • -
    • final
    • -
    • for
    • -
    • foreach
    • -
    • function
    • -
    • global
    • -
    • goto
    • -
    • if
    • -
    • implements
    • -
    • include
    • -
    • include_once
    • -
    • instanceof
    • -
    • insteadof
    • -
    • interface
    • -
    • isset
    • -
    • list
    • -
    • namespace
    • -
    • new
    • -
    • or
    • -
    • print
    • -
    • private
    • -
    • protected
    • -
    • public
    • -
    • require
    • -
    • require_once
    • -
    • return
    • -
    • static
    • -
    • switch
    • -
    • throw
    • -
    • trait
    • -
    • try
    • -
    • unset
    • -
    • use
    • -
    • var
    • -
    • while
    • -
    • xor
    • -
    - -## 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 -|Array|✓|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 - -### 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 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/typescript-angularjs-deprecated.md b/docs/generators/typescript-angularjs-deprecated.md deleted file mode 100644 index 1097c4cd2f58..000000000000 --- a/docs/generators/typescript-angularjs-deprecated.md +++ /dev/null @@ -1,253 +0,0 @@ ---- -title: Documentation for the typescript-angularjs-deprecated Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | typescript-angularjs-deprecated | pass this to the generate command after -g | -| generator stability | DEPRECATED | | -| generator type | CLIENT | | -| generator language | Typescript | | -| generator default templating engine | mustache | | -| helpTxt | Generates a TypeScript AngularJS client library. This generator has been deprecated and will be removed in the future release. | | - -## 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| -|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| -|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| -|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| -|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| -|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| -|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| -|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false| -|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|supportsES6|Generate code that conforms to ES6.| |false| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | -|array|Array| - - -## LANGUAGE PRIMITIVES - -
      -
    • Array
    • -
    • Boolean
    • -
    • Date
    • -
    • Double
    • -
    • Error
    • -
    • File
    • -
    • Float
    • -
    • Integer
    • -
    • Long
    • -
    • Map
    • -
    • Object
    • -
    • ReadonlyArray
    • -
    • Set
    • -
    • String
    • -
    • any
    • -
    • boolean
    • -
    • number
    • -
    • object
    • -
    • string
    • -
    - -## RESERVED WORDS - -
      -
    • abstract
    • -
    • await
    • -
    • boolean
    • -
    • break
    • -
    • byte
    • -
    • case
    • -
    • catch
    • -
    • char
    • -
    • class
    • -
    • const
    • -
    • continue
    • -
    • debugger
    • -
    • default
    • -
    • delete
    • -
    • do
    • -
    • double
    • -
    • else
    • -
    • enum
    • -
    • export
    • -
    • extends
    • -
    • false
    • -
    • final
    • -
    • finally
    • -
    • float
    • -
    • for
    • -
    • formParams
    • -
    • function
    • -
    • goto
    • -
    • headerParams
    • -
    • if
    • -
    • implements
    • -
    • import
    • -
    • in
    • -
    • instanceof
    • -
    • int
    • -
    • interface
    • -
    • let
    • -
    • long
    • -
    • native
    • -
    • new
    • -
    • null
    • -
    • package
    • -
    • private
    • -
    • protected
    • -
    • public
    • -
    • queryParameters
    • -
    • requestOptions
    • -
    • return
    • -
    • short
    • -
    • static
    • -
    • super
    • -
    • switch
    • -
    • synchronized
    • -
    • this
    • -
    • throw
    • -
    • transient
    • -
    • true
    • -
    • try
    • -
    • typeof
    • -
    • useFormData
    • -
    • var
    • -
    • varLocalDeferred
    • -
    • varLocalPath
    • -
    • void
    • -
    • volatile
    • -
    • 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 -|Array|✓|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 - -### 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 - -### 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/GoDeprecatedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoDeprecatedClientCodegen.java deleted file mode 100644 index 0436961b0e71..000000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoDeprecatedClientCodegen.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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.languages; - -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.SupportingFile; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.EnumSet; - -public class GoDeprecatedClientCodegen extends AbstractGoCodegen { - - private final Logger LOGGER = LoggerFactory.getLogger(GoDeprecatedClientCodegen.class); - - protected String packageVersion = "1.0.0"; - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; - protected boolean isGoSubmodule = false; - public static final String WITH_GO_CODEGEN_COMMENT = "withGoCodegenComment"; - public static final String WITH_XML = "withXml"; - public static final String STRUCT_PREFIX = "structPrefix"; - public static final String WITH_AWSV4_SIGNATURE = "withAWSV4Signature"; - public static final String GENERATE_INTERFACES = "generateInterfaces"; - - public GoDeprecatedClientCodegen() { - super(); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata).stability(Stability.DEPRECATED).build(); - - modifyFeatureSet(features -> features - .includeDocumentationFeatures(DocumentationFeature.Readme) - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML)) - .securityFeatures(EnumSet.of( - SecurityFeature.BasicAuth, - SecurityFeature.ApiKey, - SecurityFeature.OAuth2_Implicit - )) - .includeGlobalFeatures( - GlobalFeature.ParameterizedServer - ) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .includeParameterFeatures( - ParameterFeature.Cookie - ) - .includeClientModificationFeatures( - ClientModificationFeature.BasePath, - ClientModificationFeature.UserAgent - ) - ); - - outputFolder = "generated-code/go-deprecated"; - modelTemplateFiles.put("model.mustache", ".go"); - apiTemplateFiles.put("api.mustache", ".go"); - - modelDocTemplateFiles.put("model_doc.mustache", ".md"); - apiDocTemplateFiles.put("api_doc.mustache", ".md"); - - embeddedTemplateDir = templateDir = "go-deprecated"; - - // default HIDE_GENERATION_TIMESTAMP to true - hideGenerationTimestamp = Boolean.TRUE; - - cliOptions.add(CliOption.newBoolean(CodegenConstants.IS_GO_SUBMODULE, CodegenConstants.IS_GO_SUBMODULE_DESC)); - cliOptions.add(CliOption.newBoolean(WITH_GO_CODEGEN_COMMENT, "whether to include Go codegen comment to disable Go Lint and collapse by default in GitHub PRs and diffs")); - cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)")); - cliOptions.add(CliOption.newBoolean(CodegenConstants.ENUM_CLASS_PREFIX, CodegenConstants.ENUM_CLASS_PREFIX_DESC)); - cliOptions.add(CliOption.newBoolean(STRUCT_PREFIX, "whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts")); - cliOptions.add(CliOption.newBoolean(WITH_AWSV4_SIGNATURE, "whether to include AWS v4 signature support")); - cliOptions.add(CliOption.newBoolean(GENERATE_INTERFACES, "Generate interfaces for api classes")); - - // option to change the order of form/body parameter - cliOptions.add(CliOption.newBoolean( - CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, - CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC) - .defaultValue(Boolean.FALSE.toString())); - } - - @Override - public void processOpts() { - super.processOpts(); - - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { - setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); - } else { - setPackageName("openapi"); - } - - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { - setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); - } else { - setPackageVersion("1.0.0"); - } - - additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); - additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); - - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - modelPackage = packageName; - apiPackage = packageName; - - supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml")); - supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); - supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go")); - supportingFiles.add(new SupportingFile("client.mustache", "", "client.go")); - supportingFiles.add(new SupportingFile("response.mustache", "", "response.go")); - supportingFiles.add(new SupportingFile("go.mod.mustache", "", "go.mod")); - supportingFiles.add(new SupportingFile("go.sum", "", "go.sum")); - supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); - - if (additionalProperties.containsKey(WITH_GO_CODEGEN_COMMENT)) { - setWithGoCodegenComment(Boolean.parseBoolean(additionalProperties.get(WITH_GO_CODEGEN_COMMENT).toString())); - additionalProperties.put(WITH_GO_CODEGEN_COMMENT, withGoCodegenComment); - } - - if (additionalProperties.containsKey(WITH_AWSV4_SIGNATURE)) { - setWithAWSV4Signature(Boolean.parseBoolean(additionalProperties.get(WITH_AWSV4_SIGNATURE).toString())); - additionalProperties.put(WITH_AWSV4_SIGNATURE, withAWSV4Signature); - } - - if (additionalProperties.containsKey(WITH_XML)) { - setWithXml(Boolean.parseBoolean(additionalProperties.get(WITH_XML).toString())); - additionalProperties.put(WITH_XML, withXml); - } - - if (additionalProperties.containsKey(CodegenConstants.ENUM_CLASS_PREFIX)) { - setEnumClassPrefix(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.ENUM_CLASS_PREFIX).toString())); - additionalProperties.put(CodegenConstants.ENUM_CLASS_PREFIX, enumClassPrefix); - } - - if (additionalProperties.containsKey(CodegenConstants.IS_GO_SUBMODULE)) { - setIsGoSubmodule(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.IS_GO_SUBMODULE).toString())); - additionalProperties.put(CodegenConstants.IS_GO_SUBMODULE, isGoSubmodule); - } - - if (additionalProperties.containsKey(STRUCT_PREFIX)) { - setStructPrefix(Boolean.parseBoolean(additionalProperties.get(STRUCT_PREFIX).toString())); - additionalProperties.put(STRUCT_PREFIX, structPrefix); - } - - if (additionalProperties.containsKey(GENERATE_INTERFACES)) { - setGenerateInterfaces(Boolean.parseBoolean(additionalProperties.get(GENERATE_INTERFACES).toString())); - additionalProperties.put(GENERATE_INTERFACES, generateInterfaces); - } - } - - /** - * Configures the type of generator. - * - * @return the CodegenType for this generator - * @see org.openapitools.codegen.CodegenType - */ - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - /** - * Configures a friendly name for the generator. This will be used by the generator - * to select the library with the -g flag. - * - * @return the friendly name for the generator - */ - @Override - public String getName() { - return "go-deprecated"; - } - - /** - * Returns human-friendly help for the generator. Provide the consumer with help - * tips, parameters here - * - * @return A string value for the help message - */ - @Override - public String getHelp() { - return "Generates a Go client library (beta). NOTE: this generator has been deprecated. Please use `go` client generator instead."; - } - - /** - * Location to write api files. You can use the apiPackage() as defined when the class is - * instantiated - */ - @Override - public String apiFileFolder() { - return outputFolder + File.separator; - } - - @Override - public String modelFileFolder() { - return outputFolder + File.separator; - } - - @Override - public String apiDocFileFolder() { - return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); - } - - @Override - public String modelDocFileFolder() { - return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); - } - - @Override - public String toModelDocFilename(String name) { - return toModelName(name); - } - - @Override - public String toApiDocFilename(String name) { - return toApiName(name); - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - - public void setIsGoSubmodule(boolean isGoSubmodule) { - this.isGoSubmodule = isGoSubmodule; - } - -} 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 0b6c579e434f..201b4ce97fd1 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 @@ -35,7 +35,6 @@ org.openapitools.codegen.languages.ErlangServerCodegen org.openapitools.codegen.languages.FsharpFunctionsServerCodegen org.openapitools.codegen.languages.FsharpGiraffeServerCodegen org.openapitools.codegen.languages.GoClientCodegen -org.openapitools.codegen.languages.GoDeprecatedClientCodegen org.openapitools.codegen.languages.GoEchoServerCodegen org.openapitools.codegen.languages.GoServerCodegen org.openapitools.codegen.languages.GoGinServerCodegen diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java index 8009e3e2c3d3..ca5271746d47 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java @@ -23,7 +23,6 @@ import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.GoDeprecatedClientCodegen; import org.openapitools.codegen.languages.GoClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; @@ -32,7 +31,7 @@ public class GoClientCodegenTest { @Test public void testInitialConfigValues() throws Exception { - final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); + final GoClientCodegen codegen = new GoClientCodegen(); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); @@ -41,7 +40,7 @@ public void testInitialConfigValues() throws Exception { @Test public void testSettersForConfigValues() throws Exception { - final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); + final GoClientCodegen codegen = new GoClientCodegen(); codegen.setHideGenerationTimestamp(false); codegen.processOpts(); @@ -51,7 +50,7 @@ public void testSettersForConfigValues() throws Exception { @Test public void testAdditionalPropertiesPutForConfigValues() throws Exception { - final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); + final GoClientCodegen codegen = new GoClientCodegen(); codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); codegen.processOpts(); @@ -62,7 +61,7 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { @Test(description = "test example value for body parameter") public void bodyParameterTest() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); - final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); + final GoClientCodegen codegen = new GoClientCodegen(); codegen.setOpenAPI(openAPI); final String path = "/fake"; final Operation p = openAPI.getPaths().get(path).getGet(); @@ -95,7 +94,7 @@ public void ensureParameterNameUniqueTest() { @Test public void testFilenames() throws Exception { - final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); + final GoClientCodegen codegen = new GoClientCodegen(); // Model names are generated from schema / definition names Assert.assertEquals(codegen.toModelFilename("Animal"), "model_animal"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java index 139c3162b571..7ace9c09cab4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java @@ -19,7 +19,7 @@ import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.GoDeprecatedClientCodegen; +import org.openapitools.codegen.languages.GoClientCodegen; import org.openapitools.codegen.options.GoClientOptionsProvider; import static org.mockito.Mockito.mock; @@ -27,7 +27,7 @@ public class GoClientOptionsTest extends AbstractOptionsTest { - private GoDeprecatedClientCodegen clientCodegen = mock(GoDeprecatedClientCodegen.class, mockSettings); + private GoClientCodegen clientCodegen = mock(GoClientCodegen.class, mockSettings); public GoClientOptionsTest() { super(new GoClientOptionsProvider()); @@ -43,13 +43,13 @@ protected CodegenConfig getCodegenConfig() { protected void verifyOptions() { verify(clientCodegen).setPackageVersion(GoClientOptionsProvider.PACKAGE_VERSION_VALUE); verify(clientCodegen).setPackageName(GoClientOptionsProvider.PACKAGE_NAME_VALUE); - verify(clientCodegen).setWithGoCodegenComment(GoClientOptionsProvider.WITH_GO_CODEGEN_COMMENT_VALUE); verify(clientCodegen).setWithXml(GoClientOptionsProvider.WITH_XML_VALUE); verify(clientCodegen).setEnumClassPrefix(GoClientOptionsProvider.ENUM_CLASS_PREFIX_VALUE); verify(clientCodegen).setPrependFormOrBodyParameters(GoClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE); verify(clientCodegen).setIsGoSubmodule(GoClientOptionsProvider.IS_GO_SUBMODULE_VALUE); + verify(clientCodegen).setGenerateInterfaces(GoClientOptionsProvider.GENERATE_INTERFACES_VALUE); verify(clientCodegen).setStructPrefix(GoClientOptionsProvider.STRUCT_PREFIX_VALUE); verify(clientCodegen).setWithAWSV4Signature(GoClientOptionsProvider.WITH_AWSV4_SIGNATURE); - verify(clientCodegen).setGenerateInterfaces(GoClientOptionsProvider.GENERATE_INTERFACES_VALUE); + verify(clientCodegen).setUseOneOfDiscriminatorLookup(GoClientOptionsProvider.USE_ONE_OF_DISCRIMINATOR_LOOKUP_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java index b0cb58177ef2..f27115bc831d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java @@ -25,7 +25,7 @@ import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.GoDeprecatedClientCodegen; +import org.openapitools.codegen.languages.GoClientCodegen; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -42,7 +42,7 @@ public void simpleModelTest() { .addProperties("createdAt", new DateTimeSchema()) .addRequiredItem("id") .addRequiredItem("name"); - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -89,7 +89,7 @@ public void listPropertyTest() { .addProperties("urls", new ArraySchema() .items(new StringSchema())) .addRequiredItem("id"); - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -125,7 +125,7 @@ public void mapPropertyTest() { .addProperties("translations", new MapSchema() .additionalProperties(new StringSchema())) .addRequiredItem("id"); - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -151,7 +151,7 @@ public void complexPropertyTest() { final Schema model = new Schema() .description("a sample model") .addProperties("children", new Schema().$ref("#/definitions/Children")); - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -175,7 +175,7 @@ public void complexListProperty() { .description("a sample model") .addProperties("children", new ArraySchema() .items(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -201,7 +201,7 @@ public void complexMapProperty() { .description("a sample model") .addProperties("children", new MapSchema() .additionalProperties(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -228,7 +228,7 @@ public void arrayModelTest() { final Schema model = new ArraySchema() .items(new Schema().$ref("#/definitions/Children")) .description("an array model"); - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -245,7 +245,7 @@ public void mapModelTest() { final Schema model = new Schema() .additionalProperties(new Schema().$ref("#/definitions/Children")) .description("a map model"); - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -260,7 +260,7 @@ public void mapModelTest() { @Test(description = "convert file type and file schema models") public void filePropertyTest() { - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); final Schema model1 = new Schema().type("file"); Assert.assertEquals(codegen.getSchemaType(model1), "*os.File"); Assert.assertEquals(codegen.getTypeDeclaration(model1), "*os.File"); @@ -290,7 +290,7 @@ public static Object[][] primeNumbers() { @Test(dataProvider = "modelNames", description = "avoid inner class") public void modelNameTest(String name, String expectedName) { final Schema model = new Schema(); - final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); + final DefaultCodegen codegen = new GoClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema(name, model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel(name, model); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java index 3ac5e44cf9ac..ef8fa66558b9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java @@ -34,6 +34,8 @@ public class GoClientOptionsProvider implements OptionsProvider { public static final boolean STRUCT_PREFIX_VALUE = true; public static final boolean WITH_AWSV4_SIGNATURE = true; public static final boolean GENERATE_INTERFACES_VALUE = true; + public static final boolean DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_VALUE = true; + public static final boolean USE_ONE_OF_DISCRIMINATOR_LOOKUP_VALUE = true; @Override public String getLanguage() { @@ -46,13 +48,14 @@ public Map createOptions() { return builder .put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE) .put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE) + .put(CodegenConstants.IS_GO_SUBMODULE, "true") .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") - .put(CodegenConstants.WITH_GO_CODEGEN_COMMENT, "true") .put(CodegenConstants.WITH_XML, "true") .put(CodegenConstants.ENUM_CLASS_PREFIX, "true") .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, "true") - .put(CodegenConstants.IS_GO_SUBMODULE, "true") .put(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT, "true") + .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, "true") .put("generateInterfaces", "true") .put("structPrefix", "true") .build(); From 9517a9525b8b9b4016a809d0cde41232780907b7 Mon Sep 17 00:00:00 2001 From: sullis Date: Thu, 17 Feb 2022 19:24:19 -0800 Subject: [PATCH 083/111] [java] enhance unit tests for JavaJerseyServerCodegen (#11643) --- .../jaxrs/JavaJerseyServerCodegenTest.java | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java index f9e148b5e7ce..7cfb0c23c00e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java @@ -1,5 +1,7 @@ package org.openapitools.codegen.java.jaxrs; +import com.google.common.collect.ImmutableList; + import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.servers.Server; @@ -7,12 +9,16 @@ import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.DefaultCodegen; +import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.JavaJerseyServerCodegen; import org.openapitools.codegen.languages.features.CXFServerFeatures; import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.templating.MustacheEngineAdapter; import org.testng.Assert; import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static org.openapitools.codegen.TestUtils.assertFileContains; @@ -20,6 +26,7 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -33,6 +40,12 @@ public void before() { @Test public void testInitialConfigValues() throws Exception { + Assert.assertEquals(codegen.getTag(), CodegenType.SERVER); + Assert.assertEquals(codegen.getName(), "jaxrs-jersey"); + Assert.assertEquals(codegen.getTemplatingEngine().getClass(), MustacheEngineAdapter.class); + Assert.assertEquals(codegen.getDateLibrary(), "legacy"); + Assert.assertNull(codegen.getInputSpec()); + codegen.processOpts(); OpenAPI openAPI = new OpenAPI(); @@ -56,6 +69,7 @@ public void testSettersForConfigValues() throws Exception { codegen.setModelPackage("xx.yyyyyyyy.model"); codegen.setApiPackage("xx.yyyyyyyy.api"); codegen.setInvokerPackage("xx.yyyyyyyy.invoker"); + codegen.setDateLibrary("java8"); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); @@ -66,6 +80,7 @@ public void testSettersForConfigValues() throws Exception { Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xx.yyyyyyyy.api"); Assert.assertEquals(codegen.getInvokerPackage(), "xx.yyyyyyyy.invoker"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xx.yyyyyyyy.invoker"); + Assert.assertEquals(codegen.getDateLibrary(), "java8"); } @Test @@ -93,7 +108,7 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { } // Helper function, intended to reduce boilerplate @ copied from ../spring/SpringCodegenTest.java - private Map generateFiles(DefaultCodegen codegen, String filePath) throws IOException { + static private Map generateFiles(DefaultCodegen codegen, String filePath) throws IOException { final File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); output.deleteOnExit(); final String outputPath = output.getAbsolutePath().replace('\\', '/'); @@ -107,14 +122,31 @@ private Map generateFiles(DefaultCodegen codegen, String filePath) input.config(codegen); final DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(input).generate(); + final List files = generator.opts(input).generate(); + + Assert.assertTrue(files.size() > 0); + TestUtils.validateJavaSourceFiles(files); return files.stream().collect(Collectors.toMap(e -> e.getName().replace(outputPath, ""), i -> i)); } + @DataProvider(name = "codegenParameterMatrix") + public Object[][] codegenParameterMatrix() { + final List rows = new ArrayList(); + for (final String jerseyLibrary: ImmutableList.of("jersey1", "jersey2")) { + for (final String dateLibrary: ImmutableList.of("joda", "java8")) { + rows.add(new Object[] { jerseyLibrary, dateLibrary }); + } + } + return rows.toArray(new Object[0][0]); + } + // almost same test as issue #3139 on Spring - @Test - public void testMultipartJerseyServer() throws Exception { + @Test(dataProvider = "codegenParameterMatrix") + public void testMultipartJerseyServer(final String jerseyLibrary, final String dateLibrary) throws Exception { + codegen.setLibrary(jerseyLibrary); + codegen.setDateLibrary(dateLibrary); + final Map files = generateFiles(codegen, "src/test/resources/3_0/form-multipart-binary-array.yaml"); // Check files for Single, Mixed From d6a97b0c39b9802c30bf532cde8e656054abdf19 Mon Sep 17 00:00:00 2001 From: moznion Date: Thu, 17 Feb 2022 19:34:05 -0800 Subject: [PATCH 084/111] Remove dummy variable declaration for context.Context from generated go code (#11641) Originally, this dummy declaration was needed because there was the possibility of the generated code doesn't use `context.Context` and then if it imported that package, go compiler complains that and makes an error. ref: https://github.com/OpenAPITools/openapi-generator/blob/3ed1aa8e79687bed63dfa064de27317273080471/modules/swagger-codegen/src/main/resources/go/api.mustache#L30 However, now this dummy placement is no longer needed because the generated code always uses `context.Context`. Signed-off-by: moznion --- .../openapi-generator/src/main/resources/go/api.mustache | 4 ---- .../client/petstore/go/go-petstore/api_another_fake.go | 4 ---- samples/client/petstore/go/go-petstore/api_fake.go | 4 ---- .../petstore/go/go-petstore/api_fake_classname_tags123.go | 4 ---- samples/client/petstore/go/go-petstore/api_pet.go | 4 ---- samples/client/petstore/go/go-petstore/api_store.go | 4 ---- samples/client/petstore/go/go-petstore/api_user.go | 4 ---- samples/client/petstore/go/go.mod | 3 ++- samples/client/petstore/go/go.sum | 8 ++++++++ .../x-auth-id-alias/go-experimental/api_usage.go | 4 ---- .../client/petstore/go/go-petstore/api_another_fake.go | 4 ---- .../client/petstore/go/go-petstore/api_default.go | 4 ---- .../openapi3/client/petstore/go/go-petstore/api_fake.go | 4 ---- .../petstore/go/go-petstore/api_fake_classname_tags123.go | 4 ---- .../openapi3/client/petstore/go/go-petstore/api_pet.go | 4 ---- .../openapi3/client/petstore/go/go-petstore/api_store.go | 4 ---- .../openapi3/client/petstore/go/go-petstore/api_user.go | 4 ---- 17 files changed, 10 insertions(+), 61 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index f7a31797b01f..5048f9d60b84 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -12,10 +12,6 @@ import ( {{/imports}} ) -// Linger please -var ( - _ context.Context -) {{#generateInterfaces}} type {{classname}} interface { diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index 8199c4fd3703..a4d199938c1b 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -18,10 +18,6 @@ import ( "net/url" ) -// Linger please -var ( - _ context.Context -) type AnotherFakeApi interface { diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 96a2c5ba9f72..8df181d95af3 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -21,10 +21,6 @@ import ( "reflect" ) -// Linger please -var ( - _ context.Context -) type FakeApi interface { diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 67b8e6a66c7d..ee3e0f692927 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -18,10 +18,6 @@ import ( "net/url" ) -// Linger please -var ( - _ context.Context -) type FakeClassnameTags123Api interface { diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index 1c97ee676fe4..3e1f9df11004 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -20,10 +20,6 @@ import ( "os" ) -// Linger please -var ( - _ context.Context -) type PetApi interface { diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index 61dcc483761a..7b5aabeb8e2f 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -19,10 +19,6 @@ import ( "strings" ) -// Linger please -var ( - _ context.Context -) type StoreApi interface { diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index a8107b6e4611..7150fd9d6928 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -19,10 +19,6 @@ import ( "strings" ) -// Linger please -var ( - _ context.Context -) type UserApi interface { diff --git a/samples/client/petstore/go/go.mod b/samples/client/petstore/go/go.mod index b8b87c5fe95a..82a1337aea2f 100644 --- a/samples/client/petstore/go/go.mod +++ b/samples/client/petstore/go/go.mod @@ -7,5 +7,6 @@ go 1.13 require ( github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/go-petstore v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.7.0 - golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 ) diff --git a/samples/client/petstore/go/go.sum b/samples/client/petstore/go/go.sum index 0df1d1a38a06..601abdd5b8a7 100644 --- a/samples/client/petstore/go/go.sum +++ b/samples/client/petstore/go/go.sum @@ -184,6 +184,8 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -191,6 +193,8 @@ golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 h1:D7nTwh4J0i+5mW4Zjzn5omvlr6YBcWywE6KOcatyNxY= golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -224,11 +228,15 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go index 8ba9a49d9d35..55c52687a943 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go @@ -18,10 +18,6 @@ import ( "net/url" ) -// Linger please -var ( - _ context.Context -) // UsageApiService UsageApi service type UsageApiService service diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index d1ac2900c4c2..84371a9856cf 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -18,10 +18,6 @@ import ( "net/url" ) -// Linger please -var ( - _ context.Context -) type AnotherFakeApi interface { diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index f5cd23745416..ec24ae4f7f47 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -18,10 +18,6 @@ import ( "net/url" ) -// Linger please -var ( - _ context.Context -) type DefaultApi interface { diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 1f4a8802ab0a..6d342310fabd 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -21,10 +21,6 @@ import ( "reflect" ) -// Linger please -var ( - _ context.Context -) type FakeApi interface { diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index fef8f4cb3d42..73e85680e9f2 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -18,10 +18,6 @@ import ( "net/url" ) -// Linger please -var ( - _ context.Context -) type FakeClassnameTags123Api interface { diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index d0b5aff3871b..f6aa8aea7aa3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -20,10 +20,6 @@ import ( "os" ) -// Linger please -var ( - _ context.Context -) type PetApi interface { diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index 3957c73f96ae..e257cb5c2d57 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -19,10 +19,6 @@ import ( "strings" ) -// Linger please -var ( - _ context.Context -) type StoreApi interface { diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index b044e87a4353..4fa005f05660 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -19,10 +19,6 @@ import ( "strings" ) -// Linger please -var ( - _ context.Context -) type UserApi interface { From d45cb6511f77aa0473882ba3b9f5de6c26e97b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul-Etienne=20Fran=C3=A7ois?= Date: Fri, 18 Feb 2022 04:50:15 +0100 Subject: [PATCH 085/111] [Java][Native] Fix an issue leading to an altered String parameter when consuming formatted strings like XML (#11640) * Fix the generated request builder when using a string body parameter * Update the samples according to the fix for #11638 --- .../src/main/resources/Java/libraries/native/api.mustache | 5 +++++ .../src/main/java/org/openapitools/client/api/FakeApi.java | 7 +------ .../src/main/java/org/openapitools/client/api/FakeApi.java | 7 +------ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index 86fb8dd899c1..ede8e5b9566b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -346,12 +346,17 @@ public class {{classname}} { localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{mediaType}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}"); {{#bodyParam}} + {{#isString}} + localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofString({{paramName}})); + {{/isString}} + {{^isString}} try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes({{paramName}}); localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); } catch (IOException e) { throw new ApiException(e); } + {{/isString}} {{/bodyParam}} {{^bodyParam}} localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.noBody()); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java index b600572f5116..8f6c3721de80 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java @@ -519,12 +519,7 @@ private HttpRequest.Builder fakeOuterStringSerializeRequestBuilder(String body) localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "*/*"); - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java index 665df72be2f3..20ce33491933 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java @@ -445,12 +445,7 @@ private HttpRequest.Builder fakeOuterStringSerializeRequestBuilder(String body) localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "*/*"); - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } From 0d4dba13f6c186f68276fb10f702e74af66c56a3 Mon Sep 17 00:00:00 2001 From: Aaron Pittenger <89797921+aaronatbissell@users.noreply.github.com> Date: Fri, 18 Feb 2022 00:11:39 -0500 Subject: [PATCH 086/111] [Python] python regex validation generation (#11525) * fix: python regex validation generation * docs: updated comment to be more specific * fix: check the right value used when generating the regex --- .../languages/PythonLegacyClientCodegen.java | 7 ------- .../codegen/python/PythonClientTest.java | 15 +++++++++++++++ .../python/PythonLegacyClientCodegenTest.java | 4 +++- .../src/test/resources/3_0/issue_11521.yaml | 17 +++++++++++++++++ 4 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/issue_11521.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java index 15aa8d7246f2..70b251e29b02 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java @@ -329,13 +329,6 @@ public void postProcessPattern(String pattern, Map vendorExtensi + "/pattern/modifiers convention. " + pattern + " is not valid."); } - //check for instances of extra backslash that could cause compile issues and remove - int firstBackslash = pattern.indexOf("\\"); - int bracket = pattern.indexOf("["); - if (firstBackslash == 0 || firstBackslash == 1 || firstBackslash == bracket+1) { - pattern = pattern.substring(0,firstBackslash)+pattern.substring(firstBackslash+1); - } - String regex = pattern.substring(1, i).replace("'", "\\'"); List modifiers = new ArrayList(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java index aa143e5b7f33..2bbfdaca1dcc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java @@ -440,6 +440,21 @@ public void testObjectWithValidations() { Assert.assertEquals((int) model.getMinProperties(), 1); } + @Test(description = "tests RegexObjects") + public void testRegexObjects() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_11521.yaml"); + final DefaultCodegen codegen = new PythonClientCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "DateTimeObject"; + Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); + final CodegenModel model = codegen.fromModel(modelName, modelSchema); + final CodegenProperty property1 = model.vars.get(0); + Assert.assertEquals(property1.baseName, "datetime"); + Assert.assertEquals(property1.pattern, "/[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z/"); + Assert.assertEquals(property1.vendorExtensions.get("x-regex"), "[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z"); + } + @Test(description = "tests RecursiveToExample") public void testRecursiveToExample() throws IOException { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8052_recursive_model.yaml"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java index 72dbdda27abe..fa506e4c08b5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java @@ -93,7 +93,9 @@ public void testRegularExpressionOpenAPISchemaVersion3() { Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i"); // pattern_with_backslash_after_bracket '/^[\pattern\d{3}$/i' // added to test fix for issue #6675 - Assert.assertEquals(op.allParams.get(6).pattern, "/^[\\pattern\\d{3}$/i"); + // removed because "/^[\\pattern\\d{3}$/i" is invalid regex because [ is not escaped and there is no closing ] + // Assert.assertEquals(op.allParams.get(6).pattern, "/^[\\pattern\\d{3}$/i"); + } diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_11521.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_11521.yaml new file mode 100644 index 000000000000..61c9e83f1727 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_11521.yaml @@ -0,0 +1,17 @@ +openapi: 3.0.0 +info: + description: a spec to test free form object models + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: "https://www.apache.org/licenses/LICENSE-2.0.html" +tags: [] +paths: {} +components: + schemas: + DateTimeObject: + properties: + datetime: + type: string + pattern: '[\d]{4}-[\d]{2}-[\d]{2}T[\d]{1,2}:[\d]{2}Z' From d030ac1b50de37f5e8ee88d0fe538cc5769a44b1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 19 Feb 2022 11:41:19 +0800 Subject: [PATCH 087/111] better code format in go generators (#11656) --- .../codegen/languages/AbstractGoCodegen.java | 4 +++- .../codegen/languages/GoClientCodegen.java | 6 +++--- .../codegen/languages/GoGinServerCodegen.java | 6 +++--- .../codegen/languages/GoServerCodegen.java | 10 +++++----- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 6c206de669da..a071f2f4a805 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -850,5 +850,7 @@ protected boolean isNumberType(String datatype) { } @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.GO; } + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.GO; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 3902e0b07ccb..60872186a1ae 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -107,8 +107,8 @@ public GoClientCodegen() { // option to change the order of form/body parameter cliOptions.add(CliOption.newBoolean( - CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, - CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC) + CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, + CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC) .defaultValue(Boolean.FALSE.toString())); cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false")); @@ -585,7 +585,7 @@ private String constructExampleCode(CodegenProperty codegenProperty, HashMap routers = new HashMap<>(); - for (String router: ROUTERS) { + for (String router : ROUTERS) { routers.put(router, router.equals(propRouter)); } additionalProperties.put("routers", routers); @@ -244,7 +244,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("go.mod.mustache", "", "go.mod")); supportingFiles.add(new SupportingFile("routers.mustache", sourceFolder, "routers.go")); supportingFiles.add(new SupportingFile("logger.mustache", sourceFolder, "logger.go")); - supportingFiles.add(new SupportingFile("impl.mustache",sourceFolder, "impl.go")); + supportingFiles.add(new SupportingFile("impl.mustache", sourceFolder, "impl.go")); supportingFiles.add(new SupportingFile("helpers.mustache", sourceFolder, "helpers.go")); supportingFiles.add(new SupportingFile("api.mustache", sourceFolder, "api.go")); supportingFiles.add(new SupportingFile("error.mustache", sourceFolder, "error.go")); From d530e1baec4dd8971ae63f162a28c55ad413d267 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 19 Feb 2022 13:11:28 +0800 Subject: [PATCH 088/111] minor enhancement to code format in go client (#11657) --- .../src/main/resources/go/api.mustache | 14 ++- .../main/resources/go/model_simple.mustache | 6 +- .../go/go-petstore/api_another_fake.go | 4 +- .../petstore/go/go-petstore/api_fake.go | 87 +++++++++++------ .../go-petstore/api_fake_classname_tags123.go | 4 +- .../client/petstore/go/go-petstore/api_pet.go | 50 +++++----- .../petstore/go/go-petstore/api_store.go | 23 ++--- .../petstore/go/go-petstore/api_user.go | 42 ++++----- .../petstore/go/go-petstore/model_animal.go | 2 +- .../petstore/go/go-petstore/model_category.go | 2 +- .../go/go-petstore/model_enum_test_.go | 2 +- .../go/go-petstore/model_format_test_.go | 8 +- .../petstore/go/go-petstore/model_name.go | 2 +- .../petstore/go/go-petstore/model_pet.go | 4 +- .../go-petstore/model_type_holder_default.go | 10 +- .../go-petstore/model_type_holder_example.go | 12 +-- .../go-experimental/api_usage.go | 4 - .../go/go-petstore/api_another_fake.go | 4 +- .../petstore/go/go-petstore/api_default.go | 5 +- .../petstore/go/go-petstore/api_fake.go | 93 ++++++++++++------- .../go-petstore/api_fake_classname_tags123.go | 4 +- .../client/petstore/go/go-petstore/api_pet.go | 50 +++++----- .../petstore/go/go-petstore/api_store.go | 23 ++--- .../petstore/go/go-petstore/api_user.go | 42 ++++----- .../petstore/go/go-petstore/model_animal.go | 2 +- .../go/go-petstore/model_apple_req.go | 2 +- .../go/go-petstore/model_banana_req.go | 2 +- .../petstore/go/go-petstore/model_category.go | 2 +- .../go/go-petstore/model_enum_test_.go | 4 +- .../go/go-petstore/model_format_test_.go | 8 +- .../go-petstore/model_health_check_result.go | 2 +- .../petstore/go/go-petstore/model_name.go | 2 +- .../go/go-petstore/model_nullable_class.go | 20 ++-- .../petstore/go/go-petstore/model_pet.go | 4 +- .../petstore/go/go-petstore/model_user.go | 6 +- .../petstore/go/go-petstore/model_whale.go | 2 +- .../petstore/go/go-petstore/model_zebra.go | 2 +- 37 files changed, 305 insertions(+), 250 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 5048f9d60b84..4180e92abf87 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -24,9 +24,9 @@ type {{classname}} interface { {{{unescapedNotes}}} {{/notes}} - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} - @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} - @return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} + @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} + @return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request {{#isDeprecated}} Deprecated @@ -58,7 +58,9 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request s {{paramName}} {{^isPathParam}}*{{/isPathParam}}{{{dataType}}} {{/allParams}} } -{{#allParams}}{{^isPathParam}} + +{{#allParams}} +{{^isPathParam}} {{#description}} // {{.}} {{/description}} @@ -68,8 +70,10 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request s func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) {{vendorExtensions.x-export-param-name}}({{paramName}} {{{dataType}}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request { r.{{paramName}} = &{{paramName}} return r -}{{/isPathParam}}{{/allParams}} +} +{{/isPathParam}} +{{/allParams}} func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) Execute() ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.Response, error) { return r.ApiService.{{nickname}}Execute(r) } diff --git a/modules/openapi-generator/src/main/resources/go/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache index 187abbffe9ff..7a9b2565444e 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -122,7 +122,7 @@ func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} { // Deprecated {{/deprecated}} func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) { - if o == nil {{#isNullable}}{{#vendorExtensions.x-golang-is-container}}|| o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { + if o == nil{{#isNullable}}{{#vendorExtensions.x-golang-is-container}} || o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { return nil, false } {{#isNullable}} @@ -163,7 +163,7 @@ func (o *{{classname}}) Set{{name}}(v {{vendorExtensions.x-go-base-type}}) { // Deprecated {{/deprecated}} func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} { - if o == nil {{^isNullable}}|| o.{{name}} == nil{{/isNullable}}{{#isNullable}}{{^vendorExtensions.x-golang-is-container}}|| o.{{name}}.Get() == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { + if o == nil{{^isNullable}} || o.{{name}} == nil{{/isNullable}}{{#isNullable}}{{^vendorExtensions.x-golang-is-container}} || o.{{name}}.Get() == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { var ret {{vendorExtensions.x-go-base-type}} return ret } @@ -189,7 +189,7 @@ func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} { // Deprecated {{/deprecated}} func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) { - if o == nil {{^isNullable}}|| o.{{name}} == nil{{/isNullable}}{{#isNullable}}{{#vendorExtensions.x-golang-is-container}}|| o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { + if o == nil{{^isNullable}} || o.{{name}} == nil{{/isNullable}}{{#isNullable}}{{#vendorExtensions.x-golang-is-container}} || o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { return nil, false } {{#isNullable}} diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index a4d199938c1b..82362831c6f1 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -26,8 +26,8 @@ type AnotherFakeApi interface { To test special tags and operation ID starting with number - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCall123TestSpecialTagsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCall123TestSpecialTagsRequest */ Call123TestSpecialTags(ctx context.Context) ApiCall123TestSpecialTagsRequest diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 8df181d95af3..5d576ab4d4e2 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -29,8 +29,8 @@ type FakeApi interface { this route creates an XmlItem - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateXmlItemRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateXmlItemRequest */ CreateXmlItem(ctx context.Context) ApiCreateXmlItemRequest @@ -42,8 +42,8 @@ type FakeApi interface { Test serialization of outer boolean types - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFakeOuterBooleanSerializeRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFakeOuterBooleanSerializeRequest */ FakeOuterBooleanSerialize(ctx context.Context) ApiFakeOuterBooleanSerializeRequest @@ -56,8 +56,8 @@ type FakeApi interface { Test serialization of object with outer number type - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFakeOuterCompositeSerializeRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFakeOuterCompositeSerializeRequest */ FakeOuterCompositeSerialize(ctx context.Context) ApiFakeOuterCompositeSerializeRequest @@ -70,8 +70,8 @@ type FakeApi interface { Test serialization of outer number types - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFakeOuterNumberSerializeRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFakeOuterNumberSerializeRequest */ FakeOuterNumberSerialize(ctx context.Context) ApiFakeOuterNumberSerializeRequest @@ -84,8 +84,8 @@ type FakeApi interface { Test serialization of outer string types - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFakeOuterStringSerializeRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFakeOuterStringSerializeRequest */ FakeOuterStringSerialize(ctx context.Context) ApiFakeOuterStringSerializeRequest @@ -98,8 +98,8 @@ type FakeApi interface { For this test, the body for this request much reference a schema named `File`. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestBodyWithFileSchemaRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestBodyWithFileSchemaRequest */ TestBodyWithFileSchema(ctx context.Context) ApiTestBodyWithFileSchemaRequest @@ -109,8 +109,8 @@ type FakeApi interface { /* TestBodyWithQueryParams Method for TestBodyWithQueryParams - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestBodyWithQueryParamsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestBodyWithQueryParamsRequest */ TestBodyWithQueryParams(ctx context.Context) ApiTestBodyWithQueryParamsRequest @@ -122,8 +122,8 @@ type FakeApi interface { To test "client" model - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestClientModelRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestClientModelRequest */ TestClientModel(ctx context.Context) ApiTestClientModelRequest @@ -139,8 +139,8 @@ type FakeApi interface { 偽のエンドポイント 가짜 엔드 포인트 - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestEndpointParametersRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestEndpointParametersRequest */ TestEndpointParameters(ctx context.Context) ApiTestEndpointParametersRequest @@ -152,8 +152,8 @@ type FakeApi interface { To test enum parameters - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestEnumParametersRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestEnumParametersRequest */ TestEnumParameters(ctx context.Context) ApiTestEnumParametersRequest @@ -165,8 +165,8 @@ type FakeApi interface { Fake endpoint to test group parameters (optional) - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestGroupParametersRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestGroupParametersRequest */ TestGroupParameters(ctx context.Context) ApiTestGroupParametersRequest @@ -176,8 +176,8 @@ type FakeApi interface { /* TestInlineAdditionalProperties test inline additionalProperties - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestInlineAdditionalPropertiesRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestInlineAdditionalPropertiesRequest */ TestInlineAdditionalProperties(ctx context.Context) ApiTestInlineAdditionalPropertiesRequest @@ -187,8 +187,8 @@ type FakeApi interface { /* TestJsonFormData test json serialization of form data - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestJsonFormDataRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestJsonFormDataRequest */ TestJsonFormData(ctx context.Context) ApiTestJsonFormDataRequest @@ -200,8 +200,8 @@ type FakeApi interface { To test the collection format in query parameters - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestQueryParameterCollectionFormatRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestQueryParameterCollectionFormatRequest */ TestQueryParameterCollectionFormat(ctx context.Context) ApiTestQueryParameterCollectionFormatRequest @@ -854,6 +854,7 @@ func (r ApiTestBodyWithQueryParamsRequest) Query(query string) ApiTestBodyWithQu r.query = &query return r } + func (r ApiTestBodyWithQueryParamsRequest) Body(body User) ApiTestBodyWithQueryParamsRequest { r.body = &body return r @@ -1084,66 +1085,79 @@ func (r ApiTestEndpointParametersRequest) Number(number float32) ApiTestEndpoint r.number = &number return r } + // None func (r ApiTestEndpointParametersRequest) Double(double float64) ApiTestEndpointParametersRequest { r.double = &double return r } + // None func (r ApiTestEndpointParametersRequest) PatternWithoutDelimiter(patternWithoutDelimiter string) ApiTestEndpointParametersRequest { r.patternWithoutDelimiter = &patternWithoutDelimiter return r } + // None func (r ApiTestEndpointParametersRequest) Byte_(byte_ string) ApiTestEndpointParametersRequest { r.byte_ = &byte_ return r } + // None func (r ApiTestEndpointParametersRequest) Integer(integer int32) ApiTestEndpointParametersRequest { r.integer = &integer return r } + // None func (r ApiTestEndpointParametersRequest) Int32_(int32_ int32) ApiTestEndpointParametersRequest { r.int32_ = &int32_ return r } + // None func (r ApiTestEndpointParametersRequest) Int64_(int64_ int64) ApiTestEndpointParametersRequest { r.int64_ = &int64_ return r } + // None func (r ApiTestEndpointParametersRequest) Float(float float32) ApiTestEndpointParametersRequest { r.float = &float return r } + // None func (r ApiTestEndpointParametersRequest) String_(string_ string) ApiTestEndpointParametersRequest { r.string_ = &string_ return r } + // None func (r ApiTestEndpointParametersRequest) Binary(binary *os.File) ApiTestEndpointParametersRequest { r.binary = &binary return r } + // None func (r ApiTestEndpointParametersRequest) Date(date string) ApiTestEndpointParametersRequest { r.date = &date return r } + // None func (r ApiTestEndpointParametersRequest) DateTime(dateTime time.Time) ApiTestEndpointParametersRequest { r.dateTime = &dateTime return r } + // None func (r ApiTestEndpointParametersRequest) Password(password string) ApiTestEndpointParametersRequest { r.password = &password return r } + // None func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpointParametersRequest { r.callback = &callback @@ -1326,36 +1340,43 @@ func (r ApiTestEnumParametersRequest) EnumHeaderStringArray(enumHeaderStringArra r.enumHeaderStringArray = &enumHeaderStringArray return r } + // Header parameter enum test (string) func (r ApiTestEnumParametersRequest) EnumHeaderString(enumHeaderString string) ApiTestEnumParametersRequest { r.enumHeaderString = &enumHeaderString return r } + // Query parameter enum test (string array) func (r ApiTestEnumParametersRequest) EnumQueryStringArray(enumQueryStringArray []string) ApiTestEnumParametersRequest { r.enumQueryStringArray = &enumQueryStringArray return r } + // Query parameter enum test (string) func (r ApiTestEnumParametersRequest) EnumQueryString(enumQueryString string) ApiTestEnumParametersRequest { r.enumQueryString = &enumQueryString return r } + // Query parameter enum test (double) func (r ApiTestEnumParametersRequest) EnumQueryInteger(enumQueryInteger int32) ApiTestEnumParametersRequest { r.enumQueryInteger = &enumQueryInteger return r } + // Query parameter enum test (double) func (r ApiTestEnumParametersRequest) EnumQueryDouble(enumQueryDouble float64) ApiTestEnumParametersRequest { r.enumQueryDouble = &enumQueryDouble return r } + // Form parameter enum test (string array) func (r ApiTestEnumParametersRequest) EnumFormStringArray(enumFormStringArray []string) ApiTestEnumParametersRequest { r.enumFormStringArray = &enumFormStringArray return r } + // Form parameter enum test (string) func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiTestEnumParametersRequest { r.enumFormString = &enumFormString @@ -1485,26 +1506,31 @@ func (r ApiTestGroupParametersRequest) RequiredStringGroup(requiredStringGroup i r.requiredStringGroup = &requiredStringGroup return r } + // Required Boolean in group parameters func (r ApiTestGroupParametersRequest) RequiredBooleanGroup(requiredBooleanGroup bool) ApiTestGroupParametersRequest { r.requiredBooleanGroup = &requiredBooleanGroup return r } + // Required Integer in group parameters func (r ApiTestGroupParametersRequest) RequiredInt64Group(requiredInt64Group int64) ApiTestGroupParametersRequest { r.requiredInt64Group = &requiredInt64Group return r } + // String in group parameters func (r ApiTestGroupParametersRequest) StringGroup(stringGroup int32) ApiTestGroupParametersRequest { r.stringGroup = &stringGroup return r } + // Boolean in group parameters func (r ApiTestGroupParametersRequest) BooleanGroup(booleanGroup bool) ApiTestGroupParametersRequest { r.booleanGroup = &booleanGroup return r } + // Integer in group parameters func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroupParametersRequest { r.int64Group = &int64Group @@ -1725,6 +1751,7 @@ func (r ApiTestJsonFormDataRequest) Param(param string) ApiTestJsonFormDataReque r.param = ¶m return r } + // field2 func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataRequest { r.param2 = ¶m2 @@ -1834,18 +1861,22 @@ func (r ApiTestQueryParameterCollectionFormatRequest) Pipe(pipe []string) ApiTes r.pipe = &pipe return r } + func (r ApiTestQueryParameterCollectionFormatRequest) Ioutil(ioutil []string) ApiTestQueryParameterCollectionFormatRequest { r.ioutil = &ioutil return r } + func (r ApiTestQueryParameterCollectionFormatRequest) Http(http []string) ApiTestQueryParameterCollectionFormatRequest { r.http = &http return r } + func (r ApiTestQueryParameterCollectionFormatRequest) Url(url []string) ApiTestQueryParameterCollectionFormatRequest { r.url = &url return r } + func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) ApiTestQueryParameterCollectionFormatRequest { r.context = &context return r diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index ee3e0f692927..3fe38e5256c6 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -26,8 +26,8 @@ type FakeClassnameTags123Api interface { To test class name in snake case - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestClassnameRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestClassnameRequest */ TestClassname(ctx context.Context) ApiTestClassnameRequest diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index 3e1f9df11004..014e56171f29 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -26,8 +26,8 @@ type PetApi interface { /* AddPet Add a new pet to the store - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAddPetRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddPetRequest */ AddPet(ctx context.Context) ApiAddPetRequest @@ -37,9 +37,9 @@ type PetApi interface { /* DeletePet Deletes a pet - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId Pet id to delete - @return ApiDeletePetRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId Pet id to delete + @return ApiDeletePetRequest */ DeletePet(ctx context.Context, petId int64) ApiDeletePetRequest @@ -51,8 +51,8 @@ type PetApi interface { Multiple status values can be provided with comma separated strings - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFindPetsByStatusRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindPetsByStatusRequest */ FindPetsByStatus(ctx context.Context) ApiFindPetsByStatusRequest @@ -65,8 +65,8 @@ type PetApi interface { Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFindPetsByTagsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindPetsByTagsRequest Deprecated */ @@ -82,9 +82,9 @@ type PetApi interface { Returns a single pet - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId ID of pet to return - @return ApiGetPetByIdRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId ID of pet to return + @return ApiGetPetByIdRequest */ GetPetById(ctx context.Context, petId int64) ApiGetPetByIdRequest @@ -95,8 +95,8 @@ type PetApi interface { /* UpdatePet Update an existing pet - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiUpdatePetRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUpdatePetRequest */ UpdatePet(ctx context.Context) ApiUpdatePetRequest @@ -106,9 +106,9 @@ type PetApi interface { /* UpdatePetWithForm Updates a pet in the store with form data - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId ID of pet that needs to be updated - @return ApiUpdatePetWithFormRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId ID of pet that needs to be updated + @return ApiUpdatePetWithFormRequest */ UpdatePetWithForm(ctx context.Context, petId int64) ApiUpdatePetWithFormRequest @@ -118,9 +118,9 @@ type PetApi interface { /* UploadFile uploads an image - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId ID of pet to update - @return ApiUploadFileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId ID of pet to update + @return ApiUploadFileRequest */ UploadFile(ctx context.Context, petId int64) ApiUploadFileRequest @@ -131,9 +131,9 @@ type PetApi interface { /* UploadFileWithRequiredFile uploads an image (required) - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId ID of pet to update - @return ApiUploadFileWithRequiredFileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId ID of pet to update + @return ApiUploadFileWithRequiredFileRequest */ UploadFileWithRequiredFile(ctx context.Context, petId int64) ApiUploadFileWithRequiredFileRequest @@ -571,7 +571,6 @@ type ApiGetPetByIdRequest struct { petId int64 } - func (r ApiGetPetByIdRequest) Execute() (*Pet, *http.Response, error) { return r.ApiService.GetPetByIdExecute(r) } @@ -794,6 +793,7 @@ func (r ApiUpdatePetWithFormRequest) Name(name string) ApiUpdatePetWithFormReque r.name = &name return r } + // Updated status of the pet func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormRequest { r.status = &status @@ -903,6 +903,7 @@ func (r ApiUploadFileRequest) AdditionalMetadata(additionalMetadata string) ApiU r.additionalMetadata = &additionalMetadata return r } + // file to upload func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { r.file = &file @@ -1037,6 +1038,7 @@ func (r ApiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File r.requiredFile = &requiredFile return r } + // Additional data to pass to server func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileWithRequiredFileRequest { r.additionalMetadata = &additionalMetadata diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index 7b5aabeb8e2f..3ad1421086f8 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -27,9 +27,9 @@ type StoreApi interface { For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param orderId ID of the order that needs to be deleted - @return ApiDeleteOrderRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orderId ID of the order that needs to be deleted + @return ApiDeleteOrderRequest */ DeleteOrder(ctx context.Context, orderId string) ApiDeleteOrderRequest @@ -41,8 +41,8 @@ type StoreApi interface { Returns a map of status codes to quantities - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetInventoryRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetInventoryRequest */ GetInventory(ctx context.Context) ApiGetInventoryRequest @@ -55,9 +55,9 @@ type StoreApi interface { For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param orderId ID of pet that needs to be fetched - @return ApiGetOrderByIdRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orderId ID of pet that needs to be fetched + @return ApiGetOrderByIdRequest */ GetOrderById(ctx context.Context, orderId int64) ApiGetOrderByIdRequest @@ -68,8 +68,8 @@ type StoreApi interface { /* PlaceOrder Place an order for a pet - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiPlaceOrderRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPlaceOrderRequest */ PlaceOrder(ctx context.Context) ApiPlaceOrderRequest @@ -87,7 +87,6 @@ type ApiDeleteOrderRequest struct { orderId string } - func (r ApiDeleteOrderRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteOrderExecute(r) } @@ -179,7 +178,6 @@ type ApiGetInventoryRequest struct { ApiService StoreApi } - func (r ApiGetInventoryRequest) Execute() (map[string]int32, *http.Response, error) { return r.ApiService.GetInventoryExecute(r) } @@ -294,7 +292,6 @@ type ApiGetOrderByIdRequest struct { orderId int64 } - func (r ApiGetOrderByIdRequest) Execute() (*Order, *http.Response, error) { return r.ApiService.GetOrderByIdExecute(r) } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index 7150fd9d6928..5709e41a182a 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -27,8 +27,8 @@ type UserApi interface { This can only be done by the logged in user. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateUserRequest */ CreateUser(ctx context.Context) ApiCreateUserRequest @@ -38,8 +38,8 @@ type UserApi interface { /* CreateUsersWithArrayInput Creates list of users with given input array - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateUsersWithArrayInputRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateUsersWithArrayInputRequest */ CreateUsersWithArrayInput(ctx context.Context) ApiCreateUsersWithArrayInputRequest @@ -49,8 +49,8 @@ type UserApi interface { /* CreateUsersWithListInput Creates list of users with given input array - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateUsersWithListInputRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateUsersWithListInputRequest */ CreateUsersWithListInput(ctx context.Context) ApiCreateUsersWithListInputRequest @@ -62,9 +62,9 @@ type UserApi interface { This can only be done by the logged in user. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param username The name that needs to be deleted - @return ApiDeleteUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The name that needs to be deleted + @return ApiDeleteUserRequest */ DeleteUser(ctx context.Context, username string) ApiDeleteUserRequest @@ -74,9 +74,9 @@ type UserApi interface { /* GetUserByName Get user by user name - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param username The name that needs to be fetched. Use user1 for testing. - @return ApiGetUserByNameRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The name that needs to be fetched. Use user1 for testing. + @return ApiGetUserByNameRequest */ GetUserByName(ctx context.Context, username string) ApiGetUserByNameRequest @@ -87,8 +87,8 @@ type UserApi interface { /* LoginUser Logs user into the system - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiLoginUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLoginUserRequest */ LoginUser(ctx context.Context) ApiLoginUserRequest @@ -99,8 +99,8 @@ type UserApi interface { /* LogoutUser Logs out current logged in user session - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiLogoutUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLogoutUserRequest */ LogoutUser(ctx context.Context) ApiLogoutUserRequest @@ -112,9 +112,9 @@ type UserApi interface { This can only be done by the logged in user. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param username name that need to be deleted - @return ApiUpdateUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username name that need to be deleted + @return ApiUpdateUserRequest */ UpdateUser(ctx context.Context, username string) ApiUpdateUserRequest @@ -427,7 +427,6 @@ type ApiDeleteUserRequest struct { username string } - func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteUserExecute(r) } @@ -520,7 +519,6 @@ type ApiGetUserByNameRequest struct { username string } - func (r ApiGetUserByNameRequest) Execute() (*User, *http.Response, error) { return r.ApiService.GetUserByNameExecute(r) } @@ -628,6 +626,7 @@ func (r ApiLoginUserRequest) Username(username string) ApiLoginUserRequest { r.username = &username return r } + // The password for login in clear text func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { r.password = &password @@ -739,7 +738,6 @@ type ApiLogoutUserRequest struct { ApiService UserApi } - func (r ApiLogoutUserRequest) Execute() (*http.Response, error) { return r.ApiService.LogoutUserExecute(r) } diff --git a/samples/client/petstore/go/go-petstore/model_animal.go b/samples/client/petstore/go/go-petstore/model_animal.go index 0c942ae9b860..7b7534c3a549 100644 --- a/samples/client/petstore/go/go-petstore/model_animal.go +++ b/samples/client/petstore/go/go-petstore/model_animal.go @@ -55,7 +55,7 @@ func (o *Animal) GetClassName() string { // GetClassNameOk returns a tuple with the ClassName field value // and a boolean to check if the value has been set. func (o *Animal) GetClassNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.ClassName, true diff --git a/samples/client/petstore/go/go-petstore/model_category.go b/samples/client/petstore/go/go-petstore/model_category.go index 53d14123e61a..601de584fdeb 100644 --- a/samples/client/petstore/go/go-petstore/model_category.go +++ b/samples/client/petstore/go/go-petstore/model_category.go @@ -85,7 +85,7 @@ func (o *Category) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *Category) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true diff --git a/samples/client/petstore/go/go-petstore/model_enum_test_.go b/samples/client/petstore/go/go-petstore/model_enum_test_.go index c6d96da3d722..37a02ad010c2 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/client/petstore/go/go-petstore/model_enum_test_.go @@ -86,7 +86,7 @@ func (o *EnumTest) GetEnumStringRequired() string { // GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field value // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EnumStringRequired, true diff --git a/samples/client/petstore/go/go-petstore/model_format_test_.go b/samples/client/petstore/go/go-petstore/model_format_test_.go index 67f9fff47af6..248d8c124f24 100644 --- a/samples/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore/model_format_test_.go @@ -164,7 +164,7 @@ func (o *FormatTest) GetNumber() float32 { // GetNumberOk returns a tuple with the Number field value // and a boolean to check if the value has been set. func (o *FormatTest) GetNumberOk() (*float32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Number, true @@ -284,7 +284,7 @@ func (o *FormatTest) GetByte() string { // GetByteOk returns a tuple with the Byte field value // and a boolean to check if the value has been set. func (o *FormatTest) GetByteOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Byte, true @@ -340,7 +340,7 @@ func (o *FormatTest) GetDate() string { // GetDateOk returns a tuple with the Date field value // and a boolean to check if the value has been set. func (o *FormatTest) GetDateOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Date, true @@ -428,7 +428,7 @@ func (o *FormatTest) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value // and a boolean to check if the value has been set. func (o *FormatTest) GetPasswordOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Password, true diff --git a/samples/client/petstore/go/go-petstore/model_name.go b/samples/client/petstore/go/go-petstore/model_name.go index d423411e2397..46b6b26c0f22 100644 --- a/samples/client/petstore/go/go-petstore/model_name.go +++ b/samples/client/petstore/go/go-petstore/model_name.go @@ -53,7 +53,7 @@ func (o *Name) GetName() int32 { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *Name) GetNameOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true diff --git a/samples/client/petstore/go/go-petstore/model_pet.go b/samples/client/petstore/go/go-petstore/model_pet.go index 538b9aa4d1ff..8d7710e7622a 100644 --- a/samples/client/petstore/go/go-petstore/model_pet.go +++ b/samples/client/petstore/go/go-petstore/model_pet.go @@ -121,7 +121,7 @@ func (o *Pet) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *Pet) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -145,7 +145,7 @@ func (o *Pet) GetPhotoUrls() []string { // GetPhotoUrlsOk returns a tuple with the PhotoUrls field value // and a boolean to check if the value has been set. func (o *Pet) GetPhotoUrlsOk() ([]string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PhotoUrls, true diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_default.go b/samples/client/petstore/go/go-petstore/model_type_holder_default.go index 34bef67ff014..ab921b3f1e5f 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_default.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_default.go @@ -62,7 +62,7 @@ func (o *TypeHolderDefault) GetStringItem() string { // GetStringItemOk returns a tuple with the StringItem field value // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetStringItemOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.StringItem, true @@ -86,7 +86,7 @@ func (o *TypeHolderDefault) GetNumberItem() float32 { // GetNumberItemOk returns a tuple with the NumberItem field value // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetNumberItemOk() (*float32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.NumberItem, true @@ -110,7 +110,7 @@ func (o *TypeHolderDefault) GetIntegerItem() int32 { // GetIntegerItemOk returns a tuple with the IntegerItem field value // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetIntegerItemOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.IntegerItem, true @@ -134,7 +134,7 @@ func (o *TypeHolderDefault) GetBoolItem() bool { // GetBoolItemOk returns a tuple with the BoolItem field value // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetBoolItemOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.BoolItem, true @@ -158,7 +158,7 @@ func (o *TypeHolderDefault) GetArrayItem() []int32 { // GetArrayItemOk returns a tuple with the ArrayItem field value // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetArrayItemOk() ([]int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.ArrayItem, true diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_example.go b/samples/client/petstore/go/go-petstore/model_type_holder_example.go index fd363cdb2932..9d0979ff1488 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_example.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_example.go @@ -60,7 +60,7 @@ func (o *TypeHolderExample) GetStringItem() string { // GetStringItemOk returns a tuple with the StringItem field value // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetStringItemOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.StringItem, true @@ -84,7 +84,7 @@ func (o *TypeHolderExample) GetNumberItem() float32 { // GetNumberItemOk returns a tuple with the NumberItem field value // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetNumberItemOk() (*float32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.NumberItem, true @@ -108,7 +108,7 @@ func (o *TypeHolderExample) GetFloatItem() float32 { // GetFloatItemOk returns a tuple with the FloatItem field value // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetFloatItemOk() (*float32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.FloatItem, true @@ -132,7 +132,7 @@ func (o *TypeHolderExample) GetIntegerItem() int32 { // GetIntegerItemOk returns a tuple with the IntegerItem field value // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetIntegerItemOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.IntegerItem, true @@ -156,7 +156,7 @@ func (o *TypeHolderExample) GetBoolItem() bool { // GetBoolItemOk returns a tuple with the BoolItem field value // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetBoolItemOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.BoolItem, true @@ -180,7 +180,7 @@ func (o *TypeHolderExample) GetArrayItem() []int32 { // GetArrayItemOk returns a tuple with the ArrayItem field value // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetArrayItemOk() ([]int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.ArrayItem, true diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go index 55c52687a943..d7f2368d4aee 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go @@ -27,7 +27,6 @@ type ApiAnyKeyRequest struct { ApiService *UsageApiService } - func (r ApiAnyKeyRequest) Execute() (map[string]interface{}, *http.Response, error) { return r.ApiService.AnyKeyExecute(r) } @@ -155,7 +154,6 @@ type ApiBothKeysRequest struct { ApiService *UsageApiService } - func (r ApiBothKeysRequest) Execute() (map[string]interface{}, *http.Response, error) { return r.ApiService.BothKeysExecute(r) } @@ -283,7 +281,6 @@ type ApiKeyInHeaderRequest struct { ApiService *UsageApiService } - func (r ApiKeyInHeaderRequest) Execute() (map[string]interface{}, *http.Response, error) { return r.ApiService.KeyInHeaderExecute(r) } @@ -397,7 +394,6 @@ type ApiKeyInQueryRequest struct { ApiService *UsageApiService } - func (r ApiKeyInQueryRequest) Execute() (map[string]interface{}, *http.Response, error) { return r.ApiService.KeyInQueryExecute(r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index 84371a9856cf..e2c32c1d56e0 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -26,8 +26,8 @@ type AnotherFakeApi interface { To test special tags and operation ID starting with number - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCall123TestSpecialTagsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCall123TestSpecialTagsRequest */ Call123TestSpecialTags(ctx context.Context) ApiCall123TestSpecialTagsRequest diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index ec24ae4f7f47..4a0fb1a5d5fe 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -24,8 +24,8 @@ type DefaultApi interface { /* FooGet Method for FooGet - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFooGetRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFooGetRequest */ FooGet(ctx context.Context) ApiFooGetRequest @@ -42,7 +42,6 @@ type ApiFooGetRequest struct { ApiService DefaultApi } - func (r ApiFooGetRequest) Execute() (*InlineResponseDefault, *http.Response, error) { return r.ApiService.FooGetExecute(r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 6d342310fabd..3e92f36f24eb 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -27,8 +27,8 @@ type FakeApi interface { /* FakeHealthGet Health check endpoint - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFakeHealthGetRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFakeHealthGetRequest */ FakeHealthGet(ctx context.Context) ApiFakeHealthGetRequest @@ -41,8 +41,8 @@ type FakeApi interface { Test serialization of outer boolean types - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFakeOuterBooleanSerializeRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFakeOuterBooleanSerializeRequest */ FakeOuterBooleanSerialize(ctx context.Context) ApiFakeOuterBooleanSerializeRequest @@ -55,8 +55,8 @@ type FakeApi interface { Test serialization of object with outer number type - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFakeOuterCompositeSerializeRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFakeOuterCompositeSerializeRequest */ FakeOuterCompositeSerialize(ctx context.Context) ApiFakeOuterCompositeSerializeRequest @@ -69,8 +69,8 @@ type FakeApi interface { Test serialization of outer number types - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFakeOuterNumberSerializeRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFakeOuterNumberSerializeRequest */ FakeOuterNumberSerialize(ctx context.Context) ApiFakeOuterNumberSerializeRequest @@ -83,8 +83,8 @@ type FakeApi interface { Test serialization of outer string types - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFakeOuterStringSerializeRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFakeOuterStringSerializeRequest */ FakeOuterStringSerialize(ctx context.Context) ApiFakeOuterStringSerializeRequest @@ -97,8 +97,8 @@ type FakeApi interface { For this test, the body for this request much reference a schema named `File`. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestBodyWithFileSchemaRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestBodyWithFileSchemaRequest */ TestBodyWithFileSchema(ctx context.Context) ApiTestBodyWithFileSchemaRequest @@ -108,8 +108,8 @@ type FakeApi interface { /* TestBodyWithQueryParams Method for TestBodyWithQueryParams - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestBodyWithQueryParamsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestBodyWithQueryParamsRequest */ TestBodyWithQueryParams(ctx context.Context) ApiTestBodyWithQueryParamsRequest @@ -121,8 +121,8 @@ type FakeApi interface { To test "client" model - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestClientModelRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestClientModelRequest */ TestClientModel(ctx context.Context) ApiTestClientModelRequest @@ -139,8 +139,8 @@ type FakeApi interface { 가짜 엔드 포인트 - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestEndpointParametersRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestEndpointParametersRequest */ TestEndpointParameters(ctx context.Context) ApiTestEndpointParametersRequest @@ -152,8 +152,8 @@ type FakeApi interface { To test enum parameters - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestEnumParametersRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestEnumParametersRequest */ TestEnumParameters(ctx context.Context) ApiTestEnumParametersRequest @@ -165,8 +165,8 @@ type FakeApi interface { Fake endpoint to test group parameters (optional) - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestGroupParametersRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestGroupParametersRequest */ TestGroupParameters(ctx context.Context) ApiTestGroupParametersRequest @@ -176,8 +176,8 @@ type FakeApi interface { /* TestInlineAdditionalProperties test inline additionalProperties - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestInlineAdditionalPropertiesRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestInlineAdditionalPropertiesRequest */ TestInlineAdditionalProperties(ctx context.Context) ApiTestInlineAdditionalPropertiesRequest @@ -187,8 +187,8 @@ type FakeApi interface { /* TestJsonFormData test json serialization of form data - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestJsonFormDataRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestJsonFormDataRequest */ TestJsonFormData(ctx context.Context) ApiTestJsonFormDataRequest @@ -200,8 +200,8 @@ type FakeApi interface { To test the collection format in query parameters - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestQueryParameterCollectionFormatRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestQueryParameterCollectionFormatRequest */ TestQueryParameterCollectionFormat(ctx context.Context) ApiTestQueryParameterCollectionFormatRequest @@ -213,8 +213,8 @@ type FakeApi interface { To test unique items in header and query parameters - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest */ TestUniqueItemsHeaderAndQueryParameterCollectionFormat(ctx context.Context) ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest @@ -231,7 +231,6 @@ type ApiFakeHealthGetRequest struct { ApiService FakeApi } - func (r ApiFakeHealthGetRequest) Execute() (*HealthCheckResult, *http.Response, error) { return r.ApiService.FakeHealthGetExecute(r) } @@ -866,6 +865,7 @@ func (r ApiTestBodyWithQueryParamsRequest) Query(query string) ApiTestBodyWithQu r.query = &query return r } + func (r ApiTestBodyWithQueryParamsRequest) User(user User) ApiTestBodyWithQueryParamsRequest { r.user = &user return r @@ -1096,66 +1096,79 @@ func (r ApiTestEndpointParametersRequest) Number(number float32) ApiTestEndpoint r.number = &number return r } + // None func (r ApiTestEndpointParametersRequest) Double(double float64) ApiTestEndpointParametersRequest { r.double = &double return r } + // None func (r ApiTestEndpointParametersRequest) PatternWithoutDelimiter(patternWithoutDelimiter string) ApiTestEndpointParametersRequest { r.patternWithoutDelimiter = &patternWithoutDelimiter return r } + // None func (r ApiTestEndpointParametersRequest) Byte_(byte_ string) ApiTestEndpointParametersRequest { r.byte_ = &byte_ return r } + // None func (r ApiTestEndpointParametersRequest) Integer(integer int32) ApiTestEndpointParametersRequest { r.integer = &integer return r } + // None func (r ApiTestEndpointParametersRequest) Int32_(int32_ int32) ApiTestEndpointParametersRequest { r.int32_ = &int32_ return r } + // None func (r ApiTestEndpointParametersRequest) Int64_(int64_ int64) ApiTestEndpointParametersRequest { r.int64_ = &int64_ return r } + // None func (r ApiTestEndpointParametersRequest) Float(float float32) ApiTestEndpointParametersRequest { r.float = &float return r } + // None func (r ApiTestEndpointParametersRequest) String_(string_ string) ApiTestEndpointParametersRequest { r.string_ = &string_ return r } + // None func (r ApiTestEndpointParametersRequest) Binary(binary *os.File) ApiTestEndpointParametersRequest { r.binary = &binary return r } + // None func (r ApiTestEndpointParametersRequest) Date(date string) ApiTestEndpointParametersRequest { r.date = &date return r } + // None func (r ApiTestEndpointParametersRequest) DateTime(dateTime time.Time) ApiTestEndpointParametersRequest { r.dateTime = &dateTime return r } + // None func (r ApiTestEndpointParametersRequest) Password(password string) ApiTestEndpointParametersRequest { r.password = &password return r } + // None func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpointParametersRequest { r.callback = &callback @@ -1339,36 +1352,43 @@ func (r ApiTestEnumParametersRequest) EnumHeaderStringArray(enumHeaderStringArra r.enumHeaderStringArray = &enumHeaderStringArray return r } + // Header parameter enum test (string) func (r ApiTestEnumParametersRequest) EnumHeaderString(enumHeaderString string) ApiTestEnumParametersRequest { r.enumHeaderString = &enumHeaderString return r } + // Query parameter enum test (string array) func (r ApiTestEnumParametersRequest) EnumQueryStringArray(enumQueryStringArray []string) ApiTestEnumParametersRequest { r.enumQueryStringArray = &enumQueryStringArray return r } + // Query parameter enum test (string) func (r ApiTestEnumParametersRequest) EnumQueryString(enumQueryString string) ApiTestEnumParametersRequest { r.enumQueryString = &enumQueryString return r } + // Query parameter enum test (double) func (r ApiTestEnumParametersRequest) EnumQueryInteger(enumQueryInteger int32) ApiTestEnumParametersRequest { r.enumQueryInteger = &enumQueryInteger return r } + // Query parameter enum test (double) func (r ApiTestEnumParametersRequest) EnumQueryDouble(enumQueryDouble float64) ApiTestEnumParametersRequest { r.enumQueryDouble = &enumQueryDouble return r } + // Form parameter enum test (string array) func (r ApiTestEnumParametersRequest) EnumFormStringArray(enumFormStringArray []string) ApiTestEnumParametersRequest { r.enumFormStringArray = &enumFormStringArray return r } + // Form parameter enum test (string) func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiTestEnumParametersRequest { r.enumFormString = &enumFormString @@ -1506,26 +1526,31 @@ func (r ApiTestGroupParametersRequest) RequiredStringGroup(requiredStringGroup i r.requiredStringGroup = &requiredStringGroup return r } + // Required Boolean in group parameters func (r ApiTestGroupParametersRequest) RequiredBooleanGroup(requiredBooleanGroup bool) ApiTestGroupParametersRequest { r.requiredBooleanGroup = &requiredBooleanGroup return r } + // Required Integer in group parameters func (r ApiTestGroupParametersRequest) RequiredInt64Group(requiredInt64Group int64) ApiTestGroupParametersRequest { r.requiredInt64Group = &requiredInt64Group return r } + // String in group parameters func (r ApiTestGroupParametersRequest) StringGroup(stringGroup int32) ApiTestGroupParametersRequest { r.stringGroup = &stringGroup return r } + // Boolean in group parameters func (r ApiTestGroupParametersRequest) BooleanGroup(booleanGroup bool) ApiTestGroupParametersRequest { r.booleanGroup = &booleanGroup return r } + // Integer in group parameters func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroupParametersRequest { r.int64Group = &int64Group @@ -1746,6 +1771,7 @@ func (r ApiTestJsonFormDataRequest) Param(param string) ApiTestJsonFormDataReque r.param = ¶m return r } + // field2 func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataRequest { r.param2 = ¶m2 @@ -1855,18 +1881,22 @@ func (r ApiTestQueryParameterCollectionFormatRequest) Pipe(pipe []string) ApiTes r.pipe = &pipe return r } + func (r ApiTestQueryParameterCollectionFormatRequest) Ioutil(ioutil []string) ApiTestQueryParameterCollectionFormatRequest { r.ioutil = &ioutil return r } + func (r ApiTestQueryParameterCollectionFormatRequest) Http(http []string) ApiTestQueryParameterCollectionFormatRequest { r.http = &http return r } + func (r ApiTestQueryParameterCollectionFormatRequest) Url(url []string) ApiTestQueryParameterCollectionFormatRequest { r.url = &url return r } + func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) ApiTestQueryParameterCollectionFormatRequest { r.context = &context return r @@ -2006,6 +2036,7 @@ func (r ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest) QueryU r.queryUnique = &queryUnique return r } + func (r ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest) HeaderUnique(headerUnique []string) ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest { r.headerUnique = &headerUnique return r diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 73e85680e9f2..2e7e85e20c74 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -26,8 +26,8 @@ type FakeClassnameTags123Api interface { To test class name in snake case - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestClassnameRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestClassnameRequest */ TestClassname(ctx context.Context) ApiTestClassnameRequest diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index f6aa8aea7aa3..dcd0fb584290 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -26,8 +26,8 @@ type PetApi interface { /* AddPet Add a new pet to the store - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAddPetRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddPetRequest */ AddPet(ctx context.Context) ApiAddPetRequest @@ -37,9 +37,9 @@ type PetApi interface { /* DeletePet Deletes a pet - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId Pet id to delete - @return ApiDeletePetRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId Pet id to delete + @return ApiDeletePetRequest */ DeletePet(ctx context.Context, petId int64) ApiDeletePetRequest @@ -51,8 +51,8 @@ type PetApi interface { Multiple status values can be provided with comma separated strings - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFindPetsByStatusRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindPetsByStatusRequest */ FindPetsByStatus(ctx context.Context) ApiFindPetsByStatusRequest @@ -65,8 +65,8 @@ type PetApi interface { Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiFindPetsByTagsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindPetsByTagsRequest Deprecated */ @@ -82,9 +82,9 @@ type PetApi interface { Returns a single pet - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId ID of pet to return - @return ApiGetPetByIdRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId ID of pet to return + @return ApiGetPetByIdRequest */ GetPetById(ctx context.Context, petId int64) ApiGetPetByIdRequest @@ -95,8 +95,8 @@ type PetApi interface { /* UpdatePet Update an existing pet - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiUpdatePetRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUpdatePetRequest */ UpdatePet(ctx context.Context) ApiUpdatePetRequest @@ -106,9 +106,9 @@ type PetApi interface { /* UpdatePetWithForm Updates a pet in the store with form data - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId ID of pet that needs to be updated - @return ApiUpdatePetWithFormRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId ID of pet that needs to be updated + @return ApiUpdatePetWithFormRequest */ UpdatePetWithForm(ctx context.Context, petId int64) ApiUpdatePetWithFormRequest @@ -118,9 +118,9 @@ type PetApi interface { /* UploadFile uploads an image - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId ID of pet to update - @return ApiUploadFileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId ID of pet to update + @return ApiUploadFileRequest */ UploadFile(ctx context.Context, petId int64) ApiUploadFileRequest @@ -131,9 +131,9 @@ type PetApi interface { /* UploadFileWithRequiredFile uploads an image (required) - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param petId ID of pet to update - @return ApiUploadFileWithRequiredFileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param petId ID of pet to update + @return ApiUploadFileWithRequiredFileRequest */ UploadFileWithRequiredFile(ctx context.Context, petId int64) ApiUploadFileWithRequiredFileRequest @@ -572,7 +572,6 @@ type ApiGetPetByIdRequest struct { petId int64 } - func (r ApiGetPetByIdRequest) Execute() (*Pet, *http.Response, error) { return r.ApiService.GetPetByIdExecute(r) } @@ -795,6 +794,7 @@ func (r ApiUpdatePetWithFormRequest) Name(name string) ApiUpdatePetWithFormReque r.name = &name return r } + // Updated status of the pet func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormRequest { r.status = &status @@ -904,6 +904,7 @@ func (r ApiUploadFileRequest) AdditionalMetadata(additionalMetadata string) ApiU r.additionalMetadata = &additionalMetadata return r } + // file to upload func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { r.file = &file @@ -1038,6 +1039,7 @@ func (r ApiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File r.requiredFile = &requiredFile return r } + // Additional data to pass to server func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileWithRequiredFileRequest { r.additionalMetadata = &additionalMetadata diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index e257cb5c2d57..5ff7698faa4a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -27,9 +27,9 @@ type StoreApi interface { For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param orderId ID of the order that needs to be deleted - @return ApiDeleteOrderRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orderId ID of the order that needs to be deleted + @return ApiDeleteOrderRequest */ DeleteOrder(ctx context.Context, orderId string) ApiDeleteOrderRequest @@ -41,8 +41,8 @@ type StoreApi interface { Returns a map of status codes to quantities - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetInventoryRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetInventoryRequest */ GetInventory(ctx context.Context) ApiGetInventoryRequest @@ -55,9 +55,9 @@ type StoreApi interface { For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param orderId ID of pet that needs to be fetched - @return ApiGetOrderByIdRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orderId ID of pet that needs to be fetched + @return ApiGetOrderByIdRequest */ GetOrderById(ctx context.Context, orderId int64) ApiGetOrderByIdRequest @@ -68,8 +68,8 @@ type StoreApi interface { /* PlaceOrder Place an order for a pet - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiPlaceOrderRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPlaceOrderRequest */ PlaceOrder(ctx context.Context) ApiPlaceOrderRequest @@ -87,7 +87,6 @@ type ApiDeleteOrderRequest struct { orderId string } - func (r ApiDeleteOrderRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteOrderExecute(r) } @@ -179,7 +178,6 @@ type ApiGetInventoryRequest struct { ApiService StoreApi } - func (r ApiGetInventoryRequest) Execute() (map[string]int32, *http.Response, error) { return r.ApiService.GetInventoryExecute(r) } @@ -294,7 +292,6 @@ type ApiGetOrderByIdRequest struct { orderId int64 } - func (r ApiGetOrderByIdRequest) Execute() (*Order, *http.Response, error) { return r.ApiService.GetOrderByIdExecute(r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index 4fa005f05660..0ea539c457e5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -27,8 +27,8 @@ type UserApi interface { This can only be done by the logged in user. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateUserRequest */ CreateUser(ctx context.Context) ApiCreateUserRequest @@ -38,8 +38,8 @@ type UserApi interface { /* CreateUsersWithArrayInput Creates list of users with given input array - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateUsersWithArrayInputRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateUsersWithArrayInputRequest */ CreateUsersWithArrayInput(ctx context.Context) ApiCreateUsersWithArrayInputRequest @@ -49,8 +49,8 @@ type UserApi interface { /* CreateUsersWithListInput Creates list of users with given input array - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateUsersWithListInputRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateUsersWithListInputRequest */ CreateUsersWithListInput(ctx context.Context) ApiCreateUsersWithListInputRequest @@ -62,9 +62,9 @@ type UserApi interface { This can only be done by the logged in user. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param username The name that needs to be deleted - @return ApiDeleteUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The name that needs to be deleted + @return ApiDeleteUserRequest */ DeleteUser(ctx context.Context, username string) ApiDeleteUserRequest @@ -74,9 +74,9 @@ type UserApi interface { /* GetUserByName Get user by user name - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param username The name that needs to be fetched. Use user1 for testing. - @return ApiGetUserByNameRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The name that needs to be fetched. Use user1 for testing. + @return ApiGetUserByNameRequest */ GetUserByName(ctx context.Context, username string) ApiGetUserByNameRequest @@ -87,8 +87,8 @@ type UserApi interface { /* LoginUser Logs user into the system - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiLoginUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLoginUserRequest */ LoginUser(ctx context.Context) ApiLoginUserRequest @@ -99,8 +99,8 @@ type UserApi interface { /* LogoutUser Logs out current logged in user session - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiLogoutUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLogoutUserRequest */ LogoutUser(ctx context.Context) ApiLogoutUserRequest @@ -112,9 +112,9 @@ type UserApi interface { This can only be done by the logged in user. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param username name that need to be deleted - @return ApiUpdateUserRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username name that need to be deleted + @return ApiUpdateUserRequest */ UpdateUser(ctx context.Context, username string) ApiUpdateUserRequest @@ -427,7 +427,6 @@ type ApiDeleteUserRequest struct { username string } - func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteUserExecute(r) } @@ -520,7 +519,6 @@ type ApiGetUserByNameRequest struct { username string } - func (r ApiGetUserByNameRequest) Execute() (*User, *http.Response, error) { return r.ApiService.GetUserByNameExecute(r) } @@ -628,6 +626,7 @@ func (r ApiLoginUserRequest) Username(username string) ApiLoginUserRequest { r.username = &username return r } + // The password for login in clear text func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { r.password = &password @@ -739,7 +738,6 @@ type ApiLogoutUserRequest struct { ApiService UserApi } - func (r ApiLogoutUserRequest) Execute() (*http.Response, error) { return r.ApiService.LogoutUserExecute(r) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go index 1452a7259f12..c8bc5e8960ed 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go @@ -58,7 +58,7 @@ func (o *Animal) GetClassName() string { // GetClassNameOk returns a tuple with the ClassName field value // and a boolean to check if the value has been set. func (o *Animal) GetClassNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.ClassName, true diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go index 5bed586e0651..f57b7fdf8c82 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go @@ -54,7 +54,7 @@ func (o *AppleReq) GetCultivar() string { // GetCultivarOk returns a tuple with the Cultivar field value // and a boolean to check if the value has been set. func (o *AppleReq) GetCultivarOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Cultivar, true diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go index 67e6d5542b92..c36aedfd31f6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go @@ -54,7 +54,7 @@ func (o *BananaReq) GetLengthCm() float32 { // GetLengthCmOk returns a tuple with the LengthCm field value // and a boolean to check if the value has been set. func (o *BananaReq) GetLengthCmOk() (*float32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.LengthCm, true diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_category.go b/samples/openapi3/client/petstore/go/go-petstore/model_category.go index f045ffa65669..124537d152e5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_category.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_category.go @@ -88,7 +88,7 @@ func (o *Category) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *Category) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go index b1f488fa0ba8..367a1c46d210 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go @@ -100,7 +100,7 @@ func (o *EnumTest) GetEnumStringRequired() string { // GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field value // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EnumStringRequired, true @@ -188,7 +188,7 @@ func (o *EnumTest) GetOuterEnum() OuterEnum { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool) { - if o == nil { + if o == nil { return nil, false } return o.OuterEnum.Get(), o.OuterEnum.IsSet() diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go index af2fe2e7b184..64c5bf0aed10 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go @@ -170,7 +170,7 @@ func (o *FormatTest) GetNumber() float32 { // GetNumberOk returns a tuple with the Number field value // and a boolean to check if the value has been set. func (o *FormatTest) GetNumberOk() (*float32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Number, true @@ -290,7 +290,7 @@ func (o *FormatTest) GetByte() string { // GetByteOk returns a tuple with the Byte field value // and a boolean to check if the value has been set. func (o *FormatTest) GetByteOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Byte, true @@ -346,7 +346,7 @@ func (o *FormatTest) GetDate() string { // GetDateOk returns a tuple with the Date field value // and a boolean to check if the value has been set. func (o *FormatTest) GetDateOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Date, true @@ -434,7 +434,7 @@ func (o *FormatTest) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value // and a boolean to check if the value has been set. func (o *FormatTest) GetPasswordOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Password, true diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go b/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go index 89403e096c1b..769a5d448687 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go @@ -52,7 +52,7 @@ func (o *HealthCheckResult) GetNullableMessage() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *HealthCheckResult) GetNullableMessageOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.NullableMessage.Get(), o.NullableMessage.IsSet() diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_name.go b/samples/openapi3/client/petstore/go/go-petstore/model_name.go index 0c4f820c6e5e..51adb2a1611a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_name.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_name.go @@ -56,7 +56,7 @@ func (o *Name) GetName() int32 { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *Name) GetNameOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go index dbf4bfdbb894..f49994d44317 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go @@ -65,7 +65,7 @@ func (o *NullableClass) GetIntegerProp() int32 { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetIntegerPropOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.IntegerProp.Get(), o.IntegerProp.IsSet() @@ -107,7 +107,7 @@ func (o *NullableClass) GetNumberProp() float32 { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetNumberPropOk() (*float32, bool) { - if o == nil { + if o == nil { return nil, false } return o.NumberProp.Get(), o.NumberProp.IsSet() @@ -149,7 +149,7 @@ func (o *NullableClass) GetBooleanProp() bool { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetBooleanPropOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return o.BooleanProp.Get(), o.BooleanProp.IsSet() @@ -191,7 +191,7 @@ func (o *NullableClass) GetStringProp() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetStringPropOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.StringProp.Get(), o.StringProp.IsSet() @@ -233,7 +233,7 @@ func (o *NullableClass) GetDateProp() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetDatePropOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DateProp.Get(), o.DateProp.IsSet() @@ -275,7 +275,7 @@ func (o *NullableClass) GetDatetimeProp() time.Time { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetDatetimePropOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.DatetimeProp.Get(), o.DatetimeProp.IsSet() @@ -306,7 +306,7 @@ func (o *NullableClass) UnsetDatetimeProp() { // GetArrayNullableProp returns the ArrayNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetArrayNullableProp() []map[string]interface{} { - if o == nil { + if o == nil { var ret []map[string]interface{} return ret } @@ -339,7 +339,7 @@ func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{}) { // GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetArrayAndItemsNullableProp() []*map[string]interface{} { - if o == nil { + if o == nil { var ret []*map[string]interface{} return ret } @@ -404,7 +404,7 @@ func (o *NullableClass) SetArrayItemsNullable(v []*map[string]interface{}) { // GetObjectNullableProp returns the ObjectNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]map[string]interface{} return ret } @@ -437,7 +437,7 @@ func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{ // GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]map[string]interface{} return ret } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go index 8dffc304e742..f4ed04820c80 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go @@ -125,7 +125,7 @@ func (o *Pet) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *Pet) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -149,7 +149,7 @@ func (o *Pet) GetPhotoUrls() []string { // GetPhotoUrlsOk returns a tuple with the PhotoUrls field value // and a boolean to check if the value has been set. func (o *Pet) GetPhotoUrlsOk() ([]string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PhotoUrls, true diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_user.go b/samples/openapi3/client/petstore/go/go-petstore/model_user.go index a4b6dc232ef6..831790bdb62f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_user.go @@ -345,7 +345,7 @@ func (o *User) SetArbitraryObject(v map[string]interface{}) { // GetArbitraryNullableObject returns the ArbitraryNullableObject field value if set, zero value otherwise (both if not set or set to explicit null). func (o *User) GetArbitraryNullableObject() map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]interface{} return ret } @@ -378,7 +378,7 @@ func (o *User) SetArbitraryNullableObject(v map[string]interface{}) { // GetArbitraryTypeValue returns the ArbitraryTypeValue field value if set, zero value otherwise (both if not set or set to explicit null). func (o *User) GetArbitraryTypeValue() interface{} { - if o == nil { + if o == nil { var ret interface{} return ret } @@ -411,7 +411,7 @@ func (o *User) SetArbitraryTypeValue(v interface{}) { // GetArbitraryNullableTypeValue returns the ArbitraryNullableTypeValue field value if set, zero value otherwise (both if not set or set to explicit null). func (o *User) GetArbitraryNullableTypeValue() interface{} { - if o == nil { + if o == nil { var ret interface{} return ret } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_whale.go b/samples/openapi3/client/petstore/go/go-petstore/model_whale.go index 914b81162960..2e562647568e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_whale.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_whale.go @@ -119,7 +119,7 @@ func (o *Whale) GetClassName() string { // GetClassNameOk returns a tuple with the ClassName field value // and a boolean to check if the value has been set. func (o *Whale) GetClassNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.ClassName, true diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go b/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go index eb23ffbedc9c..0c70bc462ccc 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go @@ -86,7 +86,7 @@ func (o *Zebra) GetClassName() string { // GetClassNameOk returns a tuple with the ClassName field value // and a boolean to check if the value has been set. func (o *Zebra) GetClassNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.ClassName, true From c161358aa819a508343ce03b366edb41e1886edb Mon Sep 17 00:00:00 2001 From: Felix Winterhalter Date: Sat, 19 Feb 2022 06:52:52 +0100 Subject: [PATCH 089/111] [Csharp][aspnet] Aspnet 6.0 Support (#10619) * Aspnetcore V6 Support * docs: update-docs --- docs/generators/aspnetcore.md | 4 +-- .../languages/AspNetCoreServerCodegen.java | 28 +++++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index a85eac91e7ff..685aee8fd94d 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -18,7 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|aspnetCoreVersion|ASP.NET Core version: 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|
    **2.0**
    ASP.NET Core 2.0
    **2.1**
    ASP.NET Core 2.1
    **2.2**
    ASP.NET Core 2.2
    **3.0**
    ASP.NET Core 3.0
    **3.1**
    ASP.NET Core 3.1
    **5.0**
    ASP.NET Core 5.0
    |3.1| +|aspnetCoreVersion|ASP.NET Core version: 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|
    **2.0**
    ASP.NET Core 2.0
    **2.1**
    ASP.NET Core 2.1
    **2.2**
    ASP.NET Core 2.2
    **3.0**
    ASP.NET Core 3.0
    **3.1**
    ASP.NET Core 3.1
    **5.0**
    ASP.NET Core 5.0
    **6.0**
    ASP.NET Core 6.0
    |3.1| |buildTarget|Target to build an application or library|
    **program**
    Generate code for a standalone server
    **library**
    Generate code for a server abstract class library
    |program| |classModifier|Class Modifier for controller classes: Empty string or abstract.| || |compatibilityVersion|ASP.Net Core CompatibilityVersion| |Version_2_2| @@ -44,7 +44,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| -|swashbuckleVersion|Swashbuckle version: 3.0.0, 4.0.0, 5.0.0|
    **3.0.0**
    Swashbuckle 3.0.0
    **4.0.0**
    Swashbuckle 4.0.0
    **5.0.0**
    Swashbuckle 5.0.0
    |3.0.0| +|swashbuckleVersion|Swashbuckle version: 3.0.0, 4.0.0, 5.0.0, 6.0.0|
    **3.0.0**
    Swashbuckle 3.0.0
    **4.0.0**
    Swashbuckle 4.0.0
    **5.0.0**
    Swashbuckle 5.0.0
    **6.0.0**
    Swashbuckle 6.0.0
    |3.0.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| |useDefaultRouting|Use default routing for the ASP.NET Core version.| |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index 43b1cbab49ed..674d71f6ff02 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -69,8 +69,8 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { private boolean useSwashbuckle = true; protected int serverPort = 8080; protected String serverHost = "0.0.0.0"; - protected CliOption swashbuckleVersion = new CliOption(SWASHBUCKLE_VERSION, "Swashbuckle version: 3.0.0, 4.0.0, 5.0.0"); - protected CliOption aspnetCoreVersion = new CliOption(ASPNET_CORE_VERSION, "ASP.NET Core version: 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)"); + protected CliOption swashbuckleVersion = new CliOption(SWASHBUCKLE_VERSION, "Swashbuckle version: 3.0.0, 4.0.0, 5.0.0, 6.0.0"); + protected CliOption aspnetCoreVersion = new CliOption(ASPNET_CORE_VERSION, "ASP.NET Core version: 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)"); private CliOption classModifier = new CliOption(CLASS_MODIFIER, "Class Modifier for controller classes: Empty string or abstract."); private CliOption operationModifier = new CliOption(OPERATION_MODIFIER, "Operation Modifier can be virtual or abstract"); private CliOption modelClassModifier = new CliOption(MODEL_CLASS_MODIFIER, "Model Class Modifier can be nothing or partial"); @@ -197,6 +197,7 @@ public AspNetCoreServerCodegen() { aspnetCoreVersion.addEnum("3.0", "ASP.NET Core 3.0"); aspnetCoreVersion.addEnum("3.1", "ASP.NET Core 3.1"); aspnetCoreVersion.addEnum("5.0", "ASP.NET Core 5.0"); + aspnetCoreVersion.addEnum("6.0", "ASP.NET Core 6.0"); aspnetCoreVersion.setDefault("3.1"); aspnetCoreVersion.setOptValue(aspnetCoreVersion.getDefault()); cliOptions.add(aspnetCoreVersion); @@ -204,6 +205,7 @@ public AspNetCoreServerCodegen() { swashbuckleVersion.addEnum("3.0.0", "Swashbuckle 3.0.0"); swashbuckleVersion.addEnum("4.0.0", "Swashbuckle 4.0.0"); swashbuckleVersion.addEnum("5.0.0", "Swashbuckle 5.0.0"); + swashbuckleVersion.addEnum("6.0.0", "Swashbuckle 6.0.0"); swashbuckleVersion.setDefault("3.0.0"); swashbuckleVersion.setOptValue(swashbuckleVersion.getDefault()); cliOptions.add(swashbuckleVersion); @@ -378,7 +380,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("gitignore", packageFolder, ".gitignore")); supportingFiles.add(new SupportingFile("validateModel.mustache", packageFolder + File.separator + "Attributes", "ValidateModelStateAttribute.cs")); supportingFiles.add(new SupportingFile("typeConverter.mustache", packageFolder + File.separator + "Converters", "CustomEnumConverter.cs")); - if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.0")) { + if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.0") || aspnetCoreVersion.getOptValue().startsWith("6.")) { supportingFiles.add(new SupportingFile("OpenApi" + File.separator + "TypeExtensions.mustache", packageFolder + File.separator + "OpenApi", "TypeExtensions.cs")); } supportingFiles.add(new SupportingFile("Project.csproj.mustache", packageFolder, packageName + ".csproj")); @@ -610,7 +612,7 @@ private void setBuildTarget() { private void setAspnetCoreVersion(String packageFolder) { setCliOption(aspnetCoreVersion); - if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.0")) { + if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.0") || aspnetCoreVersion.getOptValue().startsWith("6.")) { compatibilityVersion = null; } else if ("2.0".equals(aspnetCoreVersion.getOptValue())) { compatibilityVersion = null; @@ -627,6 +629,7 @@ private void setAspnetCoreVersion(String packageFolder) { private String determineTemplateVersion(String frameworkVersion) { switch (frameworkVersion) { + case "6.0": case "5.0": case "3.1": return "3.0"; @@ -679,6 +682,13 @@ private void setIsFramework() { useFrameworkReference = true; additionalProperties.put(USE_FRAMEWORK_REFERENCE, useFrameworkReference); additionalProperties.put(TARGET_FRAMEWORK, "net5.0"); + } else if (aspnetCoreVersion.getOptValue().startsWith("6.")) { + LOGGER.warn( + "ASP.NET core version is {} so changing to use frameworkReference instead of packageReference ", + aspnetCoreVersion.getOptValue()); + useFrameworkReference = true; + additionalProperties.put(USE_FRAMEWORK_REFERENCE, useFrameworkReference); + additionalProperties.put(TARGET_FRAMEWORK, "net6.0"); } else { if (additionalProperties.containsKey(USE_FRAMEWORK_REFERENCE)) { useFrameworkReference = convertPropertyToBooleanAndWriteBack(USE_FRAMEWORK_REFERENCE); @@ -705,7 +715,7 @@ private void setUseNewtonsoft() { } private void setUseEndpointRouting() { - if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.")) { + if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.") || aspnetCoreVersion.getOptValue().startsWith("6.")) { LOGGER.warn("ASP.NET core version is {} so switching to old style endpoint routing.", aspnetCoreVersion.getOptValue()); useDefaultRouting = false; additionalProperties.put(USE_DEFAULT_ROUTING, useDefaultRouting); @@ -725,7 +735,13 @@ private void setSwashbuckleVersion() { LOGGER.warn("ASP.NET core version is {} so changing default Swashbuckle version to 5.0.0.", aspnetCoreVersion.getOptValue()); swashbuckleVersion.setOptValue("5.0.0"); additionalProperties.put(SWASHBUCKLE_VERSION, swashbuckleVersion.getOptValue()); - } else { + } + else if(aspnetCoreVersion.getOptValue().startsWith("6.")) { + LOGGER.warn("ASP.NET core version is {} so changing default Swashbuckle version to 6.0.0.", aspnetCoreVersion.getOptValue()); + swashbuckleVersion.setOptValue("6.0.0"); + additionalProperties.put(SWASHBUCKLE_VERSION, swashbuckleVersion.getOptValue()); + } + else { // default, do nothing LOGGER.info("Swashbuckle version: {}", swashbuckleVersion.getOptValue()); } From 2918b8706e33ce4fe0fe864a09ef2aef0b120493 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 19 Feb 2022 14:40:12 +0800 Subject: [PATCH 090/111] better code format in c#, aspnet generators (#11662) --- .../languages/AspNetCoreServerCodegen.java | 17 ++- .../languages/CSharpNetCoreClientCodegen.java | 123 +++++++++--------- 2 files changed, 69 insertions(+), 71 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index 674d71f6ff02..59141da07397 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -49,7 +49,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { public static final String GENERATE_BODY = "generateBody"; public static final String BUILD_TARGET = "buildTarget"; public static final String MODEL_CLASS_MODIFIER = "modelClassModifier"; - public static final String TARGET_FRAMEWORK= "targetFramework"; + public static final String TARGET_FRAMEWORK = "targetFramework"; public static final String PROJECT_SDK = "projectSdk"; public static final String SDK_WEB = "Microsoft.NET.Sdk.Web"; @@ -150,8 +150,8 @@ public AspNetCoreServerCodegen() { // CLI options addOption(CodegenConstants.PACKAGE_DESCRIPTION, - CodegenConstants.PACKAGE_DESCRIPTION_DESC, - packageDescription); + CodegenConstants.PACKAGE_DESCRIPTION_DESC, + packageDescription); addOption(CodegenConstants.LICENSE_URL, CodegenConstants.LICENSE_URL_DESC, @@ -474,10 +474,9 @@ public Map postProcessOperationsWithModels(Map o continue; } - if(consumesString.toString().isEmpty()) { + if (consumesString.toString().isEmpty()) { consumesString = new StringBuilder("\"" + consume.get("mediaType") + "\""); - } - else { + } else { consumesString.append(", \"").append(consume.get("mediaType")).append("\""); } @@ -502,7 +501,7 @@ public Map postProcessOperationsWithModels(Map o } } - if(!consumesString.toString().isEmpty()) { + if (!consumesString.toString().isEmpty()) { operation.vendorExtensions.put("x-aspnetcore-consumes", consumesString.toString()); } } @@ -598,7 +597,7 @@ private void setModelClassModifier() { private void setBuildTarget() { setCliOption(buildTarget); if ("library".equals(buildTarget.getOptValue())) { - LOGGER.warn("buildTarget is {} so changing default isLibrary to true", buildTarget.getOptValue()); + LOGGER.warn("buildTarget is {} so changing default isLibrary to true", buildTarget.getOptValue()); isLibrary = true; projectSdk = SDK_LIB; additionalProperties.put(CLASS_MODIFIER, "abstract"); @@ -621,7 +620,7 @@ private void setAspnetCoreVersion(String packageFolder) { compatibilityVersion = "Version_" + aspnetCoreVersion.getOptValue().replace(".", "_"); } LOGGER.info("ASP.NET core version: {}", aspnetCoreVersion.getOptValue()); - if(!additionalProperties.containsKey(CodegenConstants.TEMPLATE_DIR)){ + if (!additionalProperties.containsKey(CodegenConstants.TEMPLATE_DIR)) { templateDir = embeddedTemplateDir = "aspnetcore" + File.separator + determineTemplateVersion(aspnetCoreVersion.getOptValue()); } additionalProperties.put(COMPATIBILITY_VERSION, compatibilityVersion); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index 9ba892cace65..f41eb0ea8cf5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -181,7 +181,7 @@ public CSharpNetCoreClientCodegen() { this.packageName); addOption(CodegenConstants.API_NAME, - "Must be a valid C# class name. Only used in Generic Host library. Default: " + this.apiName, + "Must be a valid C# class name. Only used in Generic Host library. Default: " + this.apiName, this.apiName); addOption(CodegenConstants.PACKAGE_VERSION, @@ -275,7 +275,7 @@ public CSharpNetCoreClientCodegen() { addSwitch(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES, CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES_DESC, this.optionalEmitDefaultValuesFlag); - + addSwitch(CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION, CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION_DESC, this.conditionalSerialization); @@ -334,9 +334,9 @@ public CSharpNetCoreClientCodegen() { @Override public String apiDocFileFolder() { - if (GENERICHOST.equals(getLibrary())){ + if (GENERICHOST.equals(getLibrary())) { return (outputFolder + "/" + apiDocPath + File.separatorChar + "apis").replace('/', File.separatorChar); - }else{ + } else { return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); } } @@ -396,15 +396,15 @@ public CodegenModel fromModel(String name, Schema model) { } // avoid breaking changes - if (GENERICHOST.equals(getLibrary())){ + if (GENERICHOST.equals(getLibrary())) { Comparator comparatorByDefaultValue = new Comparator() { - @Override + @Override public int compare(CodegenProperty one, CodegenProperty another) { - if (one.defaultValue == another.defaultValue) + if (one.defaultValue == another.defaultValue) return 0; - else if (Boolean.FALSE.equals(one.defaultValue)) + else if (Boolean.FALSE.equals(one.defaultValue)) return -1; - else + else return 1; } }; @@ -412,11 +412,11 @@ else if (Boolean.FALSE.equals(one.defaultValue)) Comparator comparatorByRequired = new Comparator() { @Override public int compare(CodegenProperty one, CodegenProperty another) { - if (one.required == another.required) + if (one.required == another.required) return 0; else if (Boolean.TRUE.equals(one.required)) return -1; - else + else return 1; } }; @@ -502,9 +502,9 @@ public void setNonPublicApi(final boolean nonPublicApi) { @Override public String modelDocFileFolder() { - if (GENERICHOST.equals(getLibrary())){ + if (GENERICHOST.equals(getLibrary())) { return (outputFolder + "/" + modelDocPath + File.separator + "models").replace('/', File.separatorChar); - }else{ + } else { return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); } } @@ -630,7 +630,7 @@ public void processOpts() { clientPackage = "Client"; - if (GENERICHOST.equals(getLibrary())){ + if (GENERICHOST.equals(getLibrary())) { setLibrary(GENERICHOST); additionalProperties.put("useGenericHost", true); // all c# libraries should be doing this, but we only do it here to avoid breaking changes @@ -656,7 +656,7 @@ public void processOpts() { additionalProperties.put("multiTarget", true); } else { // just a single value - frameworks = new String [] {inputFramework}; + frameworks = new String[]{inputFramework}; } for (String framework : frameworks) { @@ -668,14 +668,14 @@ public void processOpts() { } if (frameworkStrategy != FrameworkStrategy.NETSTANDARD_2_0 && "restsharp".equals(getLibrary())) { - LOGGER.warn("If using built-in templates, RestSharp only supports netstandard 2.0 or later."); + LOGGER.warn("If using built-in templates, RestSharp only supports netstandard 2.0 or later."); } } if (!strategyMatched) { // throws exception if the input targetFramework is invalid throw new IllegalArgumentException("The input (" + inputFramework + ") contains Invalid .NET framework version: " + - framework + ". List of supported versions: " + + framework + ". List of supported versions: " + frameworkStrategies.stream() .map(p -> p.name) .collect(Collectors.joining(", "))); @@ -693,13 +693,13 @@ public void processOpts() { if (!netStandard) { setNetCoreProjectFileFlag(true); - if (!additionalProperties.containsKey(CodegenConstants.NULLABLE_REFERENCE_TYPES) && !strategies.stream().anyMatch(s -> - s.equals(FrameworkStrategy.NETCOREAPP_2_0) || - s.equals(FrameworkStrategy.NETCOREAPP_2_1) || - s.equals(FrameworkStrategy.NETCOREAPP_3_0) || - s.equals(FrameworkStrategy.NETCOREAPP_3_1) || - s.equals(FrameworkStrategy.NET_5_0) || - s.equals(FrameworkStrategy.NETFRAMEWORK_4_7))) { + if (!additionalProperties.containsKey(CodegenConstants.NULLABLE_REFERENCE_TYPES) && !strategies.stream().anyMatch(s -> + s.equals(FrameworkStrategy.NETCOREAPP_2_0) || + s.equals(FrameworkStrategy.NETCOREAPP_2_1) || + s.equals(FrameworkStrategy.NETCOREAPP_3_0) || + s.equals(FrameworkStrategy.NETCOREAPP_3_1) || + s.equals(FrameworkStrategy.NET_5_0) || + s.equals(FrameworkStrategy.NETFRAMEWORK_4_7))) { // starting in .net 6.0, NRT is enabled by default. If not specified, lets enable NRT to match the framework's default setNullableReferenceTypes(true); } @@ -749,19 +749,17 @@ public void processOpts() { apiTestTemplateFiles.put("api_test.mustache", ".cs"); } - if(HTTPCLIENT.equals(getLibrary())) { + if (HTTPCLIENT.equals(getLibrary())) { supportingFiles.add(new SupportingFile("FileParameter.mustache", clientPackageDir, "FileParameter.cs")); typeMapping.put("file", "FileParameter"); addRestSharpSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir); additionalProperties.put("apiDocPath", apiDocPath); additionalProperties.put("modelDocPath", modelDocPath); - } - else if (GENERICHOST.equals(getLibrary())){ + } else if (GENERICHOST.equals(getLibrary())) { addGenericHostSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir); additionalProperties.put("apiDocPath", apiDocPath + File.separatorChar + "apis"); additionalProperties.put("modelDocPath", modelDocPath + File.separatorChar + "models"); - } - else{ + } else { addRestSharpSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir); additionalProperties.put("apiDocPath", apiDocPath); additionalProperties.put("modelDocPath", modelDocPath); @@ -777,7 +775,7 @@ public CodegenOperation fromOperation(String path, List servers) { CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); - if (!GENERICHOST.equals(getLibrary())){ + if (!GENERICHOST.equals(getLibrary())) { return op; } @@ -808,32 +806,32 @@ else if (Boolean.TRUE.equals(one.required)) return op; } - private void addTestInstructions(){ - if (GENERICHOST.equals(getLibrary())){ - additionalProperties.put("testInstructions", + private void addTestInstructions() { + if (GENERICHOST.equals(getLibrary())) { + additionalProperties.put("testInstructions", "/* *********************************************************************************" + - "\n* Follow these manual steps to construct tests." + - "\n* This file will not be overwritten." + - "\n* *********************************************************************************" + - "\n* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly." + - "\n* Take care not to commit credentials to any repository." + - "\n*" + - "\n* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients." + - "\n* To mock the client, use the generic AddApiHttpClients." + - "\n* To mock the server, change the client's BaseAddress." + - "\n*" + - "\n* 3. Locate the test you want below" + - "\n* - remove the skip property from the Fact attribute" + - "\n* - set the value of any variables if necessary" + - "\n*" + - "\n* 4. Run the tests and ensure they work." + - "\n*" + - "\n*/"); + "\n* Follow these manual steps to construct tests." + + "\n* This file will not be overwritten." + + "\n* *********************************************************************************" + + "\n* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly." + + "\n* Take care not to commit credentials to any repository." + + "\n*" + + "\n* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients." + + "\n* To mock the client, use the generic AddApiHttpClients." + + "\n* To mock the server, change the client's BaseAddress." + + "\n*" + + "\n* 3. Locate the test you want below" + + "\n* - remove the skip property from the Fact attribute" + + "\n* - set the value of any variables if necessary" + + "\n*" + + "\n* 4. Run the tests and ensure they work." + + "\n*" + + "\n*/"); } } - public void addRestSharpSupportingFiles(final String clientPackageDir, final String packageFolder, - final AtomicReference excludeTests, final String testPackageFolder, final String testPackageName, final String modelPackageDir){ + public void addRestSharpSupportingFiles(final String clientPackageDir, final String packageFolder, + final AtomicReference excludeTests, final String testPackageFolder, final String testPackageName, final String modelPackageDir) { supportingFiles.add(new SupportingFile("IApiAccessor.mustache", clientPackageDir, "IApiAccessor.cs")); supportingFiles.add(new SupportingFile("Configuration.mustache", clientPackageDir, "Configuration.cs")); supportingFiles.add(new SupportingFile("ApiClient.mustache", clientPackageDir, "ApiClient.cs")); @@ -842,10 +840,10 @@ public void addRestSharpSupportingFiles(final String clientPackageDir, final Str supportingFiles.add(new SupportingFile("ExceptionFactory.mustache", clientPackageDir, "ExceptionFactory.cs")); supportingFiles.add(new SupportingFile("OpenAPIDateConverter.mustache", clientPackageDir, "OpenAPIDateConverter.cs")); supportingFiles.add(new SupportingFile("ClientUtils.mustache", clientPackageDir, "ClientUtils.cs")); - if(needsCustomHttpMethod) { + if (needsCustomHttpMethod) { supportingFiles.add(new SupportingFile("HttpMethod.mustache", clientPackageDir, "HttpMethod.cs")); } - if(needsUriBuilder) { + if (needsUriBuilder) { supportingFiles.add(new SupportingFile("WebRequestPathBuilder.mustache", clientPackageDir, "WebRequestPathBuilder.cs")); } if (ProcessUtils.hasHttpSignatureMethods(openAPI)) { @@ -882,8 +880,8 @@ public void addRestSharpSupportingFiles(final String clientPackageDir, final Str supportingFiles.add(new SupportingFile("AbstractOpenAPISchema.mustache", modelPackageDir, "AbstractOpenAPISchema.cs")); } - public void addGenericHostSupportingFiles(final String clientPackageDir, final String packageFolder, - final AtomicReference excludeTests, final String testPackageFolder, final String testPackageName, final String modelPackageDir){ + public void addGenericHostSupportingFiles(final String clientPackageDir, final String packageFolder, + final AtomicReference excludeTests, final String testPackageFolder, final String testPackageName, final String modelPackageDir) { supportingFiles.add(new SupportingFile("TokenProvider`1.mustache", clientPackageDir, "TokenProvider`1.cs")); supportingFiles.add(new SupportingFile("RateLimitProvider`1.mustache", clientPackageDir, "RateLimitProvider`1.cs")); supportingFiles.add(new SupportingFile("TokenContainer`1.mustache", clientPackageDir, "TokenContainer`1.cs")); @@ -952,7 +950,7 @@ public void setOptionalEmitDefaultValuesFlag(boolean flag) { this.optionalEmitDefaultValuesFlag = flag; } - public void setConditionalSerialization(boolean flag){ + public void setConditionalSerialization(boolean flag) { this.conditionalSerialization = flag; } @@ -970,12 +968,13 @@ public void setPackageName(String packageName) { this.packageName = packageName; } - /** + /** * Sets the api name. This value must be a valid class name. + * * @param apiName The api name - */ + */ public void setApiName(String apiName) { - if (!"".equals(apiName) && (Boolean.FALSE.equals(apiName.matches("^[a-zA-Z0-9_]*$")) || Boolean.FALSE.equals(apiName.matches("^[a-zA-Z].*")))){ + if (!"".equals(apiName) && (Boolean.FALSE.equals(apiName.matches("^[a-zA-Z0-9_]*$")) || Boolean.FALSE.equals(apiName.matches("^[a-zA-Z].*")))) { throw new RuntimeException("Invalid project name " + apiName + ". May only contain alphanumeric characaters or underscore and start with a letter."); } this.apiName = apiName; @@ -1000,8 +999,8 @@ public void setTargetFramework(String dotnetFramework) { throw new IllegalArgumentException("Invalid .NET framework version: " + dotnetFramework + ". List of supported versions: " + frameworkStrategies.stream() - .map(p -> p.name) - .collect(Collectors.joining(", "))); + .map(p -> p.name) + .collect(Collectors.joining(", "))); } else { this.targetFramework = dotnetFramework; } From 3a119b9cff38b0c91a112eba1f92b1fb9bd924e4 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 19 Feb 2022 18:46:38 +0800 Subject: [PATCH 091/111] Add tests for Aspnet 6, minor bug fixes (#11663) * add tests for aspnet core 6 * bug fix, update samples --- .github/workflows/samples-dotnet.yaml | 3 + bin/configs/aspnetcore-6.0.yaml | 8 + .../languages/AspNetCoreServerCodegen.java | 19 +- .../aspnetcore-6.0/.openapi-generator-ignore | 23 + .../aspnetcore-6.0/.openapi-generator/FILES | 30 + .../aspnetcore-6.0/.openapi-generator/VERSION | 1 + .../aspnetcore-6.0/Org.OpenAPITools.sln | 22 + .../server/petstore/aspnetcore-6.0/README.md | 24 + .../server/petstore/aspnetcore-6.0/build.bat | 9 + .../server/petstore/aspnetcore-6.0/build.sh | 8 + .../src/Org.OpenAPITools/.gitignore | 362 ++++++ .../Attributes/ValidateModelStateAttribute.cs | 61 + .../Authentication/ApiAuthentication.cs | 62 + .../Org.OpenAPITools/Controllers/PetApi.cs | 260 ++++ .../Org.OpenAPITools/Controllers/StoreApi.cs | 141 +++ .../Org.OpenAPITools/Controllers/UserApi.cs | 218 ++++ .../Converters/CustomEnumConverter.cs | 42 + .../src/Org.OpenAPITools/Dockerfile | 32 + .../Filters/BasePathFilter.cs | 50 + .../GeneratePathParamsValidationFilter.cs | 97 ++ .../Formatters/InputFormatterStream.cs | 32 + .../Org.OpenAPITools/Models/ApiResponse.cs | 147 +++ .../src/Org.OpenAPITools/Models/Category.cs | 134 ++ .../src/Org.OpenAPITools/Models/Order.cs | 219 ++++ .../src/Org.OpenAPITools/Models/Pet.cs | 223 ++++ .../src/Org.OpenAPITools/Models/Tag.cs | 133 ++ .../src/Org.OpenAPITools/Models/User.cs | 218 ++++ .../OpenApi/TypeExtensions.cs | 51 + .../Org.OpenAPITools/Org.OpenAPITools.csproj | 27 + .../src/Org.OpenAPITools/Program.cs | 33 + .../Properties/launchSettings.json | 37 + .../src/Org.OpenAPITools/Startup.cs | 154 +++ .../src/Org.OpenAPITools/appsettings.json | 8 + .../src/Org.OpenAPITools/wwwroot/README.md | 42 + .../src/Org.OpenAPITools/wwwroot/index.html | 1 + .../wwwroot/openapi-original.json | 1106 +++++++++++++++++ 36 files changed, 4032 insertions(+), 5 deletions(-) create mode 100644 bin/configs/aspnetcore-6.0.yaml create mode 100644 samples/server/petstore/aspnetcore-6.0/.openapi-generator-ignore create mode 100644 samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES create mode 100644 samples/server/petstore/aspnetcore-6.0/.openapi-generator/VERSION create mode 100644 samples/server/petstore/aspnetcore-6.0/Org.OpenAPITools.sln create mode 100644 samples/server/petstore/aspnetcore-6.0/README.md create mode 100644 samples/server/petstore/aspnetcore-6.0/build.bat create mode 100644 samples/server/petstore/aspnetcore-6.0/build.sh create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/.gitignore create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/PetApi.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/StoreApi.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/UserApi.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Dockerfile create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/ApiResponse.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Category.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Order.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Pet.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Tag.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/User.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Program.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Properties/launchSettings.json create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Startup.cs create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/appsettings.json create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/README.md create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/index.html create mode 100644 samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml index f6545044a0bb..2726f86ccdb0 100644 --- a/.github/workflows/samples-dotnet.yaml +++ b/.github/workflows/samples-dotnet.yaml @@ -4,9 +4,11 @@ on: push: paths: - 'samples/client/petstore/csharp-netcore/**net6.0**/' + - 'samples/server/petstore/aspnetcore-6.0/**' pull_request: paths: - 'samples/client/petstore/csharp-netcore/**net6.0**/' + - 'samples/server/petstore/aspnetcore-6.0/**' jobs: build: name: Build .Net projects @@ -18,6 +20,7 @@ jobs: # clients - samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0 - samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt + - samples/server/petstore/aspnetcore-6.0 steps: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 diff --git a/bin/configs/aspnetcore-6.0.yaml b/bin/configs/aspnetcore-6.0.yaml new file mode 100644 index 000000000000..8207af4f8e50 --- /dev/null +++ b/bin/configs/aspnetcore-6.0.yaml @@ -0,0 +1,8 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-6.0 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "6.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index 59141da07397..58eea7e9a553 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -332,7 +332,18 @@ public void processOpts() { setPackageGuid((String) additionalProperties.get(CodegenConstants.OPTIONAL_PROJECT_GUID)); } additionalProperties.put("packageGuid", packageGuid); - additionalProperties.put("userSecretsGuid", userSecretsGuid); + + if (!additionalProperties.containsKey("packageGuid")) { + additionalProperties.put("packageGuid", packageGuid); + } else { + packageGuid = (String) additionalProperties.get("packageGuid"); + } + + if (!additionalProperties.containsKey("userSecretsGuid")) { + additionalProperties.put("userSecretsGuid", userSecretsGuid); + } else { + userSecretsGuid = (String) additionalProperties.get("userSecretsGuid"); + } if (!additionalProperties.containsKey(NEWTONSOFT_VERSION)) { additionalProperties.put(NEWTONSOFT_VERSION, newtonsoftVersion); @@ -734,13 +745,11 @@ private void setSwashbuckleVersion() { LOGGER.warn("ASP.NET core version is {} so changing default Swashbuckle version to 5.0.0.", aspnetCoreVersion.getOptValue()); swashbuckleVersion.setOptValue("5.0.0"); additionalProperties.put(SWASHBUCKLE_VERSION, swashbuckleVersion.getOptValue()); - } - else if(aspnetCoreVersion.getOptValue().startsWith("6.")) { + } else if (aspnetCoreVersion.getOptValue().startsWith("6.")) { LOGGER.warn("ASP.NET core version is {} so changing default Swashbuckle version to 6.0.0.", aspnetCoreVersion.getOptValue()); swashbuckleVersion.setOptValue("6.0.0"); additionalProperties.put(SWASHBUCKLE_VERSION, swashbuckleVersion.getOptValue()); - } - else { + } else { // default, do nothing LOGGER.info("Swashbuckle version: {}", swashbuckleVersion.getOptValue()); } diff --git a/samples/server/petstore/aspnetcore-6.0/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-6.0/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/.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/server/petstore/aspnetcore-6.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES new file mode 100644 index 000000000000..4d275ef7bc3a --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES @@ -0,0 +1,30 @@ +Org.OpenAPITools.sln +README.md +build.bat +build.sh +src/Org.OpenAPITools/.gitignore +src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +src/Org.OpenAPITools/Controllers/PetApi.cs +src/Org.OpenAPITools/Controllers/StoreApi.cs +src/Org.OpenAPITools/Controllers/UserApi.cs +src/Org.OpenAPITools/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools/Dockerfile +src/Org.OpenAPITools/Filters/BasePathFilter.cs +src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs +src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Program.cs +src/Org.OpenAPITools/Properties/launchSettings.json +src/Org.OpenAPITools/Startup.cs +src/Org.OpenAPITools/appsettings.json +src/Org.OpenAPITools/wwwroot/README.md +src/Org.OpenAPITools/wwwroot/index.html +src/Org.OpenAPITools/wwwroot/openapi-original.json diff --git a/samples/server/petstore/aspnetcore-6.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/VERSION new file mode 100644 index 000000000000..5f68295fc196 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-6.0/Org.OpenAPITools.sln new file mode 100644 index 000000000000..c2bc38764202 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/server/petstore/aspnetcore-6.0/README.md b/samples/server/petstore/aspnetcore-6.0/README.md new file mode 100644 index 000000000000..ef01f590dfc6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/README.md @@ -0,0 +1,24 @@ +# Org.OpenAPITools - ASP.NET Core 6.0 Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` +## Run in Docker + +``` +cd src/Org.OpenAPITools +docker build -t org.openapitools . +docker run -p 5000:8080 org.openapitools +``` diff --git a/samples/server/petstore/aspnetcore-6.0/build.bat b/samples/server/petstore/aspnetcore-6.0/build.bat new file mode 100644 index 000000000000..cd65518e4287 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://openapi-generator.tech +:: + +@echo off + +dotnet restore src\Org.OpenAPITools +dotnet build src\Org.OpenAPITools +echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-6.0/build.sh b/samples/server/petstore/aspnetcore-6.0/build.sh new file mode 100644 index 000000000000..afbeddb83782 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://openapi-generator.tech +# + +dotnet restore src/Org.OpenAPITools/ && \ + dotnet build src/Org.OpenAPITools/ && \ + echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/.gitignore new file mode 100644 index 000000000000..1ee53850b84c --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 000000000000..3ed1bc5b5ab9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace Org.OpenAPITools.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + if (descriptor != null) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + var validationAttribute = attributeInstance as ValidationAttribute; + if (validationAttribute != null) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 000000000000..85be8593fce7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,62 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace Org.OpenAPITools.Authentication +{ + /// + /// A requirement that an ApiKey must be present. + /// + public class ApiKeyRequirement : IAuthorizationRequirement + { + /// + /// Get the list of api keys + /// + public IReadOnlyList ApiKeys { get; } + + /// + /// Get the policy name, + /// + public string PolicyName { get; } + + /// + /// Create a new instance of the class. + /// + /// + /// + public ApiKeyRequirement(IEnumerable apiKeys, string policyName) + { + ApiKeys = apiKeys?.ToList() ?? new List(); + PolicyName = policyName; + } + } + + /// + /// Enforce that an api key is present. + /// + public class ApiKeyRequirementHandler : AuthorizationHandler + { + /// + protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + SucceedRequirementIfApiKeyPresentAndValid(context, requirement); + return Task.CompletedTask; + } + + private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + + if (context.Resource is AuthorizationFilterContext authorizationFilterContext) + { + var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); + if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) + { + context.Succeed(requirement); + } + } + + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 000000000000..982c1a6011df --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class PetApiController : ControllerBase + { + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("AddPet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult AddPet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + [SwaggerOperation("DeletePet")] + public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + throw new NotImplementedException(); + } + + /// + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + /// Status values that need to be considered for filter (deprecated) + /// successful operation + /// Invalid status value + [HttpGet] + [Route("/v2/pet/findByStatus")] + [ValidateModelState] + [SwaggerOperation("FindPetsByStatus")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// Tags to filter by + /// successful operation + /// Invalid tag value + [HttpGet] + [Route("/v2/pet/findByTags")] + [ValidateModelState] + [SwaggerOperation("FindPetsByTags")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + [Obsolete] + public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + [HttpGet] + [Route("/v2/pet/{petId}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetPetById")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("UpdatePet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult UpdatePet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + /// Invalid input + [HttpPost] + [Route("/v2/pet/{petId}")] + [Consumes("application/x-www-form-urlencoded")] + [ValidateModelState] + [SwaggerOperation("UpdatePetWithForm")] + public virtual IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status) + { + + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + + throw new NotImplementedException(); + } + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + [HttpPost] + [Route("/v2/pet/{petId}/uploadImage")] + [Consumes("multipart/form-data")] + [ValidateModelState] + [SwaggerOperation("UploadFile")] + [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] + public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(ApiResponse)); + string exampleJson = null; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 000000000000..2077313f7dda --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class StoreApiController : ControllerBase + { + /// + /// Delete purchase order by ID + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// ID of the order that needs to be deleted + /// Invalid ID supplied + /// Order not found + [HttpDelete] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("DeleteOrder")] + public virtual IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + [HttpGet] + [Route("/v2/store/inventory")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetInventory")] + [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] + public virtual IActionResult GetInventory() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Dictionary)); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(Dictionary); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// ID of pet that needs to be fetched + /// successful operation + /// Invalid ID supplied + /// Order not found + [HttpGet] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("GetOrderById")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + [HttpPost] + [Route("/v2/store/order")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("PlaceOrder")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult PlaceOrder([FromBody]Order order) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 000000000000..6d7094c81a9d --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class UserApiController : ControllerBase + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + [HttpPost] + [Route("/v2/user")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUser")] + public virtual IActionResult CreateUser([FromBody]User user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithArray")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithArrayInput")] + public virtual IActionResult CreateUsersWithArrayInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithList")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithListInput")] + public virtual IActionResult CreateUsersWithListInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Delete user + /// + /// This can only be done by the logged in user. + /// The name that needs to be deleted + /// Invalid username supplied + /// User not found + [HttpDelete] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("DeleteUser")] + public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// successful operation + /// Invalid username supplied + /// User not found + [HttpGet] + [Route("/v2/user/{username}")] + [ValidateModelState] + [SwaggerOperation("GetUserByName")] + [SwaggerResponse(statusCode: 200, type: typeof(User), description: "successful operation")] + public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(User)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; + exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(User); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// successful operation + /// Invalid username/password supplied + [HttpGet] + [Route("/v2/user/login")] + [ValidateModelState] + [SwaggerOperation("LoginUser")] + [SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")] + public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(string)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(string); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs out current logged in user session + /// + /// successful operation + [HttpGet] + [Route("/v2/user/logout")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("LogoutUser")] + public virtual IActionResult LogoutUser() + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Updated user + /// + /// This can only be done by the logged in user. + /// name that need to be deleted + /// Updated user object + /// Invalid user supplied + /// User not found + [HttpPut] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("UpdateUser")] + public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 000000000000..00b75a3cc7c7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -0,0 +1,42 @@ +using System; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + /// + /// Determine if we can convert a type to an enum + /// + /// + /// + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); + } + + /// + /// Convert from a type value to an enum + /// + /// + /// + /// + /// + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonConvert.DeserializeObject(@"""" + value.ToString() + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 000000000000..7184e1ece4d0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# Container we use for final publish +FROM mcr.microsoft.com/dotnet/core/aspnet:6.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:6.0-buster AS build + +# Copy the code into the container +WORKDIR /src +COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"] + +# NuGet restore +RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj" +COPY ["src/Org.OpenAPITools/", "Org.OpenAPITools/"] + +# Build the API +WORKDIR "Org.OpenAPITools" +RUN dotnet build "Org.OpenAPITools.csproj" -c Release -o /app/build + +# Publish it +FROM build AS publish +RUN dotnet publish "Org.OpenAPITools.csproj" -c Release -o /app/publish + +# Make the final image for publishing +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Org.OpenAPITools.dll"] diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 000000000000..a23854510764 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,50 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of OpenAPI and removes it from the individual URL paths + /// + public class BasePathFilter : IDocumentFilter + { + /// + /// Constructor + /// + /// BasePath to remove from Operations + public BasePathFilter(string basePath) + { + BasePath = basePath; + } + + /// + /// Gets the BasePath of the OpenAPI Doc + /// + /// The BasePath of the OpenAPI Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// OpenApiDocument + /// FilterContext + public void Apply(OpenApiDocument openapiDoc, DocumentFilterContext context) + { + //openapiDoc.BasePath = BasePath; + + var pathsToModify = openapiDoc.Paths.Where(p => p.Key.StartsWith(BasePath)).ToList(); + + foreach (var (key, value) in pathsToModify) + { + if (key.StartsWith(BasePath)) + { + var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty); + openapiDoc.Paths.Remove(key); + openapiDoc.Paths.Add(newKey, value); + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 000000000000..65d9d4695208 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,97 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var openapiParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes.ToList(); + + // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1147 + // and https://mikeralphson.github.io/openapi/2017/03/15/openapi3.0.0-rc0 + // Basically OpenAPI v3 body parameters are split out into RequestBody and the properties have moved to schema + if (attributes.Any() && openapiParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + openapiParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + var regex = (string)regexAttr.ConstructorArguments[0].Value; + openapiParam.Schema.Pattern = regex; + } + + // String Length [StringLength] + int? minLength = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLength = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; + } + maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; + } + + var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); + if (minLengthAttr != null) + { + minLength = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (minLength != null) + { + openapiParam.Schema.MinLength = minLength; + } + + if (maxLength != null) + { + openapiParam.Schema.MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + openapiParam.Schema.MinLength = rangeMin; + openapiParam.Schema.MaxLength = rangeMax; + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 000000000000..9c437b1919a6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,32 @@ +using System; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Formatters; + +namespace Org.OpenAPITools.Formatters +{ + // Input Type Formatter to allow model binding to Streams + public class InputFormatterStream : InputFormatter + { + public InputFormatterStream() + { + SupportedMediaTypes.Add("application/octet-stream"); + SupportedMediaTypes.Add("image/jpeg"); + } + + protected override bool CanReadType(Type type) + { + if (type == typeof(Stream)) + { + return true; + } + + return false; + } + + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 000000000000..88e45fce388b --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=false)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ApiResponse)obj); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + + Code.Equals(other.Code) + ) && + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ) && + ( + Message == other.Message || + Message != null && + Message.Equals(other.Message) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Code.GetHashCode(); + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + if (Message != null) + hashCode = hashCode * 59 + Message.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ApiResponse left, ApiResponse right) + { + return Equals(left, right); + } + + public static bool operator !=(ApiResponse left, ApiResponse right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 000000000000..8b9fd03a240e --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Category)obj); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Category left, Category right) + { + return Equals(left, right); + } + + public static bool operator !=(Category left, Category right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 000000000000..e9013f0ed0df --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,219 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=false)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=false)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=false)] + public DateTime ShipDate { get; set; } + + + /// + /// Order Status + /// + /// Order Status + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum PlacedEnum for placed + /// + [EnumMember(Value = "placed")] + PlacedEnum = 1, + + /// + /// Enum ApprovedEnum for approved + /// + [EnumMember(Value = "approved")] + ApprovedEnum = 2, + + /// + /// Enum DeliveredEnum for delivered + /// + [EnumMember(Value = "delivered")] + DeliveredEnum = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=false)] + public StatusEnum Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=false)] + public bool Complete { get; set; } = false; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Order)obj); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + ShipDate != null && + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + + Complete.Equals(other.Complete) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + + hashCode = hashCode * 59 + PetId.GetHashCode(); + + hashCode = hashCode * 59 + Quantity.GetHashCode(); + if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + + hashCode = hashCode * 59 + Complete.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Order left, Order right) + { + return Equals(left, right); + } + + public static bool operator !=(Order left, Order right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 000000000000..d5a816cd5ee1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,223 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [Required] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// pet status in the store + /// + /// pet status in the store + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum AvailableEnum for available + /// + [EnumMember(Value = "available")] + AvailableEnum = 1, + + /// + /// Enum PendingEnum for pending + /// + [EnumMember(Value = "pending")] + PendingEnum = 2, + + /// + /// Enum SoldEnum for sold + /// + [EnumMember(Value = "sold")] + SoldEnum = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=false)] + public StatusEnum Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Pet)obj); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Category == other.Category || + Category != null && + Category.Equals(other.Category) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + PhotoUrls == other.PhotoUrls || + PhotoUrls != null && + other.PhotoUrls != null && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + other.Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Category != null) + hashCode = hashCode * 59 + Category.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (PhotoUrls != null) + hashCode = hashCode * 59 + PhotoUrls.GetHashCode(); + if (Tags != null) + hashCode = hashCode * 59 + Tags.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Pet left, Pet right) + { + return Equals(left, right); + } + + public static bool operator !=(Pet left, Pet right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 000000000000..090f95cc494f --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Tag)obj); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Tag left, Tag right) + { + return Equals(left, right); + } + + public static bool operator !=(Tag left, Tag right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 000000000000..4c6d96d08c50 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,218 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=false)] + public int UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((User)obj); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Username == other.Username || + Username != null && + Username.Equals(other.Username) + ) && + ( + FirstName == other.FirstName || + FirstName != null && + FirstName.Equals(other.FirstName) + ) && + ( + LastName == other.LastName || + LastName != null && + LastName.Equals(other.LastName) + ) && + ( + Email == other.Email || + Email != null && + Email.Equals(other.Email) + ) && + ( + Password == other.Password || + Password != null && + Password.Equals(other.Password) + ) && + ( + Phone == other.Phone || + Phone != null && + Phone.Equals(other.Phone) + ) && + ( + UserStatus == other.UserStatus || + + UserStatus.Equals(other.UserStatus) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Username != null) + hashCode = hashCode * 59 + Username.GetHashCode(); + if (FirstName != null) + hashCode = hashCode * 59 + FirstName.GetHashCode(); + if (LastName != null) + hashCode = hashCode * 59 + LastName.GetHashCode(); + if (Email != null) + hashCode = hashCode * 59 + Email.GetHashCode(); + if (Password != null) + hashCode = hashCode * 59 + Password.GetHashCode(); + if (Phone != null) + hashCode = hashCode * 59 + Phone.GetHashCode(); + + hashCode = hashCode * 59 + UserStatus.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(User left, User right) + { + return Equals(left, right); + } + + public static bool operator !=(User left, User right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 000000000000..b862226f2c1b --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -0,0 +1,51 @@ +using System; +using System.Linq; +using System.Text; + +namespace Org.OpenAPITools.OpenApi +{ + /// + /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x + /// + public static class TypeExtensions + { + /// + /// Produce a friendly name for the type which is unique. + /// + /// + /// + public static string FriendlyId(this Type type, bool fullyQualified = false) + { + var typeName = fullyQualified + ? type.FullNameSansTypeParameters().Replace("+", ".") + : type.Name; + + if (type.IsGenericType) + { + var genericArgumentIds = type.GetGenericArguments() + .Select(t => t.FriendlyId(fullyQualified)) + .ToArray(); + + return new StringBuilder(typeName) + .Replace($"`{genericArgumentIds.Count()}", string.Empty) + .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") + .ToString(); + } + + return typeName; + } + + /// + /// Determine the fully qualified type name without type parameters. + /// + /// + public static string FullNameSansTypeParameters(this Type type) + { + var fullName = type.FullName; + if (string.IsNullOrEmpty(fullName)) + fullName = type.Name; + var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); + return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 000000000000..0aaa1b25a4fa --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,27 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net6.0 + true + true + 1.0.0 + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Program.cs new file mode 100644 index 000000000000..00ed16ed6758 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Org.OpenAPITools +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + /// + /// Create the host builder. + /// + /// + /// IHostBuilder + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup() + .UseUrls("http://0.0.0.0:8080/"); + }); + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 000000000000..99cfeea4b919 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:61788", + "sslPort": 44301 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "openapi", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "OpenAPI": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "openapi", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi", + "publishAllPorts": true, + "useSSL": true + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 000000000000..5699f0151674 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Reflection; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Org.OpenAPITools.Authentication; +using Org.OpenAPITools.Filters; +using Org.OpenAPITools.OpenApi; +using Org.OpenAPITools.Formatters; + +namespace Org.OpenAPITools +{ + /// + /// Startup + /// + public class Startup + { + /// + /// Constructor + /// + /// + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + /// + /// The application configuration. + /// + public IConfiguration Configuration { get; } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + services.AddTransient(); + services.AddAuthorization(authConfig => + { + authConfig.AddPolicy("api_key", policyBuilder => + { + policyBuilder + .AddRequirements(new ApiKeyRequirement(new[] { "my-secret-key" },"api_key")); + }); + }); + + // Add framework services. + services + // Don't need the full MVC stack for an API, see https://andrewlock.net/comparing-startup-between-the-asp-net-core-3-templates/ + .AddControllers(options => { + options.InputFormatters.Insert(0, new InputFormatterStream()); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter + { + NamingStrategy = new CamelCaseNamingStrategy() + }); + }); + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("1.0.0", new OpenApiInfo + { + Title = "OpenAPI Petstore", + Description = "OpenAPI Petstore (ASP.NET Core 6.0)", + TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), + Contact = new OpenApiContact + { + Name = "OpenAPI-Generator Contributors", + Url = new Uri("https://github.com/openapitools/openapi-generator"), + Email = "" + }, + License = new OpenApiLicense + { + Name = "NoLicense", + Url = new Uri("https://www.apache.org/licenses/LICENSE-2.0.html") + }, + Version = "1.0.0", + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); + // Sets the basePath property in the OpenAPI document generated + c.DocumentFilter("/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as OpenAPI validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); + services + .AddSwaggerGenNewtonsoftSupport(); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseDefaultFiles(); + app.UseStaticFiles(); + app.UseSwagger(c => + { + c.RouteTemplate = "openapi/{documentName}/openapi.json"; + }) + .UseSwaggerUI(c => + { + // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html + c.RoutePrefix = "openapi"; + //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) + c.SwaggerEndpoint("/openapi/1.0.0/openapi.json", "OpenAPI Petstore"); + + //TODO: Or alternatively use the original OpenAPI contract that's included in the static files + // c.SwaggerEndpoint("/openapi-original.json", "OpenAPI Petstore Original"); + }); + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 000000000000..def9159a7d94 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 000000000000..6a0b78471a33 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 000000000000..f3318bc90a11 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 000000000000..1f99af1b294d --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1106 @@ +{ + "openapi" : "3.0.0", + "info" : { + "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", + "license" : { + "name" : "Apache-2.0", + "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "title" : "OpenAPI Petstore", + "version" : "1.0.0" + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + }, + "servers" : [ { + "url" : "http://petstore.swagger.io/v2" + } ], + "tags" : [ { + "description" : "Everything about your Pets", + "name" : "pet" + }, { + "description" : "Access to Petstore orders", + "name" : "store" + }, { + "description" : "Operations about user", + "name" : "user" + } ], + "paths" : { + "/pet" : { + "post" : { + "operationId" : "addPet", + "requestBody" : { + "$ref" : "#/components/requestBodies/Pet" + }, + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "successful operation" + }, + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ] + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "$ref" : "#/components/requestBodies/Pet" + }, + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + }, + "405" : { + "description" : "Validation exception" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ] + } + }, + "/pet/findByStatus" : { + "get" : { + "description" : "Multiple status values can be provided with comma separated strings", + "operationId" : "findPetsByStatus", + "parameters" : [ { + "deprecated" : true, + "description" : "Status values that need to be considered for filter", + "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, + "schema" : { + "items" : { + "default" : "available", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "items" : { + "$ref" : "#/components/schemas/Pet" + }, + "type" : "array" + } + }, + "application/json" : { + "schema" : { + "items" : { + "$ref" : "#/components/schemas/Pet" + }, + "type" : "array" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "description" : "Invalid status value" + } + }, + "security" : [ { + "petstore_auth" : [ "read:pets" ] + } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ] + } + }, + "/pet/findByTags" : { + "get" : { + "deprecated" : true, + "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId" : "findPetsByTags", + "parameters" : [ { + "description" : "Tags to filter by", + "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "items" : { + "$ref" : "#/components/schemas/Pet" + }, + "type" : "array" + } + }, + "application/json" : { + "schema" : { + "items" : { + "$ref" : "#/components/schemas/Pet" + }, + "type" : "array" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "description" : "Invalid tag value" + } + }, + "security" : [ { + "petstore_auth" : [ "read:pets" ] + } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ] + } + }, + "/pet/{petId}" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "explode" : false, + "in" : "header", + "name" : "api_key", + "required" : false, + "schema" : { + "type" : "string" + }, + "style" : "simple" + }, { + "description" : "Pet id to delete", + "explode" : false, + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + }, + "style" : "simple" + } ], + "responses" : { + "400" : { + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", + "tags" : [ "pet" ] + }, + "get" : { + "description" : "Returns a single pet", + "operationId" : "getPetById", + "parameters" : [ { + "description" : "ID of pet to return", + "explode" : false, + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + }, + "style" : "simple" + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ] + }, + "post" : { + "operationId" : "updatePetWithForm", + "parameters" : [ { + "description" : "ID of pet that needs to be updated", + "explode" : false, + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + }, + "style" : "simple" + } ], + "requestBody" : { + "$ref" : "#/components/requestBodies/inline_object", + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + }, + "type" : "object" + } + } + } + }, + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Updates a pet in the store with form data", + "tags" : [ "pet" ] + } + }, + "/pet/{petId}/uploadImage" : { + "post" : { + "operationId" : "uploadFile", + "parameters" : [ { + "description" : "ID of pet to update", + "explode" : false, + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + }, + "style" : "simple" + } ], + "requestBody" : { + "$ref" : "#/components/requestBodies/inline_object_1", + "content" : { + "multipart/form-data" : { + "schema" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + }, + "type" : "object" + } + } + } + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ApiResponse" + } + } + }, + "description" : "successful operation" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "uploads an image", + "tags" : [ "pet" ] + } + }, + "/store/inventory" : { + "get" : { + "description" : "Returns a map of status codes to quantities", + "operationId" : "getInventory", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "additionalProperties" : { + "format" : "int32", + "type" : "integer" + }, + "type" : "object" + } + } + }, + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ] + } + }, + "/store/order" : { + "post" : { + "operationId" : "placeOrder", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "order placed for purchasing the pet", + "required" : true + }, + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "description" : "Invalid Order" + } + }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ] + } + }, + "/store/order/{orderId}" : { + "delete" : { + "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId" : "deleteOrder", + "parameters" : [ { + "description" : "ID of the order that needs to be deleted", + "explode" : false, + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + }, + "style" : "simple" + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ] + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "explode" : false, + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + }, + "style" : "simple" + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ] + } + }, + "/user" : { + "post" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "createUser", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "description" : "Created user object", + "required" : true + }, + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Create user", + "tags" : [ "user" ] + } + }, + "/user/createWithArray" : { + "post" : { + "operationId" : "createUsersWithArrayInput", + "requestBody" : { + "$ref" : "#/components/requestBodies/UserArray" + }, + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ] + } + }, + "/user/createWithList" : { + "post" : { + "operationId" : "createUsersWithListInput", + "requestBody" : { + "$ref" : "#/components/requestBodies/UserArray" + }, + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ] + } + }, + "/user/login" : { + "get" : { + "operationId" : "loginUser", + "parameters" : [ { + "description" : "The user name for login", + "explode" : true, + "in" : "query", + "name" : "username", + "required" : true, + "schema" : { + "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", + "type" : "string" + }, + "style" : "form" + }, { + "description" : "The password for login in clear text", + "explode" : true, + "in" : "query", + "name" : "password", + "required" : true, + "schema" : { + "type" : "string" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, + "description" : "successful operation", + "headers" : { + "Set-Cookie" : { + "description" : "Cookie authentication key for use with the `api_key` apiKey authentication.", + "explode" : false, + "schema" : { + "example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly", + "type" : "string" + }, + "style" : "simple" + }, + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", + "explode" : false, + "schema" : { + "format" : "int32", + "type" : "integer" + }, + "style" : "simple" + }, + "X-Expires-After" : { + "description" : "date in UTC when token expires", + "explode" : false, + "schema" : { + "format" : "date-time", + "type" : "string" + }, + "style" : "simple" + } + } + }, + "400" : { + "description" : "Invalid username/password supplied" + } + }, + "summary" : "Logs user into the system", + "tags" : [ "user" ] + } + }, + "/user/logout" : { + "get" : { + "operationId" : "logoutUser", + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ] + } + }, + "/user/{username}" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "explode" : false, + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + }, + "style" : "simple" + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Delete user", + "tags" : [ "user" ] + }, + "get" : { + "operationId" : "getUserByName", + "parameters" : [ { + "description" : "The name that needs to be fetched. Use user1 for testing.", + "explode" : false, + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + }, + "style" : "simple" + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + }, + "summary" : "Get user by user name", + "tags" : [ "user" ] + }, + "put" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "updateUser", + "parameters" : [ { + "description" : "name that need to be deleted", + "explode" : false, + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + }, + "style" : "simple" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "description" : "Updated user object", + "required" : true + }, + "responses" : { + "400" : { + "description" : "Invalid user supplied" + }, + "404" : { + "description" : "User not found" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Updated user", + "tags" : [ "user" ] + } + } + }, + "components" : { + "requestBodies" : { + "UserArray" : { + "content" : { + "application/json" : { + "schema" : { + "items" : { + "$ref" : "#/components/schemas/User" + }, + "type" : "array" + } + } + }, + "description" : "List of user object", + "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 + }, + "inline_object" : { + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "$ref" : "#/components/schemas/inline_object" + } + } + } + }, + "inline_object_1" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "$ref" : "#/components/schemas/inline_object_1" + } + } + } + } + }, + "schemas" : { + "Order" : { + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", + "xml" : { + "name" : "Order" + } + }, + "Category" : { + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", + "xml" : { + "name" : "Category" + } + }, + "User" : { + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "description" : "User Status", + "format" : "int32", + "type" : "integer" + } + }, + "title" : "a User", + "type" : "object", + "xml" : { + "name" : "User" + } + }, + "Tag" : { + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", + "xml" : { + "name" : "Tag" + } + }, + "Pet" : { + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "deprecated" : true, + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", + "xml" : { + "name" : "Pet" + } + }, + "ApiResponse" : { + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, + "properties" : { + "code" : { + "format" : "int32", + "type" : "integer" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "title" : "An uploaded response", + "type" : "object" + }, + "inline_object" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + }, + "type" : "object" + }, + "inline_object_1" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + }, + "type" : "object" + } + }, + "securitySchemes" : { + "petstore_auth" : { + "flows" : { + "implicit" : { + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + } + }, + "type" : "oauth2" + }, + "api_key" : { + "in" : "header", + "name" : "api_key", + "type" : "apiKey" + } + } + } +} From 840f36a50dc045ae94cf51fb83b83ce8eae017da Mon Sep 17 00:00:00 2001 From: sullis Date: Sat, 19 Feb 2022 02:48:57 -0800 Subject: [PATCH 092/111] maven-compiler-plugin 3.10.0 (#11660) https://github.com/apache/maven-compiler-plugin/releases/tag/maven-compiler-plugin-3.10.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5bcea3d88086..0ff88c1ac8f6 100644 --- a/pom.xml +++ b/pom.xml @@ -1468,7 +1468,7 @@ 1.14 4.13.2 1.3.60 - 3.8.1 + 3.10.0 3.2.0 3.1.1 3.0.0 From 4a7f46cba583763e9b2f04436fb981b0ba25c40d Mon Sep 17 00:00:00 2001 From: sullis Date: Sat, 19 Feb 2022 02:50:50 -0800 Subject: [PATCH 093/111] [java] openapi-generator-maven-plugin: add jaxrs-jersey2 test (#11658) --- .../openapi-generator-maven-plugin/README.md | 2 +- .../openapi-generator-maven-plugin/pom.xml | 10 +-- .../src/it/jaxrs-jersey2/invoker.properties | 3 + .../src/it/jaxrs-jersey2/pom.xml | 67 +++++++++++++++++++ .../jaxrs-jersey2/templates/README.mustache | 21 ++++++ .../src/it/jaxrs-jersey2/verify.groovy | 37 ++++++++++ 6 files changed, 134 insertions(+), 6 deletions(-) create mode 100644 modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/invoker.properties create mode 100644 modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/pom.xml create mode 100644 modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/templates/README.mustache create mode 100644 modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/verify.groovy diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index be709bea8af8..3102d196ffa3 100644 --- a/modules/openapi-generator-maven-plugin/README.md +++ b/modules/openapi-generator-maven-plugin/README.md @@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase) org.openapitools openapi-generator-maven-plugin - 5.3.0 + 5.4.0 diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index ffbcf5077bfd..2666eb1072ec 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -126,13 +126,12 @@ org.apache.maven.plugins maven-invoker-plugin - 3.2.1 + 3.2.2 + false + true verify - true - true - false - true + true @@ -146,6 +145,7 @@ integration-test + install run diff --git a/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/invoker.properties b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/invoker.properties new file mode 100644 index 000000000000..7ca0a57da2ad --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/invoker.properties @@ -0,0 +1,3 @@ +invoker.goals = -nsu clean generate-sources +# The expected result of the build, possible values are "success" (default) and "failure" +invoker.buildResult = success diff --git a/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/pom.xml b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/pom.xml new file mode 100644 index 000000000000..06e8357fcdfc --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/pom.xml @@ -0,0 +1,67 @@ + + + + + 4.0.0 + + org.openapitools.maven.its + jaxrs-jersey2 + 1.0-SNAPSHOT + + + true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.0 + + 11 + 11 + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml + jaxrs-jersey + jersey2 + java8 + ${basedir}/out + ${project.basedir}/templates + + + + + + remote + generate-sources + + generate + + + + + + + diff --git a/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/templates/README.mustache b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/templates/README.mustache new file mode 100644 index 000000000000..cee4f752e72a --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/templates/README.mustache @@ -0,0 +1,21 @@ +# TEST TEST TEST + +# {{artifactId}} + +{{appName}} + +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} + +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +… etc. diff --git a/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/verify.groovy b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/verify.groovy new file mode 100644 index 000000000000..5ab77bc67d96 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey2/verify.groovy @@ -0,0 +1,37 @@ +/* + * Copyright 2022 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 + * + * http://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. + */ + +File readme = new File(basedir, "out/README.md") + +assert readme.isFile() +assert readme.text.contains("# TEST TEST TEST") +assert readme.text.contains("# openapi-jaxrs-server") +assert readme.text.contains("OpenAPI Petstore") + +File mavenPomXml = new File(basedir, "out/pom.xml") +assert mavenPomXml.isFile() + +File petApi = new File(basedir, "out/src/gen/java/org/openapitools/api/PetApi.java") +assert petApi.isFile() +assert petApi.text.contains("import org.openapitools.api.PetApiService;") + +File petApiService = new File(basedir, "out/src/gen/java/org/openapitools/api/PetApiService.java") +assert petApiService.isFile() +assert petApiService.text.contains("import javax.ws.rs.core.Response;") + +File petModel = new File(basedir, "out/src/gen/java/org/openapitools/model/Pet.java") +assert petModel.isFile() +assert petModel.text.contains("public class Pet") From 3c8f249c6c79b4a136db33a43bcfb323f5dd26c2 Mon Sep 17 00:00:00 2001 From: sullis Date: Sat, 19 Feb 2022 02:52:39 -0800 Subject: [PATCH 094/111] [java] logback 1.2.10 (#11659) Latest version of logback https://logback.qos.ch/news.html --- modules/openapi-generator-cli/pom.xml | 2 +- .../src/main/resources/Java/libraries/feign/pom.mustache | 2 +- .../main/resources/Java/libraries/microprofile/pom.mustache | 2 +- .../src/main/resources/JavaInflector/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/cxf-ext/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/cxf/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/cxf/server/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/pom.mustache | 2 +- .../src/main/resources/java-pkmst/pom.mustache | 4 ++-- samples/client/petstore/java/feign-no-nullable/pom.xml | 2 +- samples/client/petstore/java/feign/pom.xml | 2 +- samples/client/petstore/java/microprofile-rest-client/pom.xml | 2 +- samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml | 2 +- samples/client/petstore/jaxrs-cxf-client/pom.xml | 2 +- .../client/petstore/jaxrs-cxf-client-jackson-nullable/pom.xml | 2 +- samples/server/petstore/java-inflector/pom.xml | 2 +- samples/server/petstore/java-pkmst/pom.xml | 4 ++-- samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml | 2 +- samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml | 2 +- samples/server/petstore/jaxrs-cxf/pom.xml | 2 +- samples/server/petstore/jaxrs-datelib-j8/pom.xml | 2 +- samples/server/petstore/jaxrs-jersey/pom.xml | 2 +- samples/server/petstore/jaxrs/jersey2-useTags/pom.xml | 2 +- samples/server/petstore/jaxrs/jersey2/pom.xml | 2 +- 25 files changed, 27 insertions(+), 27 deletions(-) diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index f3a3e13d60e5..1dd309c5d2ed 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -135,7 +135,7 @@ ch.qos.logback logback-classic - 1.2.3 + 1.2.10 org.codehaus.janino diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 64582f369f0b..56184aca24e8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -312,7 +312,7 @@ ch.qos.logback logback-classic - 1.2.3 + 1.2.10 test diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache index fb0603c6bd00..cee5fe3ba664 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache @@ -173,7 +173,7 @@ 1.5.18 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache index 883a84b2c763..e1a031cb2f40 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache @@ -162,7 +162,7 @@ 1.0.0 1.0.14 9.2.9.v20150224 - 1.0.1 + 1.2.10 1.3.5 4.13.1 1.6.3 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache index f5c8d59779d0..0585a00cf746 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache @@ -212,7 +212,7 @@ 1.5.22 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache index 1fcbb290e4f2..17c3cf3411b1 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache @@ -336,7 +336,7 @@ {{/generateSpringApplication}} {{^generateSpringBootApplication}} 4.13.1 - 1.2.0 + 1.2.10 {{/generateSpringBootApplication}} 3.3.0 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache index 7484478faf51..71a335cc5687 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -212,7 +212,7 @@ 1.5.18 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index aec054a25a42..69c41c150e01 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -263,7 +263,7 @@ 1.5.22 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache index b423ab3c379d..99af91a47c01 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache @@ -209,7 +209,7 @@ 2.22.2 2.9.9 4.13.1 - 1.2.0 + 1.2.10 4.0.4 UTF-8 diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/pom.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/pom.mustache index 33b2c6977d13..63c055af1068 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/pom.mustache @@ -20,8 +20,8 @@ 2.6.0 1.7.25 4.11 - 1.2.3 - 1.2.3 + 1.2.10 + 1.2.10 2.3.0 2.2.4 3.2.2 diff --git a/samples/client/petstore/java/feign-no-nullable/pom.xml b/samples/client/petstore/java/feign-no-nullable/pom.xml index e9e690629304..e57bfa8fd7b6 100644 --- a/samples/client/petstore/java/feign-no-nullable/pom.xml +++ b/samples/client/petstore/java/feign-no-nullable/pom.xml @@ -283,7 +283,7 @@ ch.qos.logback logback-classic - 1.2.3 + 1.2.10 test diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index 91a7e47bb8f6..5eec989af0c8 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -288,7 +288,7 @@ ch.qos.logback logback-classic - 1.2.3 + 1.2.10 test diff --git a/samples/client/petstore/java/microprofile-rest-client/pom.xml b/samples/client/petstore/java/microprofile-rest-client/pom.xml index b0910863ff80..b39debdea906 100644 --- a/samples/client/petstore/java/microprofile-rest-client/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client/pom.xml @@ -153,7 +153,7 @@ 1.5.18 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 3.2.7 2.9.7 1.2.2 diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml b/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml index 177096636d31..db8d31e8533f 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml @@ -173,7 +173,7 @@ 1.5.18 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 3.3.0 2.9.9 1.3.5 diff --git a/samples/client/petstore/jaxrs-cxf-client/pom.xml b/samples/client/petstore/jaxrs-cxf-client/pom.xml index bb40eef574a3..f4298803ebd7 100644 --- a/samples/client/petstore/jaxrs-cxf-client/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client/pom.xml @@ -173,7 +173,7 @@ 1.5.18 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 3.3.0 2.9.9 1.3.5 diff --git a/samples/openapi3/client/petstore/jaxrs-cxf-client-jackson-nullable/pom.xml b/samples/openapi3/client/petstore/jaxrs-cxf-client-jackson-nullable/pom.xml index 5af87d3e0daa..77f4f202797b 100644 --- a/samples/openapi3/client/petstore/jaxrs-cxf-client-jackson-nullable/pom.xml +++ b/samples/openapi3/client/petstore/jaxrs-cxf-client-jackson-nullable/pom.xml @@ -176,7 +176,7 @@ 1.5.18 9.2.9.v20150224 4.13.1 - 1.1.7 + 1.2.10 2.5 3.3.0 2.9.9 diff --git a/samples/server/petstore/java-inflector/pom.xml b/samples/server/petstore/java-inflector/pom.xml index 05b4f6391eff..63f7c2217933 100644 --- a/samples/server/petstore/java-inflector/pom.xml +++ b/samples/server/petstore/java-inflector/pom.xml @@ -162,7 +162,7 @@ 1.0.0 1.0.14 9.2.9.v20150224 - 1.0.1 + 1.2.10 1.3.5 4.13.1 1.6.3 diff --git a/samples/server/petstore/java-pkmst/pom.xml b/samples/server/petstore/java-pkmst/pom.xml index 98a9d112a1a4..752fe0b89da0 100644 --- a/samples/server/petstore/java-pkmst/pom.xml +++ b/samples/server/petstore/java-pkmst/pom.xml @@ -20,8 +20,8 @@ 2.6.0 1.7.25 4.11 - 1.2.3 - 1.2.3 + 1.2.10 + 1.2.10 2.3.0 2.2.4 3.2.2 diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index 6323a4f8c0f0..048884ed9261 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -207,7 +207,7 @@ 1.5.22 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 2.0.2 3.3.0 2.9.9 diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml index 2144ac4a4b28..f215eb980cce 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -207,7 +207,7 @@ 1.5.22 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 2.0.2 3.3.0 2.9.9 diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index d5d58ce7743a..62af843c3069 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -207,7 +207,7 @@ 1.5.22 9.2.9.v20150224 4.13.1 - 1.2.0 + 1.2.10 2.0.2 3.3.0 2.9.9 diff --git a/samples/server/petstore/jaxrs-datelib-j8/pom.xml b/samples/server/petstore/jaxrs-datelib-j8/pom.xml index 4081da921504..b3f3e77a1f58 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/pom.xml +++ b/samples/server/petstore/jaxrs-datelib-j8/pom.xml @@ -196,7 +196,7 @@ 2.22.2 2.9.9 4.13.1 - 1.2.0 + 1.2.10 4.0.4 UTF-8 diff --git a/samples/server/petstore/jaxrs-jersey/pom.xml b/samples/server/petstore/jaxrs-jersey/pom.xml index 1c022c5c6019..9586c6d1305d 100644 --- a/samples/server/petstore/jaxrs-jersey/pom.xml +++ b/samples/server/petstore/jaxrs-jersey/pom.xml @@ -196,7 +196,7 @@ 2.22.2 2.9.9 4.13.1 - 1.2.0 + 1.2.10 4.0.4 UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml index 6b35eaae9559..fc64a5939d06 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml @@ -196,7 +196,7 @@ 2.22.2 2.9.9 4.13.1 - 1.2.0 + 1.2.10 4.0.4 UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index 13b14d1b08a7..0f14733938c0 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -196,7 +196,7 @@ 2.22.2 2.9.9 4.13.1 - 1.2.0 + 1.2.10 4.0.4 UTF-8 From c5745f8d7225263647f587333e4c135979ebfcb0 Mon Sep 17 00:00:00 2001 From: sullis Date: Sat, 19 Feb 2022 19:12:55 -0800 Subject: [PATCH 095/111] [java] jersey 2.35 (#11661) --- .../src/main/resources/JavaJaxRS/api.mustache | 2 +- .../src/main/resources/JavaJaxRS/pom.mustache | 2 +- .../server/petstore/jaxrs-datelib-j8/pom.xml | 2 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 30 ++++++++-------- .../api/FakeClassnameTestApi.java | 2 +- .../gen/java/org/openapitools/api/PetApi.java | 16 ++++----- .../java/org/openapitools/api/StoreApi.java | 8 ++--- .../java/org/openapitools/api/UserApi.java | 16 ++++----- samples/server/petstore/jaxrs-jersey/pom.xml | 2 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 36 +++++++++---------- .../api/FakeClassnameTestApi.java | 2 +- .../gen/java/org/openapitools/api/FooApi.java | 2 +- .../gen/java/org/openapitools/api/PetApi.java | 16 ++++----- .../java/org/openapitools/api/StoreApi.java | 8 ++--- .../java/org/openapitools/api/UserApi.java | 16 ++++----- .../petstore/jaxrs/jersey2-useTags/pom.xml | 2 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 28 +++++++-------- .../api/FakeClassnameTags123Api.java | 2 +- .../gen/java/org/openapitools/api/PetApi.java | 18 +++++----- .../java/org/openapitools/api/StoreApi.java | 8 ++--- .../java/org/openapitools/api/UserApi.java | 16 ++++----- samples/server/petstore/jaxrs/jersey2/pom.xml | 2 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 30 ++++++++-------- .../api/FakeClassnameTestApi.java | 2 +- .../gen/java/org/openapitools/api/PetApi.java | 16 ++++----- .../java/org/openapitools/api/StoreApi.java | 8 ++--- .../java/org/openapitools/api/UserApi.java | 16 ++++----- 31 files changed, 158 insertions(+), 158 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache index b61de13287be..95e6c810bc6b 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache @@ -60,7 +60,7 @@ public class {{classname}} { } {{#operation}} - @{{httpMethod}} + @javax.ws.rs.{{httpMethod}} {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache index 99af91a47c01..aeda388be077 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache @@ -206,7 +206,7 @@ 2.0.2 {{/useBeanValidation}} 9.2.9.v20150224 - 2.22.2 + 2.35 2.9.9 4.13.1 1.2.10 diff --git a/samples/server/petstore/jaxrs-datelib-j8/pom.xml b/samples/server/petstore/jaxrs-datelib-j8/pom.xml index b3f3e77a1f58..8b0b4913adc0 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/pom.xml +++ b/samples/server/petstore/jaxrs-datelib-j8/pom.xml @@ -193,7 +193,7 @@ 1.5.18 2.0.2 9.2.9.v20150224 - 2.22.2 + 2.35 2.9.9 4.13.1 1.2.10 diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 7243aca1894f..ab81f5660277 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -55,7 +55,7 @@ public AnotherFakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java index efb4711d6d4c..9493b5ecc771 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java @@ -65,7 +65,7 @@ public FakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @Path("/create_xml_item") @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) @@ -77,7 +77,7 @@ public Response createXmlItem(@ApiParam(value = "XmlItem Body", required = true) throws NotFoundException { return delegate.createXmlItem(xmlItem, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/boolean") @Produces({ "*/*" }) @@ -89,7 +89,7 @@ public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as po throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/composite") @Produces({ "*/*" }) @@ -101,7 +101,7 @@ public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite a throws NotFoundException { return delegate.fakeOuterCompositeSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/number") @Produces({ "*/*" }) @@ -113,7 +113,7 @@ public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post throws NotFoundException { return delegate.fakeOuterNumberSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/string") @Produces({ "*/*" }) @@ -125,7 +125,7 @@ public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post throws NotFoundException { return delegate.fakeOuterStringSerialize(body, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/body-with-file-schema") @Consumes({ "application/json" }) @@ -137,7 +137,7 @@ public Response testBodyWithFileSchema(@ApiParam(value = "", required = true) @N throws NotFoundException { return delegate.testBodyWithFileSchema(body, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/body-with-query-params") @Consumes({ "application/json" }) @@ -149,7 +149,7 @@ public Response testBodyWithQueryParams(@ApiParam(value = "", required = true) @ throws NotFoundException { return delegate.testBodyWithQueryParams(query, body, securityContext); } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) @@ -161,7 +161,7 @@ public Response testClientModel(@ApiParam(value = "client model", required = tru throws NotFoundException { return delegate.testClientModel(body, securityContext); } - @POST + @javax.ws.rs.POST @Consumes({ "application/x-www-form-urlencoded" }) @@ -177,7 +177,7 @@ public Response testEndpointParameters(@ApiParam(value = "None", required=true) throws NotFoundException { return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binaryBodypart, date, dateTime, password, paramCallback, securityContext); } - @GET + @javax.ws.rs.GET @Consumes({ "application/x-www-form-urlencoded" }) @@ -190,7 +190,7 @@ public Response testEnumParameters(@ApiParam(value = "Header parameter enum test throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); } - @DELETE + @javax.ws.rs.DELETE @@ -202,7 +202,7 @@ public Response testGroupParameters(@ApiParam(value = "Required String in group throws NotFoundException { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, securityContext); } - @POST + @javax.ws.rs.POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) @@ -214,7 +214,7 @@ public Response testInlineAdditionalProperties(@ApiParam(value = "request body", throws NotFoundException { return delegate.testInlineAdditionalProperties(param, securityContext); } - @GET + @javax.ws.rs.GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) @@ -226,7 +226,7 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true) @Fo throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/test-query-parameters") @@ -238,7 +238,7 @@ public Response testQueryParameterCollectionFormat(@ApiParam(value = "", require throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); } - @POST + @javax.ws.rs.POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 73c97f612555..041ecec5af25 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -55,7 +55,7 @@ public FakeClassnameTestApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java index 85df879b3384..a0705de623e8 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java @@ -58,7 +58,7 @@ public PetApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @Consumes({ "application/json", "application/xml" }) @@ -76,7 +76,7 @@ public Response addPet(@ApiParam(value = "Pet object that needs to be added to t throws NotFoundException { return delegate.addPet(body, securityContext); } - @DELETE + @javax.ws.rs.DELETE @Path("/{petId}") @@ -94,7 +94,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete", required = true) throws NotFoundException { return delegate.deletePet(petId, apiKey, securityContext); } - @GET + @javax.ws.rs.GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) @@ -112,7 +112,7 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); } - @GET + @javax.ws.rs.GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) @@ -130,7 +130,7 @@ public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); } - @GET + @javax.ws.rs.GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) @@ -146,7 +146,7 @@ public Response getPetById(@ApiParam(value = "ID of pet to return", required = t throws NotFoundException { return delegate.getPetById(petId, securityContext); } - @PUT + @javax.ws.rs.PUT @Consumes({ "application/json", "application/xml" }) @@ -166,7 +166,7 @@ public Response updatePet(@ApiParam(value = "Pet object that needs to be added t throws NotFoundException { return delegate.updatePet(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @@ -183,7 +183,7 @@ public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be throws NotFoundException { return delegate.updatePetWithForm(petId, name, status, securityContext); } - @POST + @javax.ws.rs.POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java index 0a853c97eabf..e2dc45060906 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java @@ -56,7 +56,7 @@ public StoreApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @DELETE + @javax.ws.rs.DELETE @Path("/order/{order_id}") @@ -69,7 +69,7 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be throws NotFoundException { return delegate.deleteOrder(orderId, securityContext); } - @GET + @javax.ws.rs.GET @Path("/inventory") @Produces({ "application/json" }) @@ -83,7 +83,7 @@ public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); } - @GET + @javax.ws.rs.GET @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @@ -97,7 +97,7 @@ public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetch throws NotFoundException { return delegate.getOrderById(orderId, securityContext); } - @POST + @javax.ws.rs.POST @Path("/order") @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java index ac1d5d79c93a..cbf11d458a52 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java @@ -57,7 +57,7 @@ public UserApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @@ -69,7 +69,7 @@ public Response createUser(@ApiParam(value = "Created user object", required = t throws NotFoundException { return delegate.createUser(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/createWithArray") @@ -81,7 +81,7 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object throws NotFoundException { return delegate.createUsersWithArrayInput(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/createWithList") @@ -93,7 +93,7 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" throws NotFoundException { return delegate.createUsersWithListInput(body, securityContext); } - @DELETE + @javax.ws.rs.DELETE @Path("/{username}") @@ -106,7 +106,7 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" throws NotFoundException { return delegate.deleteUser(username, securityContext); } - @GET + @javax.ws.rs.GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) @@ -120,7 +120,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch throws NotFoundException { return delegate.getUserByName(username, securityContext); } - @GET + @javax.ws.rs.GET @Path("/login") @Produces({ "application/xml", "application/json" }) @@ -133,7 +133,7 @@ public Response loginUser(@ApiParam(value = "The user name for login", required throws NotFoundException { return delegate.loginUser(username, password, securityContext); } - @GET + @javax.ws.rs.GET @Path("/logout") @@ -145,7 +145,7 @@ public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/{username}") diff --git a/samples/server/petstore/jaxrs-jersey/pom.xml b/samples/server/petstore/jaxrs-jersey/pom.xml index 9586c6d1305d..6b7e524e917d 100644 --- a/samples/server/petstore/jaxrs-jersey/pom.xml +++ b/samples/server/petstore/jaxrs-jersey/pom.xml @@ -193,7 +193,7 @@ 1.5.18 2.0.2 9.2.9.v20150224 - 2.22.2 + 2.35 2.9.9 4.13.1 1.2.10 diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 1ea9958f5fda..9d313e3f5236 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -55,7 +55,7 @@ public AnotherFakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index 977a1d06f700..3961c0800cb9 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -66,7 +66,7 @@ public FakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @GET + @javax.ws.rs.GET @Path("/health") @Produces({ "application/json" }) @@ -78,7 +78,7 @@ public Response fakeHealthGet(@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeHealthGet(securityContext); } - @GET + @javax.ws.rs.GET @Path("/http-signature-test") @Consumes({ "application/json", "application/xml" }) @@ -92,7 +92,7 @@ public Response fakeHttpSignatureTest(@ApiParam(value = "Pet object that needs t throws NotFoundException { return delegate.fakeHttpSignatureTest(pet, query1, header1, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/boolean") @Consumes({ "application/json" }) @Produces({ "*/*" }) @@ -104,7 +104,7 @@ public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as po throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/composite") @Consumes({ "application/json" }) @Produces({ "*/*" }) @@ -116,7 +116,7 @@ public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite a throws NotFoundException { return delegate.fakeOuterCompositeSerialize(outerComposite, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/number") @Consumes({ "application/json" }) @Produces({ "*/*" }) @@ -128,7 +128,7 @@ public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post throws NotFoundException { return delegate.fakeOuterNumberSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/string") @Consumes({ "application/json" }) @Produces({ "*/*" }) @@ -140,7 +140,7 @@ public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post throws NotFoundException { return delegate.fakeOuterStringSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/property/enum-int") @Consumes({ "application/json" }) @Produces({ "*/*" }) @@ -152,7 +152,7 @@ public Response fakePropertyEnumIntegerSerialize(@ApiParam(value = "Input enum ( throws NotFoundException { return delegate.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/body-with-binary") @Consumes({ "image/png" }) @@ -164,7 +164,7 @@ public Response testBodyWithBinary(@ApiParam(value = "image to upload", required throws NotFoundException { return delegate.testBodyWithBinary(body, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/body-with-file-schema") @Consumes({ "application/json" }) @@ -176,7 +176,7 @@ public Response testBodyWithFileSchema(@ApiParam(value = "", required = true) @N throws NotFoundException { return delegate.testBodyWithFileSchema(fileSchemaTestClass, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/body-with-query-params") @Consumes({ "application/json" }) @@ -188,7 +188,7 @@ public Response testBodyWithQueryParams(@ApiParam(value = "", required = true) @ throws NotFoundException { return delegate.testBodyWithQueryParams(query, user, securityContext); } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) @@ -200,7 +200,7 @@ public Response testClientModel(@ApiParam(value = "client model", required = tru throws NotFoundException { return delegate.testClientModel(client, securityContext); } - @POST + @javax.ws.rs.POST @Consumes({ "application/x-www-form-urlencoded" }) @@ -216,7 +216,7 @@ public Response testEndpointParameters(@ApiParam(value = "None", required=true) throws NotFoundException { return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binaryBodypart, date, dateTime, password, paramCallback, securityContext); } - @GET + @javax.ws.rs.GET @Consumes({ "application/x-www-form-urlencoded" }) @@ -229,7 +229,7 @@ public Response testEnumParameters(@ApiParam(value = "Header parameter enum test throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); } - @DELETE + @javax.ws.rs.DELETE @@ -243,7 +243,7 @@ public Response testGroupParameters(@ApiParam(value = "Required String in group throws NotFoundException { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, securityContext); } - @POST + @javax.ws.rs.POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) @@ -255,7 +255,7 @@ public Response testInlineAdditionalProperties(@ApiParam(value = "request body", throws NotFoundException { return delegate.testInlineAdditionalProperties(requestBody, securityContext); } - @GET + @javax.ws.rs.GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) @@ -267,7 +267,7 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true) @Fo throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/test-query-parameters") @@ -279,7 +279,7 @@ public Response testQueryParameterCollectionFormat(@ApiParam(value = "", require throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, securityContext); } - @POST + @javax.ws.rs.POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 1877908e3f0f..70860ff047c9 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -55,7 +55,7 @@ public FakeClassnameTestApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java index 41da9a8d09da..00a9bdddb7ee 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java @@ -55,7 +55,7 @@ public FooApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @GET + @javax.ws.rs.GET @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java index 5bf2a1ace0c4..75e0bf5a5505 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java @@ -58,7 +58,7 @@ public PetApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @Consumes({ "application/json", "application/xml" }) @@ -76,7 +76,7 @@ public Response addPet(@ApiParam(value = "Pet object that needs to be added to t throws NotFoundException { return delegate.addPet(pet, securityContext); } - @DELETE + @javax.ws.rs.DELETE @Path("/{petId}") @@ -94,7 +94,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete", required = true) throws NotFoundException { return delegate.deletePet(petId, apiKey, securityContext); } - @GET + @javax.ws.rs.GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) @@ -112,7 +112,7 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); } - @GET + @javax.ws.rs.GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) @@ -130,7 +130,7 @@ public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); } - @GET + @javax.ws.rs.GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) @@ -146,7 +146,7 @@ public Response getPetById(@ApiParam(value = "ID of pet to return", required = t throws NotFoundException { return delegate.getPetById(petId, securityContext); } - @PUT + @javax.ws.rs.PUT @Consumes({ "application/json", "application/xml" }) @@ -166,7 +166,7 @@ public Response updatePet(@ApiParam(value = "Pet object that needs to be added t throws NotFoundException { return delegate.updatePet(pet, securityContext); } - @POST + @javax.ws.rs.POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @@ -184,7 +184,7 @@ public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be throws NotFoundException { return delegate.updatePetWithForm(petId, name, status, securityContext); } - @POST + @javax.ws.rs.POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java index 4a4f1c23080f..77d316cfab18 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java @@ -56,7 +56,7 @@ public StoreApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @DELETE + @javax.ws.rs.DELETE @Path("/order/{order_id}") @@ -69,7 +69,7 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be throws NotFoundException { return delegate.deleteOrder(orderId, securityContext); } - @GET + @javax.ws.rs.GET @Path("/inventory") @Produces({ "application/json" }) @@ -83,7 +83,7 @@ public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); } - @GET + @javax.ws.rs.GET @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @@ -97,7 +97,7 @@ public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetch throws NotFoundException { return delegate.getOrderById(orderId, securityContext); } - @POST + @javax.ws.rs.POST @Path("/order") @Consumes({ "application/json" }) @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java index a21940cf1307..9ef9cce8fa07 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java @@ -57,7 +57,7 @@ public UserApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @Consumes({ "application/json" }) @@ -69,7 +69,7 @@ public Response createUser(@ApiParam(value = "Created user object", required = t throws NotFoundException { return delegate.createUser(user, securityContext); } - @POST + @javax.ws.rs.POST @Path("/createWithArray") @Consumes({ "application/json" }) @@ -81,7 +81,7 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object throws NotFoundException { return delegate.createUsersWithArrayInput(user, securityContext); } - @POST + @javax.ws.rs.POST @Path("/createWithList") @Consumes({ "application/json" }) @@ -93,7 +93,7 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" throws NotFoundException { return delegate.createUsersWithListInput(user, securityContext); } - @DELETE + @javax.ws.rs.DELETE @Path("/{username}") @@ -106,7 +106,7 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" throws NotFoundException { return delegate.deleteUser(username, securityContext); } - @GET + @javax.ws.rs.GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) @@ -120,7 +120,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch throws NotFoundException { return delegate.getUserByName(username, securityContext); } - @GET + @javax.ws.rs.GET @Path("/login") @Produces({ "application/xml", "application/json" }) @@ -133,7 +133,7 @@ public Response loginUser(@ApiParam(value = "The user name for login", required throws NotFoundException { return delegate.loginUser(username, password, securityContext); } - @GET + @javax.ws.rs.GET @Path("/logout") @@ -145,7 +145,7 @@ public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/{username}") @Consumes({ "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml index fc64a5939d06..6cf63a1c809f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml @@ -193,7 +193,7 @@ 1.5.18 2.0.2 9.2.9.v20150224 - 2.22.2 + 2.35 2.9.9 4.13.1 1.2.10 diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java index d5f7a8c7e316..d66efe4df886 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -55,7 +55,7 @@ public AnotherFakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java index 7ac866dd64d4..6b2c8133b982 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java @@ -63,7 +63,7 @@ public FakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @Path("/create_xml_item") @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) @@ -75,7 +75,7 @@ public Response createXmlItem(@ApiParam(value = "XmlItem Body", required = true) throws NotFoundException { return delegate.createXmlItem(xmlItem, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/boolean") @Produces({ "*/*" }) @@ -87,7 +87,7 @@ public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as po throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/composite") @Produces({ "*/*" }) @@ -99,7 +99,7 @@ public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite a throws NotFoundException { return delegate.fakeOuterCompositeSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/number") @Produces({ "*/*" }) @@ -111,7 +111,7 @@ public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post throws NotFoundException { return delegate.fakeOuterNumberSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/string") @Produces({ "*/*" }) @@ -123,7 +123,7 @@ public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post throws NotFoundException { return delegate.fakeOuterStringSerialize(body, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/body-with-file-schema") @Consumes({ "application/json" }) @@ -135,7 +135,7 @@ public Response testBodyWithFileSchema(@ApiParam(value = "", required = true) @N throws NotFoundException { return delegate.testBodyWithFileSchema(body, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/body-with-query-params") @Consumes({ "application/json" }) @@ -147,7 +147,7 @@ public Response testBodyWithQueryParams(@ApiParam(value = "", required = true) @ throws NotFoundException { return delegate.testBodyWithQueryParams(query, body, securityContext); } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) @@ -159,7 +159,7 @@ public Response testClientModel(@ApiParam(value = "client model", required = tru throws NotFoundException { return delegate.testClientModel(body, securityContext); } - @POST + @javax.ws.rs.POST @Consumes({ "application/x-www-form-urlencoded" }) @@ -175,7 +175,7 @@ public Response testEndpointParameters(@ApiParam(value = "None", required=true) throws NotFoundException { return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binaryBodypart, date, dateTime, password, paramCallback, securityContext); } - @GET + @javax.ws.rs.GET @Consumes({ "application/x-www-form-urlencoded" }) @@ -188,7 +188,7 @@ public Response testEnumParameters(@ApiParam(value = "Header parameter enum test throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); } - @DELETE + @javax.ws.rs.DELETE @@ -200,7 +200,7 @@ public Response testGroupParameters(@ApiParam(value = "Required String in group throws NotFoundException { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, securityContext); } - @POST + @javax.ws.rs.POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) @@ -212,7 +212,7 @@ public Response testInlineAdditionalProperties(@ApiParam(value = "request body", throws NotFoundException { return delegate.testInlineAdditionalProperties(param, securityContext); } - @GET + @javax.ws.rs.GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) @@ -224,7 +224,7 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true) @Fo throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/test-query-parameters") diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java index 2a4bb99d9512..d208f750ed6a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -55,7 +55,7 @@ public FakeClassnameTags123Api(@Context ServletConfig servletContext) { this.delegate = delegate; } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java index 42e4d96dc71f..4a091331cc94 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java @@ -58,7 +58,7 @@ public PetApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -76,7 +76,7 @@ public Response addPet(@ApiParam(value = "Pet object that needs to be added to t throws NotFoundException { return delegate.addPet(body, securityContext); } - @DELETE + @javax.ws.rs.DELETE @Path("/pet/{petId}") @@ -94,7 +94,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete", required = true) throws NotFoundException { return delegate.deletePet(petId, apiKey, securityContext); } - @GET + @javax.ws.rs.GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @@ -112,7 +112,7 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); } - @GET + @javax.ws.rs.GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @@ -130,7 +130,7 @@ public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); } - @GET + @javax.ws.rs.GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @@ -146,7 +146,7 @@ public Response getPetById(@ApiParam(value = "ID of pet to return", required = t throws NotFoundException { return delegate.getPetById(petId, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -166,7 +166,7 @@ public Response updatePet(@ApiParam(value = "Pet object that needs to be added t throws NotFoundException { return delegate.updatePet(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @@ -183,7 +183,7 @@ public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be throws NotFoundException { return delegate.updatePetWithForm(petId, name, status, securityContext); } - @POST + @javax.ws.rs.POST @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @@ -201,7 +201,7 @@ public Response uploadFile(@ApiParam(value = "ID of pet to update", required = t throws NotFoundException { return delegate.uploadFile(petId, additionalMetadata, _fileBodypart, securityContext); } - @POST + @javax.ws.rs.POST @Path("/fake/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java index dc710ad0921e..7e7544d793fe 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java @@ -56,7 +56,7 @@ public StoreApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @DELETE + @javax.ws.rs.DELETE @Path("/order/{order_id}") @@ -69,7 +69,7 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be throws NotFoundException { return delegate.deleteOrder(orderId, securityContext); } - @GET + @javax.ws.rs.GET @Path("/inventory") @Produces({ "application/json" }) @@ -83,7 +83,7 @@ public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); } - @GET + @javax.ws.rs.GET @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @@ -97,7 +97,7 @@ public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetch throws NotFoundException { return delegate.getOrderById(orderId, securityContext); } - @POST + @javax.ws.rs.POST @Path("/order") @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java index ba9ff14767b3..4d1d6526e484 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java @@ -57,7 +57,7 @@ public UserApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @@ -69,7 +69,7 @@ public Response createUser(@ApiParam(value = "Created user object", required = t throws NotFoundException { return delegate.createUser(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/createWithArray") @@ -81,7 +81,7 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object throws NotFoundException { return delegate.createUsersWithArrayInput(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/createWithList") @@ -93,7 +93,7 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" throws NotFoundException { return delegate.createUsersWithListInput(body, securityContext); } - @DELETE + @javax.ws.rs.DELETE @Path("/{username}") @@ -106,7 +106,7 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" throws NotFoundException { return delegate.deleteUser(username, securityContext); } - @GET + @javax.ws.rs.GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) @@ -120,7 +120,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch throws NotFoundException { return delegate.getUserByName(username, securityContext); } - @GET + @javax.ws.rs.GET @Path("/login") @Produces({ "application/xml", "application/json" }) @@ -133,7 +133,7 @@ public Response loginUser(@ApiParam(value = "The user name for login", required throws NotFoundException { return delegate.loginUser(username, password, securityContext); } - @GET + @javax.ws.rs.GET @Path("/logout") @@ -145,7 +145,7 @@ public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/{username}") diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index 0f14733938c0..c90cc1e2377b 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -193,7 +193,7 @@ 1.5.18 2.0.2 9.2.9.v20150224 - 2.22.2 + 2.35 2.9.9 4.13.1 1.2.10 diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 7243aca1894f..ab81f5660277 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -55,7 +55,7 @@ public AnotherFakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java index 0a943c0e96a0..6f1e2384acd4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java @@ -64,7 +64,7 @@ public FakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @Path("/create_xml_item") @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) @@ -76,7 +76,7 @@ public Response createXmlItem(@ApiParam(value = "XmlItem Body", required = true) throws NotFoundException { return delegate.createXmlItem(xmlItem, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/boolean") @Produces({ "*/*" }) @@ -88,7 +88,7 @@ public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as po throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/composite") @Produces({ "*/*" }) @@ -100,7 +100,7 @@ public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite a throws NotFoundException { return delegate.fakeOuterCompositeSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/number") @Produces({ "*/*" }) @@ -112,7 +112,7 @@ public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post throws NotFoundException { return delegate.fakeOuterNumberSerialize(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/outer/string") @Produces({ "*/*" }) @@ -124,7 +124,7 @@ public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post throws NotFoundException { return delegate.fakeOuterStringSerialize(body, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/body-with-file-schema") @Consumes({ "application/json" }) @@ -136,7 +136,7 @@ public Response testBodyWithFileSchema(@ApiParam(value = "", required = true) @N throws NotFoundException { return delegate.testBodyWithFileSchema(body, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/body-with-query-params") @Consumes({ "application/json" }) @@ -148,7 +148,7 @@ public Response testBodyWithQueryParams(@ApiParam(value = "", required = true) @ throws NotFoundException { return delegate.testBodyWithQueryParams(query, body, securityContext); } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) @@ -160,7 +160,7 @@ public Response testClientModel(@ApiParam(value = "client model", required = tru throws NotFoundException { return delegate.testClientModel(body, securityContext); } - @POST + @javax.ws.rs.POST @Consumes({ "application/x-www-form-urlencoded" }) @@ -176,7 +176,7 @@ public Response testEndpointParameters(@ApiParam(value = "None", required=true) throws NotFoundException { return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binaryBodypart, date, dateTime, password, paramCallback, securityContext); } - @GET + @javax.ws.rs.GET @Consumes({ "application/x-www-form-urlencoded" }) @@ -189,7 +189,7 @@ public Response testEnumParameters(@ApiParam(value = "Header parameter enum test throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); } - @DELETE + @javax.ws.rs.DELETE @@ -201,7 +201,7 @@ public Response testGroupParameters(@ApiParam(value = "Required String in group throws NotFoundException { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, securityContext); } - @POST + @javax.ws.rs.POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) @@ -213,7 +213,7 @@ public Response testInlineAdditionalProperties(@ApiParam(value = "request body", throws NotFoundException { return delegate.testInlineAdditionalProperties(param, securityContext); } - @GET + @javax.ws.rs.GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) @@ -225,7 +225,7 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true) @Fo throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/test-query-parameters") @@ -237,7 +237,7 @@ public Response testQueryParameterCollectionFormat(@ApiParam(value = "", require throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); } - @POST + @javax.ws.rs.POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 73c97f612555..041ecec5af25 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -55,7 +55,7 @@ public FakeClassnameTestApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @PATCH + @javax.ws.rs.PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java index 85df879b3384..a0705de623e8 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java @@ -58,7 +58,7 @@ public PetApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @Consumes({ "application/json", "application/xml" }) @@ -76,7 +76,7 @@ public Response addPet(@ApiParam(value = "Pet object that needs to be added to t throws NotFoundException { return delegate.addPet(body, securityContext); } - @DELETE + @javax.ws.rs.DELETE @Path("/{petId}") @@ -94,7 +94,7 @@ public Response deletePet(@ApiParam(value = "Pet id to delete", required = true) throws NotFoundException { return delegate.deletePet(petId, apiKey, securityContext); } - @GET + @javax.ws.rs.GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) @@ -112,7 +112,7 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); } - @GET + @javax.ws.rs.GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) @@ -130,7 +130,7 @@ public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); } - @GET + @javax.ws.rs.GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) @@ -146,7 +146,7 @@ public Response getPetById(@ApiParam(value = "ID of pet to return", required = t throws NotFoundException { return delegate.getPetById(petId, securityContext); } - @PUT + @javax.ws.rs.PUT @Consumes({ "application/json", "application/xml" }) @@ -166,7 +166,7 @@ public Response updatePet(@ApiParam(value = "Pet object that needs to be added t throws NotFoundException { return delegate.updatePet(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @@ -183,7 +183,7 @@ public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be throws NotFoundException { return delegate.updatePetWithForm(petId, name, status, securityContext); } - @POST + @javax.ws.rs.POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java index 0a853c97eabf..e2dc45060906 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java @@ -56,7 +56,7 @@ public StoreApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @DELETE + @javax.ws.rs.DELETE @Path("/order/{order_id}") @@ -69,7 +69,7 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be throws NotFoundException { return delegate.deleteOrder(orderId, securityContext); } - @GET + @javax.ws.rs.GET @Path("/inventory") @Produces({ "application/json" }) @@ -83,7 +83,7 @@ public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); } - @GET + @javax.ws.rs.GET @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @@ -97,7 +97,7 @@ public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetch throws NotFoundException { return delegate.getOrderById(orderId, securityContext); } - @POST + @javax.ws.rs.POST @Path("/order") @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java index 083280808341..a6293f6982c4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java @@ -57,7 +57,7 @@ public UserApi(@Context ServletConfig servletContext) { this.delegate = delegate; } - @POST + @javax.ws.rs.POST @@ -69,7 +69,7 @@ public Response createUser(@ApiParam(value = "Created user object", required = t throws NotFoundException { return delegate.createUser(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/createWithArray") @@ -81,7 +81,7 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object throws NotFoundException { return delegate.createUsersWithArrayInput(body, securityContext); } - @POST + @javax.ws.rs.POST @Path("/createWithList") @@ -93,7 +93,7 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" throws NotFoundException { return delegate.createUsersWithListInput(body, securityContext); } - @DELETE + @javax.ws.rs.DELETE @Path("/{username}") @@ -106,7 +106,7 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" throws NotFoundException { return delegate.deleteUser(username, securityContext); } - @GET + @javax.ws.rs.GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) @@ -120,7 +120,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch throws NotFoundException { return delegate.getUserByName(username, securityContext); } - @GET + @javax.ws.rs.GET @Path("/login") @Produces({ "application/xml", "application/json" }) @@ -133,7 +133,7 @@ public Response loginUser(@ApiParam(value = "The user name for login", required throws NotFoundException { return delegate.loginUser(username, password, securityContext); } - @GET + @javax.ws.rs.GET @Path("/logout") @@ -145,7 +145,7 @@ public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); } - @PUT + @javax.ws.rs.PUT @Path("/{username}") From c8d0dd18f2fa8e245d894213258b20ed5cfbe445 Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Sat, 19 Feb 2022 19:16:45 -0800 Subject: [PATCH 096/111] add print-nanny.com to project list (#11667) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c73a8bb65a44..41f1d02b1fef 100644 --- a/README.md +++ b/README.md @@ -638,6 +638,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [PLAID, Inc.](https://plaid.co.jp/) - [Ponicode](https://ponicode.dev/) - [Pricefx](https://www.pricefx.com/) +- [PrintNanny](https://www.print-nanny.com/) - [Prometheus/Alertmanager](https://github.com/prometheus/alertmanager) - [Qavar](https://www.qavar.com) - [QEDIT](https://qed-it.com) From c8f075de5186fa0e4ff44dd08754329a25a9ce04 Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 20 Feb 2022 05:46:14 -0800 Subject: [PATCH 097/111] jackson 2.13.1 (#11669) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0ff88c1ac8f6..57c252647137 100644 --- a/pom.xml +++ b/pom.xml @@ -1463,7 +1463,7 @@ 30.1.1-jre 4.2.1 2.10.0 - 2.12.1 + 2.13.1 0.8.7 1.14 4.13.2 From 43617903323d6585b4b8a6c0eacd9334aee349ae Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 20 Feb 2022 05:46:34 -0800 Subject: [PATCH 098/111] [java] jaxrs swagger-core 1.6.5 (#11668) --- .../openapi-generator/src/main/resources/JavaJaxRS/pom.mustache | 2 +- samples/server/petstore/jaxrs-datelib-j8/pom.xml | 2 +- samples/server/petstore/jaxrs-jersey/pom.xml | 2 +- samples/server/petstore/jaxrs/jersey2-useTags/pom.xml | 2 +- samples/server/petstore/jaxrs/jersey2/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache index aeda388be077..18e8504ea700 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache @@ -201,7 +201,7 @@ 1.8 ${java.version} ${java.version} - 1.5.18 + 1.6.5 {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} diff --git a/samples/server/petstore/jaxrs-datelib-j8/pom.xml b/samples/server/petstore/jaxrs-datelib-j8/pom.xml index 8b0b4913adc0..8f6496bbcbee 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/pom.xml +++ b/samples/server/petstore/jaxrs-datelib-j8/pom.xml @@ -190,7 +190,7 @@ 1.8 ${java.version} ${java.version} - 1.5.18 + 1.6.5 2.0.2 9.2.9.v20150224 2.35 diff --git a/samples/server/petstore/jaxrs-jersey/pom.xml b/samples/server/petstore/jaxrs-jersey/pom.xml index 6b7e524e917d..9e64fbc56909 100644 --- a/samples/server/petstore/jaxrs-jersey/pom.xml +++ b/samples/server/petstore/jaxrs-jersey/pom.xml @@ -190,7 +190,7 @@ 1.8 ${java.version} ${java.version} - 1.5.18 + 1.6.5 2.0.2 9.2.9.v20150224 2.35 diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml index 6cf63a1c809f..e886acef72a1 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml @@ -190,7 +190,7 @@ 1.8 ${java.version} ${java.version} - 1.5.18 + 1.6.5 2.0.2 9.2.9.v20150224 2.35 diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index c90cc1e2377b..3cabc0c73202 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -190,7 +190,7 @@ 1.8 ${java.version} ${java.version} - 1.5.18 + 1.6.5 2.0.2 9.2.9.v20150224 2.35 From aec4a12caed8a083bb2fabce2b602bad02dadc6e Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 20 Feb 2022 19:02:00 -0800 Subject: [PATCH 099/111] archunit 0.23.0 (#11670) https://github.com/TNG/ArchUnit/releases/tag/v0.23.0 --- modules/openapi-generator/pom.xml | 4 ++-- pom.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index b637e18870e3..fd565603dcb3 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -320,13 +320,13 @@ com.tngtech.archunit archunit - 0.20.1 + ${archunit.version} test com.tngtech.archunit archunit-junit4 - 0.20.1 + ${archunit.version} test diff --git a/pom.xml b/pom.xml index 57c252647137..a558fddd853c 100644 --- a/pom.xml +++ b/pom.xml @@ -1451,6 +1451,7 @@ 1.8 1.8 + 0.23.0 3.1.0 1.4 2.11.0 From 636e87568d3906e9d42136bcf87e40fee405aff3 Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 20 Feb 2022 19:26:04 -0800 Subject: [PATCH 100/111] update ArchUnit rules (#11671) --- .../codegen/ArchUnitRulesTest.java | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java index fee76d588f6a..1eb57d9014f6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java @@ -4,36 +4,34 @@ import com.tngtech.archunit.core.domain.JavaModifier; import com.tngtech.archunit.core.importer.ClassFileImporter; import com.tngtech.archunit.lang.ArchRule; -import com.tngtech.archunit.library.GeneralCodingRules; import org.junit.Test; -import org.slf4j.Logger; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.*; +import static com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_ACCESS_STANDARD_STREAMS; +import static com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_USE_JAVA_UTIL_LOGGING; public class ArchUnitRulesTest { + private static final JavaClasses CLASSES = new ClassFileImporter() + .importPackages("org.openapitools.codegen.languages"); @Test public void testLoggersAreNotPublicFinalAndNotStatic() { - final JavaClasses importedClasses = new ClassFileImporter() - .importPackages("org.openapitools.codegen.languages"); - - ArchUnitRulesTest.LOGGERS_SHOULD_BE_NOT_PUBLIC_NOT_STATIC_AND_FINAL.check(importedClasses); + ArchUnitRulesTest.LOGGERS_SHOULD_BE_NOT_PUBLIC_NOT_STATIC_AND_FINAL.check(CLASSES); } @Test public void classesNotAllowedToUseStandardStreams() { - final JavaClasses importedClasses = new ClassFileImporter() - .importPackages("org.openapitools.codegen.languages"); + NO_CLASSES_SHOULD_ACCESS_STANDARD_STREAMS.check(CLASSES); + } - GeneralCodingRules.NO_CLASSES_SHOULD_ACCESS_STANDARD_STREAMS.check(importedClasses); + @Test + public void disallowJavaUtilLogging() { + NO_CLASSES_SHOULD_USE_JAVA_UTIL_LOGGING.check(CLASSES); } @Test public void abstractClassesAreAbstract() { - final JavaClasses importedClasses = new ClassFileImporter() - .importPackages("org.openapitools.codegen.languages"); - - ArchUnitRulesTest.ABSTRACT_CLASS_MUST_BE_ABSTRACT.check(importedClasses); + ArchUnitRulesTest.ABSTRACT_CLASS_MUST_BE_ABSTRACT.check(CLASSES); } /** @@ -43,7 +41,7 @@ public void abstractClassesAreAbstract() { public static final ArchRule LOGGERS_SHOULD_BE_NOT_PUBLIC_NOT_STATIC_AND_FINAL = fields() .that() - .haveRawType(Logger.class) + .haveRawType(org.slf4j.Logger.class) .should().notBePublic() .andShould().notBeStatic() .andShould().beFinal() From bdb037cce13e64d86722a448936176e68e6db6b9 Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 20 Feb 2022 22:26:59 -0800 Subject: [PATCH 101/111] kotlin 1.6.10 (#11673) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a558fddd853c..e075ff04431b 100644 --- a/pom.xml +++ b/pom.xml @@ -1468,7 +1468,7 @@ 0.8.7 1.14 4.13.2 - 1.3.60 + 1.6.10 3.10.0 3.2.0 3.1.1 From df05e6f4bc6265ba4de801ba306f75dd7278e119 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 21 Feb 2022 18:37:52 +0800 Subject: [PATCH 102/111] Update parser to 2.0.29 (#11388) * update parser to 2.0.29 * better handling of null in dereferencing * update parser to 2.0.30 * update core to newer version * add new files * rollback to previous stable version * remove files * Fixes for python-experimental NullableShape component Co-authored-by: Justin Black --- .../codegen/utils/ModelUtils.java | 8 +- ...odels-for-testing-with-http-signature.yaml | 11 +- pom.xml | 2 +- .../crystal/src/petstore/api/pet_api.cr | 10 + .../crystal/src/petstore/api/store_api.cr | 2 + .../crystal/src/petstore/api/user_api.cr | 10 + .../elixir/lib/openapi_petstore/api/fake.ex | 2 + .../elixir/lib/openapi_petstore/api/pet.ex | 6 + .../elixir/lib/openapi_petstore/api/store.ex | 1 + .../elixir/lib/openapi_petstore/api/user.ex | 5 + .../petstore/java/feign/api/openapi.yaml | 14 + .../java/okhttp-gson-nextgen/api/openapi.yaml | 2482 +++++++++++++++++ .../java/okhttp-gson-nextgen/docs/FakeApi.md | 892 ++++++ .../java/okhttp-gson-nextgen/docs/PetApi.md | 606 ++++ .../java/okhttp-gson-nextgen/docs/StoreApi.md | 250 ++ .../java/okhttp-gson-nextgen/docs/UserApi.md | 479 ++++ .../java/okhttp-gson/api/openapi.yaml | 14 + .../petstore/java/okhttp-gson/docs/FakeApi.md | 4 + .../petstore/java/okhttp-gson/docs/PetApi.md | 12 + .../java/okhttp-gson/docs/StoreApi.md | 2 + .../petstore/java/okhttp-gson/docs/UserApi.md | 10 + .../webclient-nulable-arrays/api/openapi.yaml | 4 + .../docs/DefaultApi.md | 2 + .../openapitools/client/api/DefaultApi.java | 4 +- .../petstore/java/webclient/api/openapi.yaml | 14 + .../petstore/java/webclient/docs/FakeApi.md | 4 + .../petstore/java/webclient/docs/PetApi.md | 12 + .../petstore/java/webclient/docs/StoreApi.md | 2 + .../petstore/java/webclient/docs/UserApi.md | 10 + .../petstore/javascript-es6/docs/FakeApi.md | 4 + .../petstore/javascript-es6/docs/PetApi.md | 12 + .../petstore/javascript-es6/docs/StoreApi.md | 2 + .../petstore/javascript-es6/docs/UserApi.md | 10 + .../javascript-es6/src/api/FakeApi.js | 2 + .../petstore/javascript-es6/src/api/PetApi.js | 6 + .../javascript-es6/src/api/StoreApi.js | 1 + .../javascript-es6/src/api/UserApi.js | 5 + .../javascript-promise-es6/docs/FakeApi.md | 4 + .../javascript-promise-es6/docs/PetApi.md | 12 + .../javascript-promise-es6/docs/StoreApi.md | 2 + .../javascript-promise-es6/docs/UserApi.md | 10 + .../javascript-promise-es6/src/api/FakeApi.js | 4 + .../javascript-promise-es6/src/api/PetApi.js | 12 + .../src/api/StoreApi.js | 2 + .../javascript-promise-es6/src/api/UserApi.js | 10 + .../kotlin-uppercase-enum/docs/EnumApi.md | 2 + .../petstore/objc/core-data/docs/SWGPetApi.md | 10 + .../objc/core-data/docs/SWGStoreApi.md | 2 + .../objc/core-data/docs/SWGUserApi.md | 10 + .../petstore/objc/default/docs/SWGPetApi.md | 10 + .../petstore/objc/default/docs/SWGStoreApi.md | 2 + .../petstore/objc/default/docs/SWGUserApi.md | 10 + samples/client/petstore/perl/docs/FakeApi.md | 4 + samples/client/petstore/perl/docs/PetApi.md | 12 + samples/client/petstore/perl/docs/StoreApi.md | 2 + samples/client/petstore/perl/docs/UserApi.md | 10 + .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 4 + .../php/OpenAPIClient-php/docs/Api/PetApi.md | 12 + .../OpenAPIClient-php/docs/Api/StoreApi.md | 2 + .../php/OpenAPIClient-php/docs/Api/UserApi.md | 10 + .../petstore/powershell/docs/PSPetApi.md | 10 + .../petstore/powershell/docs/PSStoreApi.md | 2 + .../petstore/powershell/docs/PSUserApi.md | 10 + .../petstore/ruby-faraday/docs/FakeApi.md | 4 + .../petstore/ruby-faraday/docs/PetApi.md | 12 + .../petstore/ruby-faraday/docs/StoreApi.md | 2 + .../petstore/ruby-faraday/docs/UserApi.md | 10 + .../ruby-faraday/lib/petstore/api/fake_api.rb | 4 + .../ruby-faraday/lib/petstore/api/pet_api.rb | 12 + .../lib/petstore/api/store_api.rb | 2 + .../ruby-faraday/lib/petstore/api/user_api.rb | 10 + samples/client/petstore/ruby/docs/FakeApi.md | 4 + samples/client/petstore/ruby/docs/PetApi.md | 12 + samples/client/petstore/ruby/docs/StoreApi.md | 2 + samples/client/petstore/ruby/docs/UserApi.md | 10 + .../ruby/lib/petstore/api/fake_api.rb | 4 + .../petstore/ruby/lib/petstore/api/pet_api.rb | 12 + .../ruby/lib/petstore/api/store_api.rb | 2 + .../ruby/lib/petstore/api/user_api.rb | 10 + .../rust/hyper/petstore/docs/PetApi.md | 10 + .../rust/hyper/petstore/docs/StoreApi.md | 2 + .../rust/hyper/petstore/docs/UserApi.md | 10 + .../reqwest/petstore-async/docs/PetApi.md | 10 + .../reqwest/petstore-async/docs/StoreApi.md | 2 + .../reqwest/petstore-async/docs/UserApi.md | 10 + .../petstore-async/src/apis/pet_api.rs | 5 + .../petstore-async/src/apis/store_api.rs | 1 + .../petstore-async/src/apis/user_api.rs | 5 + .../rust/reqwest/petstore/docs/PetApi.md | 10 + .../rust/reqwest/petstore/docs/StoreApi.md | 2 + .../rust/reqwest/petstore/docs/UserApi.md | 10 + .../rust/reqwest/petstore/src/apis/pet_api.rs | 5 + .../reqwest/petstore/src/apis/store_api.rs | 1 + .../reqwest/petstore/src/apis/user_api.rs | 5 + .../org/openapitools/client/api/PetApi.scala | 10 + .../openapitools/client/api/StoreApi.scala | 2 + .../org/openapitools/client/api/UserApi.scala | 10 + .../org/openapitools/client/api/PetApi.scala | 10 + .../openapitools/client/api/StoreApi.scala | 2 + .../org/openapitools/client/api/UserApi.scala | 10 + .../java/org/openapitools/api/PetApi.java | 5 + .../java/org/openapitools/api/StoreApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 5 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 5 + .../Classes/OpenAPIs/APIs/StoreAPI.swift | 1 + .../Classes/OpenAPIs/APIs/UserAPI.swift | 5 + .../petstore/swift5/deprecated/docs/PetAPI.md | 10 + .../swift5/deprecated/docs/StoreAPI.md | 2 + .../swift5/deprecated/docs/UserAPI.md | 10 + .../builds/default-v3.0/apis/FakeApi.ts | 4 + .../builds/default-v3.0/apis/PetApi.ts | 12 + .../builds/default-v3.0/apis/StoreApi.ts | 2 + .../builds/default-v3.0/apis/UserApi.ts | 10 + .../petstore_client_lib_fake/doc/FakeApi.md | 4 + .../petstore_client_lib_fake/doc/PetApi.md | 12 + .../petstore_client_lib_fake/doc/StoreApi.md | 2 + .../petstore_client_lib_fake/doc/UserApi.md | 10 + .../petstore_client_lib/doc/PetApi.md | 10 + .../petstore_client_lib/doc/StoreApi.md | 2 + .../petstore_client_lib/doc/UserApi.md | 10 + .../petstore_client_lib_fake/doc/FakeApi.md | 4 + .../petstore_client_lib_fake/doc/PetApi.md | 12 + .../petstore_client_lib_fake/doc/StoreApi.md | 2 + .../petstore_client_lib_fake/doc/UserApi.md | 10 + .../dart2/petstore_client_lib/doc/PetApi.md | 10 + .../dart2/petstore_client_lib/doc/StoreApi.md | 2 + .../dart2/petstore_client_lib/doc/UserApi.md | 10 + .../petstore_client_lib/lib/api/pet_api.dart | 20 + .../lib/api/store_api.dart | 4 + .../petstore_client_lib/lib/api/user_api.dart | 20 + .../petstore_client_lib_fake/doc/FakeApi.md | 4 + .../petstore_client_lib_fake/doc/PetApi.md | 12 + .../petstore_client_lib_fake/doc/StoreApi.md | 2 + .../petstore_client_lib_fake/doc/UserApi.md | 10 + .../lib/api/fake_api.dart | 8 + .../lib/api/pet_api.dart | 24 + .../lib/api/store_api.dart | 4 + .../lib/api/user_api.dart | 20 + .../petstore/go/go-petstore/api/openapi.yaml | 14 + .../petstore/go/go-petstore/api_fake.go | 8 + .../client/petstore/go/go-petstore/api_pet.go | 24 + .../petstore/go/go-petstore/api_store.go | 4 + .../petstore/go/go-petstore/api_user.go | 20 + .../petstore/go/go-petstore/docs/FakeApi.md | 4 + .../petstore/go/go-petstore/docs/PetApi.md | 12 + .../petstore/go/go-petstore/docs/StoreApi.md | 2 + .../petstore/go/go-petstore/docs/UserApi.md | 10 + .../java/jersey2-java8/api/openapi.yaml | 14 + .../java/jersey2-java8/docs/FakeApi.md | 4 + .../java/jersey2-java8/docs/PetApi.md | 12 + .../java/jersey2-java8/docs/StoreApi.md | 2 + .../java/jersey2-java8/docs/UserApi.md | 10 + .../python-experimental/docs/NullableShape.md | 2 +- .../petstore_api/model/nullable_shape.py | 12 +- .../petstore/python-legacy/docs/FakeApi.md | 4 + .../petstore/python-legacy/docs/PetApi.md | 12 + .../petstore/python-legacy/docs/StoreApi.md | 2 + .../petstore/python-legacy/docs/UserApi.md | 10 + .../petstore_api/api/fake_api.py | 4 + .../python-legacy/petstore_api/api/pet_api.py | 12 + .../petstore_api/api/store_api.py | 2 + .../petstore_api/api/user_api.py | 10 + .../client/petstore/python/docs/FakeApi.md | 10 + .../petstore/python/docs/InlineResponse200.md | 13 + .../client/petstore/python/docs/PetApi.md | 8 + .../client/petstore/python/docs/StoreApi.md | 2 + .../client/petstore/python/docs/UserApi.md | 10 + .../python/petstore_api/api/fake_api.py | 5 + .../python/petstore_api/api/pet_api.py | 4 + .../python/petstore_api/api/store_api.py | 1 + .../python/petstore_api/api/user_api.py | 5 + .../java/org/openapitools/api/PetApi.java | 5 + .../java/org/openapitools/api/StoreApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 5 + .../typescript/builds/default/PetApi.md | 5 + .../typescript/builds/default/StoreApi.md | 1 + .../typescript/builds/default/UserApi.md | 5 + .../typescript/builds/default/apis/PetApi.ts | 5 + .../builds/default/apis/StoreApi.ts | 1 + .../typescript/builds/default/apis/UserApi.ts | 5 + .../builds/default/types/ObjectParamAPI.ts | 11 + .../builds/default/types/ObservableAPI.ts | 11 + .../builds/default/types/PromiseAPI.ts | 11 + .../petstore/typescript/builds/deno/PetApi.md | 5 + .../typescript/builds/deno/StoreApi.md | 1 + .../typescript/builds/deno/UserApi.md | 5 + .../typescript/builds/deno/apis/PetApi.ts | 5 + .../typescript/builds/deno/apis/StoreApi.ts | 1 + .../typescript/builds/deno/apis/UserApi.ts | 5 + .../builds/deno/types/ObjectParamAPI.ts | 11 + .../builds/deno/types/ObservableAPI.ts | 11 + .../builds/deno/types/PromiseAPI.ts | 11 + .../typescript/builds/inversify/PetApi.md | 5 + .../typescript/builds/inversify/StoreApi.md | 1 + .../typescript/builds/inversify/UserApi.md | 5 + .../builds/inversify/apis/PetApi.ts | 5 + .../builds/inversify/apis/StoreApi.ts | 1 + .../builds/inversify/apis/UserApi.ts | 5 + .../inversify/services/ObjectParamAPI.ts | 11 + .../builds/inversify/types/ObjectParamAPI.ts | 11 + .../builds/inversify/types/ObservableAPI.ts | 11 + .../builds/inversify/types/PromiseAPI.ts | 11 + .../typescript/builds/jquery/PetApi.md | 5 + .../typescript/builds/jquery/StoreApi.md | 1 + .../typescript/builds/jquery/UserApi.md | 5 + .../typescript/builds/jquery/apis/PetApi.ts | 5 + .../typescript/builds/jquery/apis/StoreApi.ts | 1 + .../typescript/builds/jquery/apis/UserApi.ts | 5 + .../builds/jquery/types/ObjectParamAPI.ts | 11 + .../builds/jquery/types/ObservableAPI.ts | 11 + .../builds/jquery/types/PromiseAPI.ts | 11 + .../typescript/builds/object_params/PetApi.md | 5 + .../builds/object_params/StoreApi.md | 1 + .../builds/object_params/UserApi.md | 5 + .../builds/object_params/apis/PetApi.ts | 5 + .../builds/object_params/apis/StoreApi.ts | 1 + .../builds/object_params/apis/UserApi.ts | 5 + .../object_params/types/ObjectParamAPI.ts | 11 + .../object_params/types/ObservableAPI.ts | 11 + .../builds/object_params/types/PromiseAPI.ts | 11 + .../java/org/openapitools/api/PetApi.java | 5 + .../java/org/openapitools/api/StoreApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 5 + .../src/main/resources/openapi.yaml | 11 + .../java/org/openapitools/api/PetApi.java | 5 + .../java/org/openapitools/api/StoreApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 5 + .../src/main/resources/openapi.yaml | 11 + .../java/org/openapitools/api/PetApi.java | 5 + .../java/org/openapitools/api/StoreApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 5 + .../src/main/resources/openapi.yaml | 11 + .../wwwroot/openapi-original.json | 11 + .../wwwroot/openapi-original.json | 11 + .../petstore/erlang-server/priv/openapi.json | 11 + .../petstore/go-api-server/api/openapi.yaml | 11 + .../petstore/go-chi-server/api/openapi.yaml | 11 + .../go-echo-server/.docs/api/openapi.yaml | 11 + .../go-gin-api-server/api/openapi.yaml | 11 + .../go-server-required/api/openapi.yaml | 11 + .../petstore/haskell-yesod/src/Handler/Pet.hs | 5 + .../haskell-yesod/src/Handler/Store.hs | 1 + .../haskell-yesod/src/Handler/User.hs | 5 + .../docs/controllers/PetController.md | 10 + .../docs/controllers/StoreController.md | 2 + .../docs/controllers/UserController.md | 10 + .../controller/PetController.java | 10 + .../controller/StoreController.java | 2 + .../controller/UserController.java | 10 + .../src/main/resources/openapi.yaml | 11 + .../php-slim4/lib/Api/AbstractPetApi.php | 5 + .../php-slim4/lib/Api/AbstractStoreApi.php | 1 + .../php-slim4/lib/Api/AbstractUserApi.php | 5 + .../Resources/docs/Api/PetApiInterface.md | 10 + .../Resources/docs/Api/StoreApiInterface.md | 2 + .../Resources/docs/Api/UserApiInterface.md | 10 + .../petstore/python-fastapi/openapi.yaml | 11 + .../src/openapi_server/apis/pet_api.py | 5 + .../src/openapi_server/apis/store_api.py | 1 + .../src/openapi_server/apis/user_api.py | 5 + .../output/openapi-v3/api/openapi.yaml | 2 +- .../output/openapi-v3/docs/NullableTest.md | 2 +- .../output/openapi-v3/docs/default_api.md | 2 + .../output/openapi-v3/src/models.rs | 2 +- 264 files changed, 6461 insertions(+), 27 deletions(-) create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/python/docs/InlineResponse200.md diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index b5e10d5c4b60..eb5d5c6a2fe0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -381,7 +381,11 @@ private static interface OpenAPISchemaVisitor { } public static String getSimpleRef(String ref) { - if (ref.startsWith("#/components/")) { + if (ref == null) { + once(LOGGER).warn("Failed to get the schema name: null"); + //throw new RuntimeException("Failed to get the schema: null"); + return null; + } else if (ref.startsWith("#/components/")) { ref = ref.substring(ref.lastIndexOf("/") + 1); } else if (ref.startsWith("#/definitions/")) { ref = ref.substring(ref.lastIndexOf("/") + 1); @@ -389,12 +393,12 @@ public static String getSimpleRef(String ref) { once(LOGGER).warn("Failed to get the schema name: {}", ref); //throw new RuntimeException("Failed to get the schema: " + ref); return null; - } try { ref = URLDecoder.decode(ref, "UTF-8"); } catch (UnsupportedEncodingException ignored) { + once(LOGGER).warn("Found UnsupportedEncodingException: {}", ref); } // see https://tools.ietf.org/html/rfc6901#section-3 diff --git a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 5db730b756a1..16a4d04a1345 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -2488,16 +2488,13 @@ components: propertyName: shapeType NullableShape: description: The value may be a shape or the 'null' value. - The 'nullable' attribute was introduced in OAS schema >= 3.0 - and has been deprecated in OAS schema >= 3.1. - For a nullable composed schema to work, one of its chosen oneOf schemas must be type null + For a composed schema to validate a null payload, + one of its chosen oneOf schemas must be type null + or nullable (introduced in OAS schema >= 3.0) oneOf: - $ref: '#/components/schemas/Triangle' - $ref: '#/components/schemas/Quadrilateral' - - type: null - discriminator: - propertyName: shapeType - nullable: true + - type: "null" TriangleInterface: properties: shapeType: diff --git a/pom.xml b/pom.xml index e075ff04431b..b9cd286012c0 100644 --- a/pom.xml +++ b/pom.xml @@ -1485,7 +1485,7 @@ 3.0.0-M5 2.1.12 io.swagger.parser.v3 - 2.0.26 + 2.0.29 7.3.0 1.34 3.4.3 diff --git a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr index 3fcdb29d46e3..f267598f10f9 100644 --- a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr @@ -18,6 +18,7 @@ module Petstore @api_client = api_client end # Add a new pet to the store + # # @param pet [Pet] Pet object that needs to be added to the store # @return [Pet] def add_pet(pet : Pet) @@ -26,6 +27,7 @@ module Petstore end # Add a new pet to the store + # # @param pet [Pet] Pet object that needs to be added to the store # @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers def add_pet_with_http_info(pet : Pet) @@ -77,6 +79,7 @@ module Petstore end # Deletes a pet + # # @param pet_id [Int64] Pet id to delete # @return [nil] def delete_pet(pet_id : Int64, api_key : String?) @@ -85,6 +88,7 @@ module Petstore end # Deletes a pet + # # @param pet_id [Int64] Pet id to delete # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_pet_with_http_info(pet_id : Int64, api_key : String?) @@ -312,6 +316,7 @@ module Petstore end # Update an existing pet + # # @param pet [Pet] Pet object that needs to be added to the store # @return [Pet] def update_pet(pet : Pet) @@ -320,6 +325,7 @@ module Petstore end # Update an existing pet + # # @param pet [Pet] Pet object that needs to be added to the store # @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers def update_pet_with_http_info(pet : Pet) @@ -371,6 +377,7 @@ module Petstore end # Updates a pet in the store with form data + # # @param pet_id [Int64] ID of pet that needs to be updated # @return [nil] def update_pet_with_form(pet_id : Int64, name : String?, status : String?) @@ -379,6 +386,7 @@ module Petstore end # Updates a pet in the store with form data + # # @param pet_id [Int64] ID of pet that needs to be updated # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_pet_with_form_with_http_info(pet_id : Int64, name : String?, status : String?) @@ -430,6 +438,7 @@ module Petstore end # uploads an image + # # @param pet_id [Int64] ID of pet to update # @return [ApiResponse] def upload_file(pet_id : Int64, additional_metadata : String?, file : ::File?) @@ -438,6 +447,7 @@ module Petstore end # uploads an image + # # @param pet_id [Int64] ID of pet to update # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers def upload_file_with_http_info(pet_id : Int64, additional_metadata : String?, file : ::File?) diff --git a/samples/client/petstore/crystal/src/petstore/api/store_api.cr b/samples/client/petstore/crystal/src/petstore/api/store_api.cr index 55f05dee2c41..e153255e4d5b 100644 --- a/samples/client/petstore/crystal/src/petstore/api/store_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/store_api.cr @@ -195,6 +195,7 @@ module Petstore end # Place an order for a pet + # # @param order [Order] order placed for purchasing the pet # @return [Order] def place_order(order : Order) @@ -203,6 +204,7 @@ module Petstore end # Place an order for a pet + # # @param order [Order] order placed for purchasing the pet # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers def place_order_with_http_info(order : Order) diff --git a/samples/client/petstore/crystal/src/petstore/api/user_api.cr b/samples/client/petstore/crystal/src/petstore/api/user_api.cr index a346feba7d99..d92b4b061ecf 100644 --- a/samples/client/petstore/crystal/src/petstore/api/user_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/user_api.cr @@ -77,6 +77,7 @@ module Petstore end # Creates list of users with given input array + # # @param user [Array(User)] List of user object # @return [nil] def create_users_with_array_input(user : Array(User)) @@ -85,6 +86,7 @@ module Petstore end # Creates list of users with given input array + # # @param user [Array(User)] List of user object # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def create_users_with_array_input_with_http_info(user : Array(User)) @@ -134,6 +136,7 @@ module Petstore end # Creates list of users with given input array + # # @param user [Array(User)] List of user object # @return [nil] def create_users_with_list_input(user : Array(User)) @@ -142,6 +145,7 @@ module Petstore end # Creates list of users with given input array + # # @param user [Array(User)] List of user object # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def create_users_with_list_input_with_http_info(user : Array(User)) @@ -248,6 +252,7 @@ module Petstore end # Get user by user name + # # @param username [String] The name that needs to be fetched. Use user1 for testing. # @return [User] def get_user_by_name(username : String) @@ -256,6 +261,7 @@ module Petstore end # Get user by user name + # # @param username [String] The name that needs to be fetched. Use user1 for testing. # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers def get_user_by_name_with_http_info(username : String) @@ -305,6 +311,7 @@ module Petstore end # Logs user into the system + # # @param username [String] The user name for login # @param password [String] The password for login in clear text # @return [String] @@ -314,6 +321,7 @@ module Petstore end # Logs user into the system + # # @param username [String] The user name for login # @param password [String] The password for login in clear text # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers @@ -375,6 +383,7 @@ module Petstore end # Logs out current logged in user session + # # @return [nil] def logout_user() logout_user_with_http_info() @@ -382,6 +391,7 @@ module Petstore end # Logs out current logged in user session + # # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def logout_user_with_http_info() if @api_client.config.debugging diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index 8962b3b94392..c0e3c984c356 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -464,6 +464,7 @@ defmodule OpenapiPetstore.Api.Fake do @doc """ test inline additionalProperties + ## Parameters @@ -490,6 +491,7 @@ defmodule OpenapiPetstore.Api.Fake do @doc """ test json serialization of form data + ## Parameters diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex index 4ba4b9dac962..37c96f322f6f 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex @@ -13,6 +13,7 @@ defmodule OpenapiPetstore.Api.Pet do @doc """ Add a new pet to the store + ## Parameters @@ -40,6 +41,7 @@ defmodule OpenapiPetstore.Api.Pet do @doc """ Deletes a pet + ## Parameters @@ -155,6 +157,7 @@ defmodule OpenapiPetstore.Api.Pet do @doc """ Update an existing pet + ## Parameters @@ -184,6 +187,7 @@ defmodule OpenapiPetstore.Api.Pet do @doc """ Updates a pet in the store with form data + ## Parameters @@ -218,6 +222,7 @@ defmodule OpenapiPetstore.Api.Pet do @doc """ uploads an image + ## Parameters @@ -251,6 +256,7 @@ defmodule OpenapiPetstore.Api.Pet do @doc """ uploads an image (required) + ## Parameters diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/store.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/store.ex index fe2d5df50370..8487ba44ca22 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/store.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/store.ex @@ -93,6 +93,7 @@ defmodule OpenapiPetstore.Api.Store do @doc """ Place an order for a pet + ## Parameters diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex index bd6c3bc347dd..2fd22f27e646 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex @@ -40,6 +40,7 @@ defmodule OpenapiPetstore.Api.User do @doc """ Creates list of users with given input array + ## Parameters @@ -66,6 +67,7 @@ defmodule OpenapiPetstore.Api.User do @doc """ Creates list of users with given input array + ## Parameters @@ -119,6 +121,7 @@ defmodule OpenapiPetstore.Api.User do @doc """ Get user by user name + ## Parameters @@ -146,6 +149,7 @@ defmodule OpenapiPetstore.Api.User do @doc """ Logs user into the system + ## Parameters @@ -175,6 +179,7 @@ defmodule OpenapiPetstore.Api.User do @doc """ Logs out current logged in user session + ## Parameters diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index 68e67d34c777..177bc923ce04 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -53,6 +53,7 @@ paths: x-accepts: application/json /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -71,6 +72,7 @@ paths: x-contentType: application/json x-accepts: application/json put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -186,6 +188,7 @@ paths: x-accepts: application/json /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -251,6 +254,7 @@ paths: - pet x-accepts: application/json post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -291,6 +295,7 @@ paths: x-accepts: application/json /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -354,6 +359,7 @@ paths: x-accepts: application/json /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -457,6 +463,7 @@ paths: x-accepts: application/json /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -470,6 +477,7 @@ paths: x-accepts: application/json /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -483,6 +491,7 @@ paths: x-accepts: application/json /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -534,6 +543,7 @@ paths: x-accepts: application/json /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -565,6 +575,7 @@ paths: - user x-accepts: application/json get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. @@ -1047,6 +1058,7 @@ paths: x-accepts: '*/*' /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: $ref: '#/components/requestBodies/inline_object_4' @@ -1074,6 +1086,7 @@ paths: x-accepts: application/json /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1248,6 +1261,7 @@ paths: x-accepts: application/json /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml new file mode 100644 index 000000000000..89bd50c75a63 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml @@ -0,0 +1,2482 @@ +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: + " \' + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: http://{server}.swagger.io:{port}/v2 + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: https://localhost:8080/{version} + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_default' + description: response + x-accepts: application/json + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-contentType: application/json + x-accepts: application/json + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-contentType: application/json + x-accepts: application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object' + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_1' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-contentType: application/json + x-accepts: application/json + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-contentType: application/json + x-accepts: application/json + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: application/json + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-contentType: application/json + x-accepts: application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-contentType: application/json + x-accepts: application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Someting wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + $ref: '#/components/requestBodies/inline_object_2' + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-contentType: application/json + x-accepts: application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + $ref: '#/components/requestBodies/inline_object_3' + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + $ref: '#/components/requestBodies/inline_object_4' + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-contentType: application/json + x-accepts: application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-contentType: application/json + x-accepts: application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-contentType: application/json + x-accepts: application/json + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_5' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: application/json + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + x-accepts: application/json +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + 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 + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' + inline_object_2: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_2' + inline_object_3: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_3' + inline_object_4: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_4' + inline_object_5: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_5' + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: '{}' + phone: phone + objectWithNoDeclaredProps: '{}' + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: test code generation for any type Here the 'type' attribute + is not specified, which means the value can be anything, including the + null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + anyTypePropNullable: + description: test code generation for any type Here the 'type' attribute + is not specified, which means the value can be anything, including the + null value, string, number, boolean, array or object. The 'nullable' attribute + does not change the allowed values. + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + 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' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: ^\d{10}$ + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: /^image_\d{1,3}$/i + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: an object with no declared properties and no undeclared properties, + hence it's an empty map. + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + 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 + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + File: + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: $special[model.name] + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: ^[a-zA-Z\s]*$ + type: string + origin: + pattern: /^[A-Z\s]*$/i + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PetWithRequiredTags: + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + - tags + type: object + xml: + name: Pet + inline_response_default: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + inline_object_2: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + inline_object_3: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + inline_object_4: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + inline_object_5: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md new file mode 100644 index 000000000000..247cd5006318 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md @@ -0,0 +1,892 @@ +# FakeApi + +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 +[**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 | +[**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums +[**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 +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### 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 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Boolean**| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### 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**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output composite | - | + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **BigDecimal**| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output number | - | + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### 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**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output string | - | + + +# **getArrayOfEnums** +> List<OuterEnum> getArrayOfEnums() + +Array of Enums + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + List result = apiInstance.getArrayOfEnums(); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Got named array of enums | - | + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + apiInstance.testBodyWithQueryParams(query, user); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **testEndpointParameters** +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = LocalDate.now(); // LocalDate | None + OffsetDateTime dateTime = OffsetDateTime.parse("OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))"); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **BigDecimal**| None | + **_double** | **Double**| None | + **patternWithoutDelimiter** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **File**| None | [optional] + **date** | **LocalDate**| None | [optional] + **dateTime** | **OffsetDateTime**| None | [optional] [default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))] + **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] + +### Return type + +null (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 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid request | - | +**404** | Not found | - | + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute(); + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **Integer**| Required String in group parameters | + **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **Long**| Required Integer in group parameters | + **stringGroup** | **Integer**| String in group parameters | [optional] + **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] + **int64Group** | **Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Someting wrong | - | + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testInlineAdditionalProperties(requestBody); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map<String, String>**](String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + apiInstance.testJsonFormData(param, param2); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + + } + } +} +``` + +### 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)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md new file mode 100644 index 000000000000..e5837bc9a2e7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md @@ -0,0 +1,606 @@ +# PetApi + +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 +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.addPet(pet); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid pet value | - | + + +# **findPetsByStatus** +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid status value | - | + + +# **findPetsByTags** +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List tags = Arrays.asList(); // List | Tags to filter by + try { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid tag value | - | + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| 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 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | + + +# **updatePet** +> updatePet(pet) + +Update an existing pet + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.updatePet(pet); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | +**405** | Validation exception | - | + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + apiInstance.updatePetWithForm(petId, name, status); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| 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 + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File _file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **_file** | **File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **uploadFileWithRequiredFile** +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **requiredFile** | **File**| file to upload | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md new file mode 100644 index 000000000000..6ec8b1b3c74e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md @@ -0,0 +1,250 @@ +# StoreApi + +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 +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + + +# **getInventory** +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Long**| 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 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### 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 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid Order | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md new file mode 100644 index 000000000000..d56fb3641112 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md @@ -0,0 +1,479 @@ +# UserApi + +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 +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + apiInstance.createUser(user); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(user); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(user); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### 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 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid username supplied | - | +**404** | User not found | - | + + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + + } + } +} +``` + +### 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 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +**400** | Invalid username/password supplied | - | + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + apiInstance.updateUser(username, user); + } catch (ApiException e) { + + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid user supplied | - | +**404** | User not found | - | + diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index eec4c835d323..80e1a7404d4a 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -53,6 +53,7 @@ paths: x-accepts: application/json /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -70,6 +71,7 @@ paths: x-contentType: application/json x-accepts: application/json put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -183,6 +185,7 @@ paths: x-accepts: application/json /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -246,6 +249,7 @@ paths: - pet x-accepts: application/json post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -284,6 +288,7 @@ paths: x-accepts: application/json /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -347,6 +352,7 @@ paths: x-accepts: application/json /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -450,6 +456,7 @@ paths: x-accepts: application/json /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -463,6 +470,7 @@ paths: x-accepts: application/json /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -476,6 +484,7 @@ paths: x-accepts: application/json /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -527,6 +536,7 @@ paths: x-accepts: application/json /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -558,6 +568,7 @@ paths: - user x-accepts: application/json get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. @@ -1020,6 +1031,7 @@ paths: x-accepts: '*/*' /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: $ref: '#/components/requestBodies/inline_object_4' @@ -1047,6 +1059,7 @@ paths: x-accepts: application/json /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1183,6 +1196,7 @@ paths: x-accepts: application/json /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index fb4949cca705..e3ccb560a936 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -821,6 +821,8 @@ null (empty response body) test inline additionalProperties + + ### Example ```java // Import classes: @@ -880,6 +882,8 @@ No authorization required test json serialization of form data + + ### Example ```java // Import classes: diff --git a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md index c71036f88afa..cd1dfc640f82 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md @@ -21,6 +21,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```java // Import classes: @@ -86,6 +88,8 @@ null (empty response body) Deletes a pet + + ### Example ```java // Import classes: @@ -361,6 +365,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```java // Import classes: @@ -428,6 +434,8 @@ null (empty response body) Updates a pet in the store with form data + + ### Example ```java // Import classes: @@ -496,6 +504,8 @@ null (empty response body) uploads an image + + ### Example ```java // Import classes: @@ -565,6 +575,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```java // Import classes: diff --git a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md index 270388f5e444..8fbf6a813c87 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md @@ -207,6 +207,8 @@ No authorization required Place an order for a pet + + ### Example ```java // Import classes: diff --git a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md index 26a0642e3235..f5852fc0478e 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md @@ -81,6 +81,8 @@ No authorization required Creates list of users with given input array + + ### Example ```java // Import classes: @@ -140,6 +142,8 @@ No authorization required Creates list of users with given input array + + ### Example ```java // Import classes: @@ -261,6 +265,8 @@ No authorization required Get user by user name + + ### Example ```java // Import classes: @@ -323,6 +329,8 @@ No authorization required Logs user into the system + + ### Example ```java // Import classes: @@ -386,6 +394,8 @@ No authorization required Logs out current logged in user session + + ### Example ```java // Import classes: diff --git a/samples/client/petstore/java/webclient-nulable-arrays/api/openapi.yaml b/samples/client/petstore/java/webclient-nulable-arrays/api/openapi.yaml index 2619b4576899..d2cd49b32377 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-nulable-arrays/api/openapi.yaml @@ -8,6 +8,8 @@ servers: paths: /nullable-array-test: get: + description: "" + operationId: "" parameters: [] responses: "200": @@ -17,6 +19,8 @@ paths: items: $ref: '#/components/schemas/ByteArrayObject' type: array + description: "" + summary: "" x-accepts: application/json components: schemas: diff --git a/samples/client/petstore/java/webclient-nulable-arrays/docs/DefaultApi.md b/samples/client/petstore/java/webclient-nulable-arrays/docs/DefaultApi.md index 6b52ac1cfc99..5b7929abf3e3 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/docs/DefaultApi.md +++ b/samples/client/petstore/java/webclient-nulable-arrays/docs/DefaultApi.md @@ -14,6 +14,8 @@ Method | HTTP request | Description + + ### Example ```java diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java index 9fd56d41cf3e..27aa8f5a5101 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -49,7 +49,7 @@ public void setApiClient(ApiClient apiClient) { /** * * - *

    200 + *

    200 - * @return List<ByteArrayObject> * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ @@ -79,7 +79,7 @@ private ResponseSpec nullableArrayTestGetRequestCreation() throws WebClientRespo /** * * - *

    200 + *

    200 - * @return List<ByteArrayObject> * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index 68e67d34c777..177bc923ce04 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -53,6 +53,7 @@ paths: x-accepts: application/json /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -71,6 +72,7 @@ paths: x-contentType: application/json x-accepts: application/json put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -186,6 +188,7 @@ paths: x-accepts: application/json /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -251,6 +254,7 @@ paths: - pet x-accepts: application/json post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -291,6 +295,7 @@ paths: x-accepts: application/json /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -354,6 +359,7 @@ paths: x-accepts: application/json /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -457,6 +463,7 @@ paths: x-accepts: application/json /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -470,6 +477,7 @@ paths: x-accepts: application/json /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -483,6 +491,7 @@ paths: x-accepts: application/json /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -534,6 +543,7 @@ paths: x-accepts: application/json /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -565,6 +575,7 @@ paths: - user x-accepts: application/json get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. @@ -1047,6 +1058,7 @@ paths: x-accepts: '*/*' /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: $ref: '#/components/requestBodies/inline_object_4' @@ -1074,6 +1086,7 @@ paths: x-accepts: application/json /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1248,6 +1261,7 @@ paths: x-accepts: application/json /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index 3a9198107b9e..aa6e8c425ce9 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -1008,6 +1008,8 @@ null (empty response body) test inline additionalProperties + + ### Example ```java @@ -1071,6 +1073,8 @@ No authorization required test json serialization of form data + + ### Example ```java diff --git a/samples/client/petstore/java/webclient/docs/PetApi.md b/samples/client/petstore/java/webclient/docs/PetApi.md index 513a97c6829d..e8ea9f843bd9 100644 --- a/samples/client/petstore/java/webclient/docs/PetApi.md +++ b/samples/client/petstore/java/webclient/docs/PetApi.md @@ -22,6 +22,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```java @@ -91,6 +93,8 @@ null (empty response body) Deletes a pet + + ### Example ```java @@ -381,6 +385,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```java @@ -452,6 +458,8 @@ null (empty response body) Updates a pet in the store with form data + + ### Example ```java @@ -525,6 +533,8 @@ null (empty response body) uploads an image + + ### Example ```java @@ -598,6 +608,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```java diff --git a/samples/client/petstore/java/webclient/docs/StoreApi.md b/samples/client/petstore/java/webclient/docs/StoreApi.md index f25919a6aa11..b00ac45b00b2 100644 --- a/samples/client/petstore/java/webclient/docs/StoreApi.md +++ b/samples/client/petstore/java/webclient/docs/StoreApi.md @@ -220,6 +220,8 @@ No authorization required Place an order for a pet + + ### Example ```java diff --git a/samples/client/petstore/java/webclient/docs/UserApi.md b/samples/client/petstore/java/webclient/docs/UserApi.md index baff54c82f9f..f0660e264409 100644 --- a/samples/client/petstore/java/webclient/docs/UserApi.md +++ b/samples/client/petstore/java/webclient/docs/UserApi.md @@ -86,6 +86,8 @@ No authorization required Creates list of users with given input array + + ### Example ```java @@ -149,6 +151,8 @@ No authorization required Creates list of users with given input array + + ### Example ```java @@ -278,6 +282,8 @@ No authorization required Get user by user name + + ### Example ```java @@ -344,6 +350,8 @@ No authorization required Logs user into the system + + ### Example ```java @@ -411,6 +419,8 @@ No authorization required Logs out current logged in user session + + ### Example ```java diff --git a/samples/client/petstore/javascript-es6/docs/FakeApi.md b/samples/client/petstore/javascript-es6/docs/FakeApi.md index 9e35bf405c8a..f26857107f47 100644 --- a/samples/client/petstore/javascript-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-es6/docs/FakeApi.md @@ -732,6 +732,8 @@ null (empty response body) test inline additionalProperties + + ### Example ```javascript @@ -775,6 +777,8 @@ No authorization required test json serialization of form data + + ### Example ```javascript diff --git a/samples/client/petstore/javascript-es6/docs/PetApi.md b/samples/client/petstore/javascript-es6/docs/PetApi.md index 44734fbe72d3..cce0be79c8c8 100644 --- a/samples/client/petstore/javascript-es6/docs/PetApi.md +++ b/samples/client/petstore/javascript-es6/docs/PetApi.md @@ -22,6 +22,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```javascript @@ -69,6 +71,8 @@ null (empty response body) Deletes a pet + + ### Example ```javascript @@ -269,6 +273,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```javascript @@ -316,6 +322,8 @@ null (empty response body) Updates a pet in the store with form data + + ### Example ```javascript @@ -369,6 +377,8 @@ null (empty response body) uploads an image + + ### Example ```javascript @@ -422,6 +432,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```javascript diff --git a/samples/client/petstore/javascript-es6/docs/StoreApi.md b/samples/client/petstore/javascript-es6/docs/StoreApi.md index 0f29ae4629fa..b7abc576af49 100644 --- a/samples/client/petstore/javascript-es6/docs/StoreApi.md +++ b/samples/client/petstore/javascript-es6/docs/StoreApi.md @@ -154,6 +154,8 @@ No authorization required Place an order for a pet + + ### Example ```javascript diff --git a/samples/client/petstore/javascript-es6/docs/UserApi.md b/samples/client/petstore/javascript-es6/docs/UserApi.md index c45620854176..d3631acbfba9 100644 --- a/samples/client/petstore/javascript-es6/docs/UserApi.md +++ b/samples/client/petstore/javascript-es6/docs/UserApi.md @@ -66,6 +66,8 @@ No authorization required Creates list of users with given input array + + ### Example ```javascript @@ -109,6 +111,8 @@ No authorization required Creates list of users with given input array + + ### Example ```javascript @@ -197,6 +201,8 @@ No authorization required Get user by user name + + ### Example ```javascript @@ -240,6 +246,8 @@ No authorization required Logs user into the system + + ### Example ```javascript @@ -285,6 +293,8 @@ No authorization required Logs out current logged in user session + + ### Example ```javascript diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index 521fa3347d0d..734e1e3a3db3 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -694,6 +694,7 @@ export default class FakeApi { /** * test inline additionalProperties + * * @param {Object.} requestBody request body * @param {module:api/FakeApi~testInlineAdditionalPropertiesCallback} callback The callback function, accepting three arguments: error, data, response */ @@ -734,6 +735,7 @@ export default class FakeApi { /** * test json serialization of form data + * * @param {String} param field1 * @param {String} param2 field2 * @param {module:api/FakeApi~testJsonFormDataCallback} callback The callback function, accepting three arguments: error, data, response diff --git a/samples/client/petstore/javascript-es6/src/api/PetApi.js b/samples/client/petstore/javascript-es6/src/api/PetApi.js index 0f23c0690101..6aba5f184db0 100644 --- a/samples/client/petstore/javascript-es6/src/api/PetApi.js +++ b/samples/client/petstore/javascript-es6/src/api/PetApi.js @@ -45,6 +45,7 @@ export default class PetApi { /** * Add a new pet to the store + * * @param {module:model/Pet} pet Pet object that needs to be added to the store * @param {module:api/PetApi~addPetCallback} callback The callback function, accepting three arguments: error, data, response */ @@ -95,6 +96,7 @@ export default class PetApi { /** * Deletes a pet + * * @param {Number} petId Pet id to delete * @param {Object} opts Optional parameters * @param {String} opts.apiKey @@ -269,6 +271,7 @@ export default class PetApi { /** * Update an existing pet + * * @param {module:model/Pet} pet Pet object that needs to be added to the store * @param {module:api/PetApi~updatePetCallback} callback The callback function, accepting three arguments: error, data, response */ @@ -319,6 +322,7 @@ export default class PetApi { /** * Updates a pet in the store with form data + * * @param {Number} petId ID of pet that needs to be updated * @param {Object} opts Optional parameters * @param {String} opts.name Updated name of the pet @@ -366,6 +370,7 @@ export default class PetApi { /** * uploads an image + * * @param {Number} petId ID of pet to update * @param {Object} opts Optional parameters * @param {String} opts.additionalMetadata Additional data to pass to server @@ -414,6 +419,7 @@ export default class PetApi { /** * uploads an image (required) + * * @param {Number} petId ID of pet to update * @param {File} requiredFile file to upload * @param {Object} opts Optional parameters diff --git a/samples/client/petstore/javascript-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-es6/src/api/StoreApi.js index 74ad1afd3efa..ae1d1ea977d4 100644 --- a/samples/client/petstore/javascript-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-es6/src/api/StoreApi.js @@ -166,6 +166,7 @@ export default class StoreApi { /** * Place an order for a pet + * * @param {module:model/Order} order order placed for purchasing the pet * @param {module:api/StoreApi~placeOrderCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Order} diff --git a/samples/client/petstore/javascript-es6/src/api/UserApi.js b/samples/client/petstore/javascript-es6/src/api/UserApi.js index 83720dd3a1dd..a05d10ae2382 100644 --- a/samples/client/petstore/javascript-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-es6/src/api/UserApi.js @@ -85,6 +85,7 @@ export default class UserApi { /** * Creates list of users with given input array + * * @param {Array.} user List of user object * @param {module:api/UserApi~createUsersWithArrayInputCallback} callback The callback function, accepting three arguments: error, data, response */ @@ -125,6 +126,7 @@ export default class UserApi { /** * Creates list of users with given input array + * * @param {Array.} user List of user object * @param {module:api/UserApi~createUsersWithListInputCallback} callback The callback function, accepting three arguments: error, data, response */ @@ -207,6 +209,7 @@ export default class UserApi { /** * Get user by user name + * * @param {String} username The name that needs to be fetched. Use user1 for testing. * @param {module:api/UserApi~getUserByNameCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/User} @@ -249,6 +252,7 @@ export default class UserApi { /** * Logs user into the system + * * @param {String} username The user name for login * @param {String} password The password for login in clear text * @param {module:api/UserApi~loginUserCallback} callback The callback function, accepting three arguments: error, data, response @@ -297,6 +301,7 @@ export default class UserApi { /** * Logs out current logged in user session + * * @param {module:api/UserApi~logoutUserCallback} callback The callback function, accepting three arguments: error, data, response */ logoutUser(callback) { diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md index 9f1d7e3e7210..4a0c5f1ca08d 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md @@ -718,6 +718,8 @@ null (empty response body) test inline additionalProperties + + ### Example ```javascript @@ -760,6 +762,8 @@ No authorization required test json serialization of form data + + ### Example ```javascript diff --git a/samples/client/petstore/javascript-promise-es6/docs/PetApi.md b/samples/client/petstore/javascript-promise-es6/docs/PetApi.md index fccaf8273bb9..5f6986ea4115 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/PetApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/PetApi.md @@ -22,6 +22,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```javascript @@ -68,6 +70,8 @@ null (empty response body) Deletes a pet + + ### Example ```javascript @@ -264,6 +268,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```javascript @@ -310,6 +316,8 @@ null (empty response body) Updates a pet in the store with form data + + ### Example ```javascript @@ -362,6 +370,8 @@ null (empty response body) uploads an image + + ### Example ```javascript @@ -414,6 +424,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```javascript diff --git a/samples/client/petstore/javascript-promise-es6/docs/StoreApi.md b/samples/client/petstore/javascript-promise-es6/docs/StoreApi.md index 98adf9587cc1..9ad6022bb96b 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/StoreApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/StoreApi.md @@ -151,6 +151,8 @@ No authorization required Place an order for a pet + + ### Example ```javascript diff --git a/samples/client/petstore/javascript-promise-es6/docs/UserApi.md b/samples/client/petstore/javascript-promise-es6/docs/UserApi.md index 9d6f340886b6..50abe0d7c1f6 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/UserApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/UserApi.md @@ -65,6 +65,8 @@ No authorization required Creates list of users with given input array + + ### Example ```javascript @@ -107,6 +109,8 @@ No authorization required Creates list of users with given input array + + ### Example ```javascript @@ -193,6 +197,8 @@ No authorization required Get user by user name + + ### Example ```javascript @@ -235,6 +241,8 @@ No authorization required Logs user into the system + + ### Example ```javascript @@ -279,6 +287,8 @@ No authorization required Logs out current logged in user session + + ### Example ```javascript diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index fe69d0176d61..96a4ac2648ce 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -788,6 +788,7 @@ export default class FakeApi { /** * test inline additionalProperties + * * @param {Object.} requestBody request body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ @@ -820,6 +821,7 @@ export default class FakeApi { /** * test inline additionalProperties + * * @param {Object.} requestBody request body * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ @@ -833,6 +835,7 @@ export default class FakeApi { /** * test json serialization of form data + * * @param {String} param field1 * @param {String} param2 field2 * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response @@ -872,6 +875,7 @@ export default class FakeApi { /** * test json serialization of form data + * * @param {String} param field1 * @param {String} param2 field2 * @return {Promise} a {@link https://www.promisejs.org/|Promise} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js b/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js index c7e004c2fd87..85f1054fdf48 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js @@ -38,6 +38,7 @@ export default class PetApi { /** * Add a new pet to the store + * * @param {module:model/Pet} pet Pet object that needs to be added to the store * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ @@ -80,6 +81,7 @@ export default class PetApi { /** * Add a new pet to the store + * * @param {module:model/Pet} pet Pet object that needs to be added to the store * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ @@ -93,6 +95,7 @@ export default class PetApi { /** * Deletes a pet + * * @param {Number} petId Pet id to delete * @param {Object} opts Optional parameters * @param {String} opts.apiKey @@ -130,6 +133,7 @@ export default class PetApi { /** * Deletes a pet + * * @param {Number} petId Pet id to delete * @param {Object} opts Optional parameters * @param {String} opts.apiKey @@ -289,6 +293,7 @@ export default class PetApi { /** * Update an existing pet + * * @param {module:model/Pet} pet Pet object that needs to be added to the store * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ @@ -331,6 +336,7 @@ export default class PetApi { /** * Update an existing pet + * * @param {module:model/Pet} pet Pet object that needs to be added to the store * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ @@ -344,6 +350,7 @@ export default class PetApi { /** * Updates a pet in the store with form data + * * @param {Number} petId ID of pet that needs to be updated * @param {Object} opts Optional parameters * @param {String} opts.name Updated name of the pet @@ -383,6 +390,7 @@ export default class PetApi { /** * Updates a pet in the store with form data + * * @param {Number} petId ID of pet that needs to be updated * @param {Object} opts Optional parameters * @param {String} opts.name Updated name of the pet @@ -399,6 +407,7 @@ export default class PetApi { /** * uploads an image + * * @param {Number} petId ID of pet to update * @param {Object} opts Optional parameters * @param {String} opts.additionalMetadata Additional data to pass to server @@ -438,6 +447,7 @@ export default class PetApi { /** * uploads an image + * * @param {Number} petId ID of pet to update * @param {Object} opts Optional parameters * @param {String} opts.additionalMetadata Additional data to pass to server @@ -454,6 +464,7 @@ export default class PetApi { /** * uploads an image (required) + * * @param {Number} petId ID of pet to update * @param {File} requiredFile file to upload * @param {Object} opts Optional parameters @@ -497,6 +508,7 @@ export default class PetApi { /** * uploads an image (required) + * * @param {Number} petId ID of pet to update * @param {File} requiredFile file to upload * @param {Object} opts Optional parameters diff --git a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js index 2ba58ae8149d..00c7e3dca8ad 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js @@ -174,6 +174,7 @@ export default class StoreApi { /** * Place an order for a pet + * * @param {module:model/Order} order order placed for purchasing the pet * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response */ @@ -206,6 +207,7 @@ export default class StoreApi { /** * Place an order for a pet + * * @param {module:model/Order} order order placed for purchasing the pet * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} */ diff --git a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js index 976e0da36da7..0d597cfd7a82 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js @@ -84,6 +84,7 @@ export default class UserApi { /** * Creates list of users with given input array + * * @param {Array.} user List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ @@ -116,6 +117,7 @@ export default class UserApi { /** * Creates list of users with given input array + * * @param {Array.} user List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ @@ -129,6 +131,7 @@ export default class UserApi { /** * Creates list of users with given input array + * * @param {Array.} user List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ @@ -161,6 +164,7 @@ export default class UserApi { /** * Creates list of users with given input array + * * @param {Array.} user List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ @@ -222,6 +226,7 @@ export default class UserApi { /** * Get user by user name + * * @param {String} username The name that needs to be fetched. Use user1 for testing. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/User} and HTTP response */ @@ -255,6 +260,7 @@ export default class UserApi { /** * Get user by user name + * * @param {String} username The name that needs to be fetched. Use user1 for testing. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User} */ @@ -268,6 +274,7 @@ export default class UserApi { /** * Logs user into the system + * * @param {String} username The user name for login * @param {String} password The password for login in clear text * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link String} and HTTP response @@ -307,6 +314,7 @@ export default class UserApi { /** * Logs user into the system + * * @param {String} username The user name for login * @param {String} password The password for login in clear text * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link String} @@ -321,6 +329,7 @@ export default class UserApi { /** * Logs out current logged in user session + * * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ logoutUserWithHttpInfo() { @@ -348,6 +357,7 @@ export default class UserApi { /** * Logs out current logged in user session + * * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ logoutUser() { diff --git a/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md b/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md index 7eaa182a4a5c..232d56ed6317 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md +++ b/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md @@ -13,6 +13,8 @@ Method | HTTP request | Description Get enums + + ### Example ```kotlin // Import classes: diff --git a/samples/client/petstore/objc/core-data/docs/SWGPetApi.md b/samples/client/petstore/objc/core-data/docs/SWGPetApi.md index 7d2e7b60795f..d47429217b3b 100644 --- a/samples/client/petstore/objc/core-data/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/core-data/docs/SWGPetApi.md @@ -22,6 +22,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; @@ -73,6 +75,8 @@ void (empty response body) Deletes a pet + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; @@ -296,6 +300,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; @@ -348,6 +354,8 @@ void (empty response body) Updates a pet in the store with form data + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; @@ -406,6 +414,8 @@ void (empty response body) uploads an image + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; diff --git a/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md b/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md index 18b0e1d01ff0..17a3c97e8f53 100644 --- a/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md +++ b/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md @@ -168,6 +168,8 @@ No authorization required Place an order for a pet + + ### Example ```objc diff --git a/samples/client/petstore/objc/core-data/docs/SWGUserApi.md b/samples/client/petstore/objc/core-data/docs/SWGUserApi.md index bd75635f49f6..51792caed6bd 100644 --- a/samples/client/petstore/objc/core-data/docs/SWGUserApi.md +++ b/samples/client/petstore/objc/core-data/docs/SWGUserApi.md @@ -69,6 +69,8 @@ No authorization required Creates list of users with given input array + + ### Example ```objc @@ -114,6 +116,8 @@ No authorization required Creates list of users with given input array + + ### Example ```objc @@ -206,6 +210,8 @@ No authorization required Get user by user name + + ### Example ```objc @@ -255,6 +261,8 @@ No authorization required Logs user into the system + + ### Example ```objc @@ -306,6 +314,8 @@ No authorization required Logs out current logged in user session + + ### Example ```objc diff --git a/samples/client/petstore/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md index 7d2e7b60795f..d47429217b3b 100644 --- a/samples/client/petstore/objc/default/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/default/docs/SWGPetApi.md @@ -22,6 +22,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; @@ -73,6 +75,8 @@ void (empty response body) Deletes a pet + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; @@ -296,6 +300,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; @@ -348,6 +354,8 @@ void (empty response body) Updates a pet in the store with form data + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; @@ -406,6 +414,8 @@ void (empty response body) uploads an image + + ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; diff --git a/samples/client/petstore/objc/default/docs/SWGStoreApi.md b/samples/client/petstore/objc/default/docs/SWGStoreApi.md index 18b0e1d01ff0..17a3c97e8f53 100644 --- a/samples/client/petstore/objc/default/docs/SWGStoreApi.md +++ b/samples/client/petstore/objc/default/docs/SWGStoreApi.md @@ -168,6 +168,8 @@ No authorization required Place an order for a pet + + ### Example ```objc diff --git a/samples/client/petstore/objc/default/docs/SWGUserApi.md b/samples/client/petstore/objc/default/docs/SWGUserApi.md index bd75635f49f6..51792caed6bd 100644 --- a/samples/client/petstore/objc/default/docs/SWGUserApi.md +++ b/samples/client/petstore/objc/default/docs/SWGUserApi.md @@ -69,6 +69,8 @@ No authorization required Creates list of users with given input array + + ### Example ```objc @@ -114,6 +116,8 @@ No authorization required Creates list of users with given input array + + ### Example ```objc @@ -206,6 +210,8 @@ No authorization required Get user by user name + + ### Example ```objc @@ -255,6 +261,8 @@ No authorization required Logs user into the system + + ### Example ```objc @@ -306,6 +314,8 @@ No authorization required Logs out current logged in user session + + ### Example ```objc diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 599921ab22d2..1b1380c2dace 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -729,6 +729,8 @@ void (empty response body) test inline additionalProperties + + ### Example ```perl use Data::Dumper; @@ -772,6 +774,8 @@ No authorization required test json serialization of form data + + ### Example ```perl use Data::Dumper; diff --git a/samples/client/petstore/perl/docs/PetApi.md b/samples/client/petstore/perl/docs/PetApi.md index f35f4afad855..9d49e8bbcf5c 100644 --- a/samples/client/petstore/perl/docs/PetApi.md +++ b/samples/client/petstore/perl/docs/PetApi.md @@ -25,6 +25,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```perl use Data::Dumper; @@ -71,6 +73,8 @@ void (empty response body) Deletes a pet + + ### Example ```perl use Data::Dumper; @@ -268,6 +272,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```perl use Data::Dumper; @@ -314,6 +320,8 @@ void (empty response body) Updates a pet in the store with form data + + ### Example ```perl use Data::Dumper; @@ -364,6 +372,8 @@ void (empty response body) uploads an image + + ### Example ```perl use Data::Dumper; @@ -415,6 +425,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```perl use Data::Dumper; diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index b57d02e8d525..594112b6390f 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -158,6 +158,8 @@ No authorization required Place an order for a pet + + ### Example ```perl use Data::Dumper; diff --git a/samples/client/petstore/perl/docs/UserApi.md b/samples/client/petstore/perl/docs/UserApi.md index fd789384f9bf..01ca5e638c7e 100644 --- a/samples/client/petstore/perl/docs/UserApi.md +++ b/samples/client/petstore/perl/docs/UserApi.md @@ -69,6 +69,8 @@ No authorization required Creates list of users with given input array + + ### Example ```perl use Data::Dumper; @@ -112,6 +114,8 @@ No authorization required Creates list of users with given input array + + ### Example ```perl use Data::Dumper; @@ -200,6 +204,8 @@ No authorization required Get user by user name + + ### Example ```perl use Data::Dumper; @@ -244,6 +250,8 @@ No authorization required Logs user into the system + + ### Example ```perl use Data::Dumper; @@ -290,6 +298,8 @@ No authorization required Logs out current logged in user session + + ### Example ```perl use Data::Dumper; diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index 3f3d9d9bc395..d1497c5322bb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -869,6 +869,8 @@ testInlineAdditionalProperties($request_body) test inline additionalProperties + + ### Example ```php @@ -922,6 +924,8 @@ testJsonFormData($param, $param2) test json serialization of form data + + ### Example ```php diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md index 079f8c03a356..eb814406b5f6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md @@ -23,6 +23,8 @@ addPet($pet) Add a new pet to the store + + ### Example ```php @@ -80,6 +82,8 @@ deletePet($pet_id, $api_key) Deletes a pet + + ### Example ```php @@ -321,6 +325,8 @@ updatePet($pet) Update an existing pet + + ### Example ```php @@ -378,6 +384,8 @@ updatePetWithForm($pet_id, $name, $status) Updates a pet in the store with form data + + ### Example ```php @@ -439,6 +447,8 @@ uploadFile($pet_id, $additional_metadata, $file): \OpenAPI\Client\Model\ApiRespo uploads an image + + ### Example ```php @@ -501,6 +511,8 @@ uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata): \Open uploads an image (required) + + ### Example ```php diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md index 7d13c3497f30..f863861fe7df 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md @@ -188,6 +188,8 @@ placeOrder($order): \OpenAPI\Client\Model\Order Place an order for a pet + + ### Example ```php diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md index 04fb1b76378a..d821635f8753 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md @@ -77,6 +77,8 @@ createUsersWithArrayInput($user) Creates list of users with given input array + + ### Example ```php @@ -130,6 +132,8 @@ createUsersWithListInput($user) Creates list of users with given input array + + ### Example ```php @@ -238,6 +242,8 @@ getUserByName($username): \OpenAPI\Client\Model\User Get user by user name + + ### Example ```php @@ -292,6 +298,8 @@ loginUser($username, $password): string Logs user into the system + + ### Example ```php @@ -348,6 +356,8 @@ logoutUser() Logs out current logged in user session + + ### Example ```php diff --git a/samples/client/petstore/powershell/docs/PSPetApi.md b/samples/client/petstore/powershell/docs/PSPetApi.md index b4b553d9d922..c24d5de326c5 100644 --- a/samples/client/petstore/powershell/docs/PSPetApi.md +++ b/samples/client/petstore/powershell/docs/PSPetApi.md @@ -21,6 +21,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc @@ -70,6 +72,8 @@ Name | Type | Description | Notes Deletes a pet + + ### Example ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc @@ -264,6 +268,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc @@ -314,6 +320,8 @@ Name | Type | Description | Notes Updates a pet in the store with form data + + ### Example ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc @@ -366,6 +374,8 @@ void (empty response body) uploads an image + + ### Example ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc diff --git a/samples/client/petstore/powershell/docs/PSStoreApi.md b/samples/client/petstore/powershell/docs/PSStoreApi.md index aadeb611ab06..2bcc27fd7491 100644 --- a/samples/client/petstore/powershell/docs/PSStoreApi.md +++ b/samples/client/petstore/powershell/docs/PSStoreApi.md @@ -148,6 +148,8 @@ No authorization required Place an order for a pet + + ### Example ```powershell $Order = Initialize-Order -Id 0 -PetId 0 -Quantity 0 -ShipDate (Get-Date) -Status "placed" -Complete $false # Order | order placed for purchasing the pet diff --git a/samples/client/petstore/powershell/docs/PSUserApi.md b/samples/client/petstore/powershell/docs/PSUserApi.md index 37308235b0f0..ba7c2b092869 100644 --- a/samples/client/petstore/powershell/docs/PSUserApi.md +++ b/samples/client/petstore/powershell/docs/PSUserApi.md @@ -71,6 +71,8 @@ void (empty response body) Creates list of users with given input array + + ### Example ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc @@ -119,6 +121,8 @@ void (empty response body) Creates list of users with given input array + + ### Example ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc @@ -217,6 +221,8 @@ void (empty response body) Get user by user name + + ### Example ```powershell $Username = "MyUsername" # String | The name that needs to be fetched. Use user1 for testing. @@ -259,6 +265,8 @@ No authorization required Logs user into the system + + ### Example ```powershell $Username = "MyUsername" # String | The user name for login @@ -301,6 +309,8 @@ No authorization required Logs out current logged in user session + + ### Example ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index ae7fab93e5c4..0491bf196a80 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -995,6 +995,8 @@ nil (empty response body) test inline additionalProperties + + ### Examples ```ruby @@ -1056,6 +1058,8 @@ No authorization required test json serialization of form data + + ### Examples ```ruby diff --git a/samples/client/petstore/ruby-faraday/docs/PetApi.md b/samples/client/petstore/ruby-faraday/docs/PetApi.md index 53af9d78db5f..b28334ae2c58 100644 --- a/samples/client/petstore/ruby-faraday/docs/PetApi.md +++ b/samples/client/petstore/ruby-faraday/docs/PetApi.md @@ -21,6 +21,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Add a new pet to the store + + ### Examples ```ruby @@ -87,6 +89,8 @@ nil (empty response body) Deletes a pet + + ### Examples ```ruby @@ -366,6 +370,8 @@ end Update an existing pet + + ### Examples ```ruby @@ -432,6 +438,8 @@ nil (empty response body) Updates a pet in the store with form data + + ### Examples ```ruby @@ -504,6 +512,8 @@ nil (empty response body) uploads an image + + ### Examples ```ruby @@ -577,6 +587,8 @@ end uploads an image (required) + + ### Examples ```ruby diff --git a/samples/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/client/petstore/ruby-faraday/docs/StoreApi.md index 776d38ebc971..0bccca0bec7e 100644 --- a/samples/client/petstore/ruby-faraday/docs/StoreApi.md +++ b/samples/client/petstore/ruby-faraday/docs/StoreApi.md @@ -211,6 +211,8 @@ No authorization required Place an order for a pet + + ### Examples ```ruby diff --git a/samples/client/petstore/ruby-faraday/docs/UserApi.md b/samples/client/petstore/ruby-faraday/docs/UserApi.md index 456561f92f3e..348f5f9c4295 100644 --- a/samples/client/petstore/ruby-faraday/docs/UserApi.md +++ b/samples/client/petstore/ruby-faraday/docs/UserApi.md @@ -83,6 +83,8 @@ No authorization required Creates list of users with given input array + + ### Examples ```ruby @@ -144,6 +146,8 @@ No authorization required Creates list of users with given input array + + ### Examples ```ruby @@ -268,6 +272,8 @@ No authorization required Get user by user name + + ### Examples ```ruby @@ -330,6 +336,8 @@ No authorization required Logs user into the system + + ### Examples ```ruby @@ -394,6 +402,8 @@ No authorization required Logs out current logged in user session + + ### Examples ```ruby diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index aba3d7a617db..0739d4509394 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -1093,6 +1093,7 @@ def test_group_parameters_with_http_info(required_string_group, required_boolean end # test inline additionalProperties + # # @param request_body [Hash] request body # @param [Hash] opts the optional parameters # @return [nil] @@ -1102,6 +1103,7 @@ def test_inline_additional_properties(request_body, opts = {}) end # test inline additionalProperties + # # @param request_body [Hash] request body # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -1157,6 +1159,7 @@ def test_inline_additional_properties_with_http_info(request_body, opts = {}) end # test json serialization of form data + # # @param param [String] field1 # @param param2 [String] field2 # @param [Hash] opts the optional parameters @@ -1167,6 +1170,7 @@ def test_json_form_data(param, param2, opts = {}) end # test json serialization of form data + # # @param param [String] field1 # @param param2 [String] field2 # @param [Hash] opts the optional parameters diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 46c587f5f50c..ef4ff059f6de 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -20,6 +20,7 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Add a new pet to the store + # # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] @@ -29,6 +30,7 @@ def add_pet(pet, opts = {}) end # Add a new pet to the store + # # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -84,6 +86,7 @@ def add_pet_with_http_info(pet, opts = {}) end # Deletes a pet + # # @param pet_id [Integer] Pet id to delete # @param [Hash] opts the optional parameters # @option opts [String] :api_key @@ -94,6 +97,7 @@ def delete_pet(pet_id, opts = {}) end # Deletes a pet + # # @param pet_id [Integer] Pet id to delete # @param [Hash] opts the optional parameters # @option opts [String] :api_key @@ -337,6 +341,7 @@ def get_pet_by_id_with_http_info(pet_id, opts = {}) end # Update an existing pet + # # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] @@ -346,6 +351,7 @@ def update_pet(pet, opts = {}) end # Update an existing pet + # # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -401,6 +407,7 @@ def update_pet_with_http_info(pet, opts = {}) end # Updates a pet in the store with form data + # # @param pet_id [Integer] ID of pet that needs to be updated # @param [Hash] opts the optional parameters # @option opts [String] :name Updated name of the pet @@ -412,6 +419,7 @@ def update_pet_with_form(pet_id, opts = {}) end # Updates a pet in the store with form data + # # @param pet_id [Integer] ID of pet that needs to be updated # @param [Hash] opts the optional parameters # @option opts [String] :name Updated name of the pet @@ -471,6 +479,7 @@ def update_pet_with_form_with_http_info(pet_id, opts = {}) end # uploads an image + # # @param pet_id [Integer] ID of pet to update # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server @@ -482,6 +491,7 @@ def upload_file(pet_id, opts = {}) end # uploads an image + # # @param pet_id [Integer] ID of pet to update # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server @@ -543,6 +553,7 @@ def upload_file_with_http_info(pet_id, opts = {}) end # uploads an image (required) + # # @param pet_id [Integer] ID of pet to update # @param required_file [File] file to upload # @param [Hash] opts the optional parameters @@ -554,6 +565,7 @@ def upload_file_with_required_file(pet_id, required_file, opts = {}) end # uploads an image (required) + # # @param pet_id [Integer] ID of pet to update # @param required_file [File] file to upload # @param [Hash] opts the optional parameters diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 9d408ff92b93..7d5ac9de556d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -209,6 +209,7 @@ def get_order_by_id_with_http_info(order_id, opts = {}) end # Place an order for a pet + # # @param order [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Order] @@ -218,6 +219,7 @@ def place_order(order, opts = {}) end # Place an order for a pet + # # @param order [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 78fb034147e5..4703122a341f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -86,6 +86,7 @@ def create_user_with_http_info(user, opts = {}) end # Creates list of users with given input array + # # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] @@ -95,6 +96,7 @@ def create_users_with_array_input(user, opts = {}) end # Creates list of users with given input array + # # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -150,6 +152,7 @@ def create_users_with_array_input_with_http_info(user, opts = {}) end # Creates list of users with given input array + # # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] @@ -159,6 +162,7 @@ def create_users_with_list_input(user, opts = {}) end # Creates list of users with given input array + # # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -275,6 +279,7 @@ def delete_user_with_http_info(username, opts = {}) end # Get user by user name + # # @param username [String] The name that needs to be fetched. Use user1 for testing. # @param [Hash] opts the optional parameters # @return [User] @@ -284,6 +289,7 @@ def get_user_by_name(username, opts = {}) end # Get user by user name + # # @param username [String] The name that needs to be fetched. Use user1 for testing. # @param [Hash] opts the optional parameters # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers @@ -336,6 +342,7 @@ def get_user_by_name_with_http_info(username, opts = {}) end # Logs user into the system + # # @param username [String] The user name for login # @param password [String] The password for login in clear text # @param [Hash] opts the optional parameters @@ -346,6 +353,7 @@ def login_user(username, password, opts = {}) end # Logs user into the system + # # @param username [String] The user name for login # @param password [String] The password for login in clear text # @param [Hash] opts the optional parameters @@ -405,6 +413,7 @@ def login_user_with_http_info(username, password, opts = {}) end # Logs out current logged in user session + # # @param [Hash] opts the optional parameters # @return [nil] def logout_user(opts = {}) @@ -413,6 +422,7 @@ def logout_user(opts = {}) end # Logs out current logged in user session + # # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def logout_user_with_http_info(opts = {}) diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index ae7fab93e5c4..0491bf196a80 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -995,6 +995,8 @@ nil (empty response body) test inline additionalProperties + + ### Examples ```ruby @@ -1056,6 +1058,8 @@ No authorization required test json serialization of form data + + ### Examples ```ruby diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index 53af9d78db5f..b28334ae2c58 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -21,6 +21,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Add a new pet to the store + + ### Examples ```ruby @@ -87,6 +89,8 @@ nil (empty response body) Deletes a pet + + ### Examples ```ruby @@ -366,6 +370,8 @@ end Update an existing pet + + ### Examples ```ruby @@ -432,6 +438,8 @@ nil (empty response body) Updates a pet in the store with form data + + ### Examples ```ruby @@ -504,6 +512,8 @@ nil (empty response body) uploads an image + + ### Examples ```ruby @@ -577,6 +587,8 @@ end uploads an image (required) + + ### Examples ```ruby diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 776d38ebc971..0bccca0bec7e 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -211,6 +211,8 @@ No authorization required Place an order for a pet + + ### Examples ```ruby diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md index 456561f92f3e..348f5f9c4295 100644 --- a/samples/client/petstore/ruby/docs/UserApi.md +++ b/samples/client/petstore/ruby/docs/UserApi.md @@ -83,6 +83,8 @@ No authorization required Creates list of users with given input array + + ### Examples ```ruby @@ -144,6 +146,8 @@ No authorization required Creates list of users with given input array + + ### Examples ```ruby @@ -268,6 +272,8 @@ No authorization required Get user by user name + + ### Examples ```ruby @@ -330,6 +336,8 @@ No authorization required Logs user into the system + + ### Examples ```ruby @@ -394,6 +402,8 @@ No authorization required Logs out current logged in user session + + ### Examples ```ruby diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index aba3d7a617db..0739d4509394 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -1093,6 +1093,7 @@ def test_group_parameters_with_http_info(required_string_group, required_boolean end # test inline additionalProperties + # # @param request_body [Hash] request body # @param [Hash] opts the optional parameters # @return [nil] @@ -1102,6 +1103,7 @@ def test_inline_additional_properties(request_body, opts = {}) end # test inline additionalProperties + # # @param request_body [Hash] request body # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -1157,6 +1159,7 @@ def test_inline_additional_properties_with_http_info(request_body, opts = {}) end # test json serialization of form data + # # @param param [String] field1 # @param param2 [String] field2 # @param [Hash] opts the optional parameters @@ -1167,6 +1170,7 @@ def test_json_form_data(param, param2, opts = {}) end # test json serialization of form data + # # @param param [String] field1 # @param param2 [String] field2 # @param [Hash] opts the optional parameters diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index 39464599740f..2574ace93bca 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -20,6 +20,7 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Add a new pet to the store + # # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] @@ -29,6 +30,7 @@ def add_pet(pet, opts = {}) end # Add a new pet to the store + # # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -84,6 +86,7 @@ def add_pet_with_http_info(pet, opts = {}) end # Deletes a pet + # # @param pet_id [Integer] Pet id to delete # @param [Hash] opts the optional parameters # @option opts [String] :api_key @@ -94,6 +97,7 @@ def delete_pet(pet_id, opts = {}) end # Deletes a pet + # # @param pet_id [Integer] Pet id to delete # @param [Hash] opts the optional parameters # @option opts [String] :api_key @@ -337,6 +341,7 @@ def get_pet_by_id_with_http_info(pet_id, opts = {}) end # Update an existing pet + # # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] @@ -346,6 +351,7 @@ def update_pet(pet, opts = {}) end # Update an existing pet + # # @param pet [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -401,6 +407,7 @@ def update_pet_with_http_info(pet, opts = {}) end # Updates a pet in the store with form data + # # @param pet_id [Integer] ID of pet that needs to be updated # @param [Hash] opts the optional parameters # @option opts [String] :name Updated name of the pet @@ -412,6 +419,7 @@ def update_pet_with_form(pet_id, opts = {}) end # Updates a pet in the store with form data + # # @param pet_id [Integer] ID of pet that needs to be updated # @param [Hash] opts the optional parameters # @option opts [String] :name Updated name of the pet @@ -471,6 +479,7 @@ def update_pet_with_form_with_http_info(pet_id, opts = {}) end # uploads an image + # # @param pet_id [Integer] ID of pet to update # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server @@ -482,6 +491,7 @@ def upload_file(pet_id, opts = {}) end # uploads an image + # # @param pet_id [Integer] ID of pet to update # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server @@ -543,6 +553,7 @@ def upload_file_with_http_info(pet_id, opts = {}) end # uploads an image (required) + # # @param pet_id [Integer] ID of pet to update # @param required_file [File] file to upload # @param [Hash] opts the optional parameters @@ -554,6 +565,7 @@ def upload_file_with_required_file(pet_id, required_file, opts = {}) end # uploads an image (required) + # # @param pet_id [Integer] ID of pet to update # @param required_file [File] file to upload # @param [Hash] opts the optional parameters diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 0b8aa9efe38e..e95029091e3b 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -209,6 +209,7 @@ def get_order_by_id_with_http_info(order_id, opts = {}) end # Place an order for a pet + # # @param order [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Order] @@ -218,6 +219,7 @@ def place_order(order, opts = {}) end # Place an order for a pet + # # @param order [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index 1badcd3c3464..8afe2a430d89 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -86,6 +86,7 @@ def create_user_with_http_info(user, opts = {}) end # Creates list of users with given input array + # # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] @@ -95,6 +96,7 @@ def create_users_with_array_input(user, opts = {}) end # Creates list of users with given input array + # # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -150,6 +152,7 @@ def create_users_with_array_input_with_http_info(user, opts = {}) end # Creates list of users with given input array + # # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] @@ -159,6 +162,7 @@ def create_users_with_list_input(user, opts = {}) end # Creates list of users with given input array + # # @param user [Array] List of user object # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -275,6 +279,7 @@ def delete_user_with_http_info(username, opts = {}) end # Get user by user name + # # @param username [String] The name that needs to be fetched. Use user1 for testing. # @param [Hash] opts the optional parameters # @return [User] @@ -284,6 +289,7 @@ def get_user_by_name(username, opts = {}) end # Get user by user name + # # @param username [String] The name that needs to be fetched. Use user1 for testing. # @param [Hash] opts the optional parameters # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers @@ -336,6 +342,7 @@ def get_user_by_name_with_http_info(username, opts = {}) end # Logs user into the system + # # @param username [String] The user name for login # @param password [String] The password for login in clear text # @param [Hash] opts the optional parameters @@ -346,6 +353,7 @@ def login_user(username, password, opts = {}) end # Logs user into the system + # # @param username [String] The user name for login # @param password [String] The password for login in clear text # @param [Hash] opts the optional parameters @@ -405,6 +413,7 @@ def login_user_with_http_info(username, password, opts = {}) end # Logs out current logged in user session + # # @param [Hash] opts the optional parameters # @return [nil] def logout_user(opts = {}) @@ -413,6 +422,7 @@ def logout_user(opts = {}) end # Logs out current logged in user session + # # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def logout_user_with_http_info(opts = {}) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md b/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md index a20db07531eb..7deea32cd816 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md @@ -20,6 +20,8 @@ Method | HTTP request | Description > crate::models::Pet add_pet(pet) Add a new pet to the store + + ### Parameters @@ -48,6 +50,8 @@ Name | Type | Description | Required | Notes > delete_pet(pet_id, api_key) Deletes a pet + + ### Parameters @@ -167,6 +171,8 @@ Name | Type | Description | Required | Notes > crate::models::Pet update_pet(pet) Update an existing pet + + ### Parameters @@ -195,6 +201,8 @@ Name | Type | Description | Required | Notes > update_pet_with_form(pet_id, name, status) Updates a pet in the store with form data + + ### Parameters @@ -225,6 +233,8 @@ Name | Type | Description | Required | Notes > crate::models::ApiResponse upload_file(pet_id, additional_metadata, file) uploads an image + + ### Parameters diff --git a/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md b/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md index 320171fdacbb..c1f5b5a9c216 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md @@ -103,6 +103,8 @@ No authorization required > crate::models::Order place_order(order) Place an order for a pet + + ### Parameters diff --git a/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md b/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md index 5655737e6ee0..39e455d9073d 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md @@ -50,6 +50,8 @@ Name | Type | Description | Required | Notes > create_users_with_array_input(user) Creates list of users with given input array + + ### Parameters @@ -78,6 +80,8 @@ Name | Type | Description | Required | Notes > create_users_with_list_input(user) Creates list of users with given input array + + ### Parameters @@ -136,6 +140,8 @@ Name | Type | Description | Required | Notes > crate::models::User get_user_by_name(username) Get user by user name + + ### Parameters @@ -164,6 +170,8 @@ No authorization required > String login_user(username, password) Logs user into the system + + ### Parameters @@ -193,6 +201,8 @@ No authorization required > logout_user() Logs out current logged in user session + + ### Parameters This endpoint does not need any parameter. diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md index d146d7cf96a6..5adc9334151a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md @@ -20,6 +20,8 @@ Method | HTTP request | Description > crate::models::Pet add_pet(pet) Add a new pet to the store + + ### Parameters @@ -48,6 +50,8 @@ Name | Type | Description | Required | Notes > delete_pet(pet_id, api_key) Deletes a pet + + ### Parameters @@ -167,6 +171,8 @@ Name | Type | Description | Required | Notes > crate::models::Pet update_pet(pet) Update an existing pet + + ### Parameters @@ -195,6 +201,8 @@ Name | Type | Description | Required | Notes > update_pet_with_form(pet_id, name, status) Updates a pet in the store with form data + + ### Parameters @@ -225,6 +233,8 @@ Name | Type | Description | Required | Notes > crate::models::ApiResponse upload_file(pet_id, additional_metadata, file) uploads an image + + ### Parameters diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md index b150749ccd96..a6b3c572ccc1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md @@ -103,6 +103,8 @@ No authorization required > crate::models::Order place_order(order) Place an order for a pet + + ### Parameters diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md index 1f66eb5cf8e9..03693014b925 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md @@ -50,6 +50,8 @@ Name | Type | Description | Required | Notes > create_users_with_array_input(user) Creates list of users with given input array + + ### Parameters @@ -78,6 +80,8 @@ Name | Type | Description | Required | Notes > create_users_with_list_input(user) Creates list of users with given input array + + ### Parameters @@ -136,6 +140,8 @@ Name | Type | Description | Required | Notes > crate::models::User get_user_by_name(username) Get user by user name + + ### Parameters @@ -164,6 +170,8 @@ No authorization required > String login_user(username, password) Logs user into the system + + ### Parameters @@ -193,6 +201,8 @@ No authorization required > logout_user() Logs out current logged in user session + + ### Parameters This endpoint does not need any parameter. diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs index 099ea08daa10..977d79edcf74 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs @@ -209,6 +209,7 @@ pub enum UploadFileError { } +/// pub async fn add_pet(configuration: &configuration::Configuration, params: AddPetParams) -> Result, Error> { let local_var_configuration = configuration; @@ -246,6 +247,7 @@ pub async fn add_pet(configuration: &configuration::Configuration, params: AddPe } } +/// pub async fn delete_pet(configuration: &configuration::Configuration, params: DeletePetParams) -> Result, Error> { let local_var_configuration = configuration; @@ -410,6 +412,7 @@ pub async fn get_pet_by_id(configuration: &configuration::Configuration, params: } } +/// pub async fn update_pet(configuration: &configuration::Configuration, params: UpdatePetParams) -> Result, Error> { let local_var_configuration = configuration; @@ -447,6 +450,7 @@ pub async fn update_pet(configuration: &configuration::Configuration, params: Up } } +/// pub async fn update_pet_with_form(configuration: &configuration::Configuration, params: UpdatePetWithFormParams) -> Result, Error> { let local_var_configuration = configuration; @@ -493,6 +497,7 @@ pub async fn update_pet_with_form(configuration: &configuration::Configuration, } } +/// pub async fn upload_file(configuration: &configuration::Configuration, params: UploadFileParams) -> Result, Error> { let local_var_configuration = configuration; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs index 8f58ce294ec2..36d090f4f1ae 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs @@ -210,6 +210,7 @@ pub async fn get_order_by_id(configuration: &configuration::Configuration, param } } +/// pub async fn place_order(configuration: &configuration::Configuration, params: PlaceOrderParams) -> Result, Error> { let local_var_configuration = configuration; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs index 55fb3e1db68c..616fad6738ec 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs @@ -237,6 +237,7 @@ pub async fn create_user(configuration: &configuration::Configuration, params: C } } +/// pub async fn create_users_with_array_input(configuration: &configuration::Configuration, params: CreateUsersWithArrayInputParams) -> Result, Error> { let local_var_configuration = configuration; @@ -279,6 +280,7 @@ pub async fn create_users_with_array_input(configuration: &configuration::Config } } +/// pub async fn create_users_with_list_input(configuration: &configuration::Configuration, params: CreateUsersWithListInputParams) -> Result, Error> { let local_var_configuration = configuration; @@ -363,6 +365,7 @@ pub async fn delete_user(configuration: &configuration::Configuration, params: D } } +/// pub async fn get_user_by_name(configuration: &configuration::Configuration, params: GetUserByNameParams) -> Result, Error> { let local_var_configuration = configuration; @@ -396,6 +399,7 @@ pub async fn get_user_by_name(configuration: &configuration::Configuration, para } } +/// pub async fn login_user(configuration: &configuration::Configuration, params: LoginUserParams) -> Result, Error> { let local_var_configuration = configuration; @@ -432,6 +436,7 @@ pub async fn login_user(configuration: &configuration::Configuration, params: Lo } } +/// pub async fn logout_user(configuration: &configuration::Configuration) -> Result, Error> { let local_var_configuration = configuration; diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md index d146d7cf96a6..5adc9334151a 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md @@ -20,6 +20,8 @@ Method | HTTP request | Description > crate::models::Pet add_pet(pet) Add a new pet to the store + + ### Parameters @@ -48,6 +50,8 @@ Name | Type | Description | Required | Notes > delete_pet(pet_id, api_key) Deletes a pet + + ### Parameters @@ -167,6 +171,8 @@ Name | Type | Description | Required | Notes > crate::models::Pet update_pet(pet) Update an existing pet + + ### Parameters @@ -195,6 +201,8 @@ Name | Type | Description | Required | Notes > update_pet_with_form(pet_id, name, status) Updates a pet in the store with form data + + ### Parameters @@ -225,6 +233,8 @@ Name | Type | Description | Required | Notes > crate::models::ApiResponse upload_file(pet_id, additional_metadata, file) uploads an image + + ### Parameters diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md index b150749ccd96..a6b3c572ccc1 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md @@ -103,6 +103,8 @@ No authorization required > crate::models::Order place_order(order) Place an order for a pet + + ### Parameters diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md index 1f66eb5cf8e9..03693014b925 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md @@ -50,6 +50,8 @@ Name | Type | Description | Required | Notes > create_users_with_array_input(user) Creates list of users with given input array + + ### Parameters @@ -78,6 +80,8 @@ Name | Type | Description | Required | Notes > create_users_with_list_input(user) Creates list of users with given input array + + ### Parameters @@ -136,6 +140,8 @@ Name | Type | Description | Required | Notes > crate::models::User get_user_by_name(username) Get user by user name + + ### Parameters @@ -164,6 +170,8 @@ No authorization required > String login_user(username, password) Logs user into the system + + ### Parameters @@ -193,6 +201,8 @@ No authorization required > logout_user() Logs out current logged in user session + + ### Parameters This endpoint does not need any parameter. diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs index 214dbd71b06d..f44a38d60950 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs @@ -82,6 +82,7 @@ pub enum UploadFileError { } +/// pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { let local_var_configuration = configuration; @@ -113,6 +114,7 @@ pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models: } } +/// pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api_key: Option<&str>) -> Result<(), Error> { let local_var_configuration = configuration; @@ -252,6 +254,7 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) } } +/// pub fn update_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { let local_var_configuration = configuration; @@ -283,6 +286,7 @@ pub fn update_pet(configuration: &configuration::Configuration, pet: crate::mode } } +/// pub fn update_pet_with_form(configuration: &configuration::Configuration, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Result<(), Error> { let local_var_configuration = configuration; @@ -321,6 +325,7 @@ pub fn update_pet_with_form(configuration: &configuration::Configuration, pet_id } } +/// pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Result> { let local_var_configuration = configuration; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs index d62ef3dcafb8..f142404c3f2f 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs @@ -141,6 +141,7 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i } } +/// pub fn place_order(configuration: &configuration::Configuration, order: crate::models::Order) -> Result> { let local_var_configuration = configuration; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs index a6f457481ddd..e77fef6941fa 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs @@ -120,6 +120,7 @@ pub fn create_user(configuration: &configuration::Configuration, user: crate::mo } } +/// pub fn create_users_with_array_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { let local_var_configuration = configuration; @@ -156,6 +157,7 @@ pub fn create_users_with_array_input(configuration: &configuration::Configuratio } } +/// pub fn create_users_with_list_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { let local_var_configuration = configuration; @@ -228,6 +230,7 @@ pub fn delete_user(configuration: &configuration::Configuration, username: &str) } } +/// pub fn get_user_by_name(configuration: &configuration::Configuration, username: &str) -> Result> { let local_var_configuration = configuration; @@ -255,6 +258,7 @@ pub fn get_user_by_name(configuration: &configuration::Configuration, username: } } +/// pub fn login_user(configuration: &configuration::Configuration, username: &str, password: &str) -> Result> { let local_var_configuration = configuration; @@ -284,6 +288,7 @@ pub fn login_user(configuration: &configuration::Configuration, username: &str, } } +/// pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(), Error> { let local_var_configuration = configuration; diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala index c57354a5a953..f2467942f84a 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -26,6 +26,8 @@ object PetApi { class PetApi(baseUrl: String) { /** + * + * * Expected answers: * code 200 : Pet (successful operation) * code 405 : (Invalid input) @@ -40,6 +42,8 @@ class PetApi(baseUrl: String) { /** + * + * * Expected answers: * code 400 : (Invalid pet value) * @@ -108,6 +112,8 @@ class PetApi(baseUrl: String) { /** + * + * * Expected answers: * code 200 : Pet (successful operation) * code 400 : (Invalid ID supplied) @@ -126,6 +132,8 @@ class PetApi(baseUrl: String) { /** + * + * * Expected answers: * code 200 : (successful operation) * code 405 : (Invalid input) @@ -144,6 +152,8 @@ class PetApi(baseUrl: String) { /** + * + * * Expected answers: * code 200 : ApiResponse (successful operation) * diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala index 81776a43dcc6..6832f20dea63 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -73,6 +73,8 @@ class StoreApi(baseUrl: String) { /** + * + * * Expected answers: * code 200 : Order (successful operation) * code 400 : (Invalid Order) diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala index 112105938ad3..1b9d71c18b1f 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -43,6 +43,8 @@ class UserApi(baseUrl: String) { /** + * + * * Expected answers: * code 0 : (successful operation) * @@ -59,6 +61,8 @@ class UserApi(baseUrl: String) { /** + * + * * Expected answers: * code 0 : (successful operation) * @@ -95,6 +99,8 @@ class UserApi(baseUrl: String) { /** + * + * * Expected answers: * code 200 : User (successful operation) * code 400 : (Invalid username supplied) @@ -111,6 +117,8 @@ class UserApi(baseUrl: String) { /** + * + * * Expected answers: * code 200 : String (successful operation) * Headers : @@ -136,6 +144,8 @@ class UserApi(baseUrl: String) { } /** + * + * * Expected answers: * code 0 : (successful operation) * diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala index 94ea794967cd..93e70e0015bf 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -26,6 +26,8 @@ def apply(baseUrl: String = "http://petstore.swagger.io/v2") = new PetApi(baseUr class PetApi(baseUrl: String) { /** + * + * * Expected answers: * code 200 : Pet (successful operation) * code 405 : (Invalid input) @@ -41,6 +43,8 @@ class PetApi(baseUrl: String) { .response(asJson[Pet]) /** + * + * * Expected answers: * code 400 : (Invalid pet value) * @@ -109,6 +113,8 @@ class PetApi(baseUrl: String) { .response(asJson[Pet]) /** + * + * * Expected answers: * code 200 : Pet (successful operation) * code 400 : (Invalid ID supplied) @@ -126,6 +132,8 @@ class PetApi(baseUrl: String) { .response(asJson[Pet]) /** + * + * * Expected answers: * code 405 : (Invalid input) * @@ -145,6 +153,8 @@ class PetApi(baseUrl: String) { .response(asJson[Unit]) /** + * + * * Expected answers: * code 200 : ApiResponse (successful operation) * diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala index b961955e884a..d98fb71e185e 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -74,6 +74,8 @@ class StoreApi(baseUrl: String) { .response(asJson[Order]) /** + * + * * Expected answers: * code 200 : Order (successful operation) * code 400 : (Invalid Order) diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala index 0b7b0812e92a..ee236f92f51b 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -45,6 +45,8 @@ class UserApi(baseUrl: String) { .response(asJson[Unit]) /** + * + * * Expected answers: * code 0 : (successful operation) * @@ -63,6 +65,8 @@ class UserApi(baseUrl: String) { .response(asJson[Unit]) /** + * + * * Expected answers: * code 0 : (successful operation) * @@ -101,6 +105,8 @@ class UserApi(baseUrl: String) { .response(asJson[Unit]) /** + * + * * Expected answers: * code 200 : User (successful operation) * code 400 : (Invalid username supplied) @@ -116,6 +122,8 @@ class UserApi(baseUrl: String) { .response(asJson[User]) /** + * + * * Expected answers: * code 200 : String (successful operation) * Headers : @@ -135,6 +143,8 @@ class UserApi(baseUrl: String) { .response(asJson[String]) /** + * + * * Expected answers: * code 0 : (successful operation) * diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index e224481e9870..9b4d94da525c 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -30,6 +30,7 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -65,6 +66,7 @@ ResponseEntity addPet( /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -202,6 +204,7 @@ ResponseEntity getPetById( /** * PUT /pet : Update an existing pet + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -241,6 +244,7 @@ ResponseEntity updatePet( /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -276,6 +280,7 @@ ResponseEntity updatePetWithForm( /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 2cafcdbced71..76d8756cbef5 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -118,6 +118,7 @@ ResponseEntity getOrderById( /** * POST /store/order : Place an order for a pet + * * * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 44eb0c97b681..981a6a622e19 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -60,6 +60,7 @@ ResponseEntity createUser( /** * POST /user/createWithArray : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -88,6 +89,7 @@ ResponseEntity createUsersWithArrayInput( /** * POST /user/createWithList : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -146,6 +148,7 @@ ResponseEntity deleteUser( /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -176,6 +179,7 @@ ResponseEntity getUserByName( /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -206,6 +210,7 @@ ResponseEntity loginUser( /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index ed7c4d5c1f88..9b2fd4b47b2d 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -34,6 +34,7 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - - OAuth: - type: oauth2 - name: petstore_auth @@ -81,6 +82,7 @@ open class PetAPI { /** Deletes a pet - DELETE /pet/{petId} + - - OAuth: - type: oauth2 - name: petstore_auth @@ -292,6 +294,7 @@ open class PetAPI { /** Update an existing pet - PUT /pet + - - OAuth: - type: oauth2 - name: petstore_auth @@ -340,6 +343,7 @@ open class PetAPI { /** Updates a pet in the store with form data - POST /pet/{petId} + - - OAuth: - type: oauth2 - name: petstore_auth @@ -399,6 +403,7 @@ open class PetAPI { /** uploads an image - POST /pet/{petId}/uploadImage + - - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index b09bede07879..4c713d2d6735 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -173,6 +173,7 @@ open class StoreAPI { /** Place an order for a pet - POST /store/order + - - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c68667274c12..8b8706bbde81 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -81,6 +81,7 @@ open class UserAPI { /** Creates list of users with given input array - POST /user/createWithArray + - - API Key: - type: apiKey AUTH_KEY - name: auth_cookie @@ -127,6 +128,7 @@ open class UserAPI { /** Creates list of users with given input array - POST /user/createWithList + - - API Key: - type: apiKey AUTH_KEY - name: auth_cookie @@ -223,6 +225,7 @@ open class UserAPI { /** Get user by user name - GET /user/{username} + - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ @@ -270,6 +273,7 @@ open class UserAPI { /** Logs user into the system - GET /user/login + - - responseHeaders: [Set-Cookie(String), X-Rate-Limit(Int), X-Expires-After(Date)] - parameter username: (query) The user name for login - parameter password: (query) The password for login in clear text @@ -318,6 +322,7 @@ open class UserAPI { /** Logs out current logged in user session - GET /user/logout + - - API Key: - type: apiKey AUTH_KEY - name: auth_cookie diff --git a/samples/client/petstore/swift5/deprecated/docs/PetAPI.md b/samples/client/petstore/swift5/deprecated/docs/PetAPI.md index cd138421072e..cafcea70c646 100644 --- a/samples/client/petstore/swift5/deprecated/docs/PetAPI.md +++ b/samples/client/petstore/swift5/deprecated/docs/PetAPI.md @@ -21,6 +21,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new @@ -69,6 +71,8 @@ Void (empty response body) Deletes a pet + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new @@ -269,6 +273,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new @@ -317,6 +323,8 @@ Void (empty response body) Updates a pet in the store with form data + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new @@ -369,6 +377,8 @@ Void (empty response body) uploads an image + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new diff --git a/samples/client/petstore/swift5/deprecated/docs/StoreAPI.md b/samples/client/petstore/swift5/deprecated/docs/StoreAPI.md index 8a0441527c18..db4d3aa1fb4b 100644 --- a/samples/client/petstore/swift5/deprecated/docs/StoreAPI.md +++ b/samples/client/petstore/swift5/deprecated/docs/StoreAPI.md @@ -163,6 +163,8 @@ No authorization required Place an order for a pet + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new diff --git a/samples/client/petstore/swift5/deprecated/docs/UserAPI.md b/samples/client/petstore/swift5/deprecated/docs/UserAPI.md index 5ef3d53cb735..1f63b5c9cbc4 100644 --- a/samples/client/petstore/swift5/deprecated/docs/UserAPI.md +++ b/samples/client/petstore/swift5/deprecated/docs/UserAPI.md @@ -71,6 +71,8 @@ Void (empty response body) Creates list of users with given input array + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new @@ -119,6 +121,8 @@ Void (empty response body) Creates list of users with given input array + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new @@ -217,6 +221,8 @@ Void (empty response body) Get user by user name + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new @@ -265,6 +271,8 @@ No authorization required Logs user into the system + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new @@ -315,6 +323,8 @@ No authorization required Logs out current logged in user session + + ### Example ```swift // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index b0a139e2f202..760cc8e90428 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -759,6 +759,7 @@ export class FakeApi extends runtime.BaseAPI { } /** + * * test inline additionalProperties */ async testInlineAdditionalPropertiesRaw(requestParameters: TestInlineAdditionalPropertiesRequest, initOverrides?: RequestInit): Promise> { @@ -784,6 +785,7 @@ export class FakeApi extends runtime.BaseAPI { } /** + * * test inline additionalProperties */ async testInlineAdditionalProperties(requestParameters: TestInlineAdditionalPropertiesRequest, initOverrides?: RequestInit): Promise { @@ -791,6 +793,7 @@ export class FakeApi extends runtime.BaseAPI { } /** + * * test json serialization of form data */ async testJsonFormDataRaw(requestParameters: TestJsonFormDataRequest, initOverrides?: RequestInit): Promise> { @@ -840,6 +843,7 @@ export class FakeApi extends runtime.BaseAPI { } /** + * * test json serialization of form data */ async testJsonFormData(requestParameters: TestJsonFormDataRequest, initOverrides?: RequestInit): Promise { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/PetApi.ts index 7956683bec14..c9d3f471a2aa 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/PetApi.ts @@ -72,6 +72,7 @@ export interface UploadFileWithRequiredFileRequest { export class PetApi extends runtime.BaseAPI { /** + * * Add a new pet to the store */ async addPetRaw(requestParameters: AddPetRequest, initOverrides?: RequestInit): Promise> { @@ -102,6 +103,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * Add a new pet to the store */ async addPet(requestParameters: AddPetRequest, initOverrides?: RequestInit): Promise { @@ -109,6 +111,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * Deletes a pet */ async deletePetRaw(requestParameters: DeletePetRequest, initOverrides?: RequestInit): Promise> { @@ -140,6 +143,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * Deletes a pet */ async deletePet(requestParameters: DeletePetRequest, initOverrides?: RequestInit): Promise { @@ -265,6 +269,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * Update an existing pet */ async updatePetRaw(requestParameters: UpdatePetRequest, initOverrides?: RequestInit): Promise> { @@ -295,6 +300,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * Update an existing pet */ async updatePet(requestParameters: UpdatePetRequest, initOverrides?: RequestInit): Promise { @@ -302,6 +308,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * Updates a pet in the store with form data */ async updatePetWithFormRaw(requestParameters: UpdatePetWithFormRequest, initOverrides?: RequestInit): Promise> { @@ -352,6 +359,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * Updates a pet in the store with form data */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest, initOverrides?: RequestInit): Promise { @@ -359,6 +367,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * uploads an image */ async uploadFileRaw(requestParameters: UploadFileRequest, initOverrides?: RequestInit): Promise> { @@ -411,6 +420,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * uploads an image */ async uploadFile(requestParameters: UploadFileRequest, initOverrides?: RequestInit): Promise { @@ -419,6 +429,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * uploads an image (required) */ async uploadFileWithRequiredFileRaw(requestParameters: UploadFileWithRequiredFileRequest, initOverrides?: RequestInit): Promise> { @@ -475,6 +486,7 @@ export class PetApi extends runtime.BaseAPI { } /** + * * uploads an image (required) */ async uploadFileWithRequiredFile(requestParameters: UploadFileWithRequiredFileRequest, initOverrides?: RequestInit): Promise { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/StoreApi.ts index d13b72accd19..c9553a693bf2 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/StoreApi.ts @@ -133,6 +133,7 @@ export class StoreApi extends runtime.BaseAPI { } /** + * * Place an order for a pet */ async placeOrderRaw(requestParameters: PlaceOrderRequest, initOverrides?: RequestInit): Promise> { @@ -158,6 +159,7 @@ export class StoreApi extends runtime.BaseAPI { } /** + * * Place an order for a pet */ async placeOrder(requestParameters: PlaceOrderRequest, initOverrides?: RequestInit): Promise { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/UserApi.ts index 5263414a0f08..262f809e28f4 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/UserApi.ts @@ -90,6 +90,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Creates list of users with given input array */ async createUsersWithArrayInputRaw(requestParameters: CreateUsersWithArrayInputRequest, initOverrides?: RequestInit): Promise> { @@ -115,6 +116,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Creates list of users with given input array */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest, initOverrides?: RequestInit): Promise { @@ -122,6 +124,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Creates list of users with given input array */ async createUsersWithListInputRaw(requestParameters: CreateUsersWithListInputRequest, initOverrides?: RequestInit): Promise> { @@ -147,6 +150,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Creates list of users with given input array */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest, initOverrides?: RequestInit): Promise { @@ -185,6 +189,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Get user by user name */ async getUserByNameRaw(requestParameters: GetUserByNameRequest, initOverrides?: RequestInit): Promise> { @@ -207,6 +212,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Get user by user name */ async getUserByName(requestParameters: GetUserByNameRequest, initOverrides?: RequestInit): Promise { @@ -215,6 +221,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Logs user into the system */ async loginUserRaw(requestParameters: LoginUserRequest, initOverrides?: RequestInit): Promise> { @@ -249,6 +256,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Logs user into the system */ async loginUser(requestParameters: LoginUserRequest, initOverrides?: RequestInit): Promise { @@ -257,6 +265,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Logs out current logged in user session */ async logoutUserRaw(initOverrides?: RequestInit): Promise> { @@ -275,6 +284,7 @@ export class UserApi extends runtime.BaseAPI { } /** + * * Logs out current logged in user session */ async logoutUser(initOverrides?: RequestInit): Promise { diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md index 740e5ee66833..b19c3dd9e27e 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md @@ -683,6 +683,8 @@ void (empty response body) test inline additionalProperties + + ### Example ```dart import 'package:openapi/api.dart'; @@ -723,6 +725,8 @@ No authorization required test json serialization of form data + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/PetApi.md index 6afc643ea56a..9ecef8bb7e14 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/PetApi.md @@ -25,6 +25,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```dart import 'package:openapi/api.dart'; @@ -67,6 +69,8 @@ void (empty response body) Deletes a pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -248,6 +252,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -290,6 +296,8 @@ void (empty response body) Updates a pet in the store with form data + + ### Example ```dart import 'package:openapi/api.dart'; @@ -336,6 +344,8 @@ void (empty response body) uploads an image + + ### Example ```dart import 'package:openapi/api.dart'; @@ -383,6 +393,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/StoreApi.md index 5c8a683579e2..6094dcc40182 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/StoreApi.md +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/StoreApi.md @@ -148,6 +148,8 @@ No authorization required Place an order for a pet + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/UserApi.md index e3af05ffb087..987932d8b821 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/UserApi.md +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/UserApi.md @@ -66,6 +66,8 @@ No authorization required Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -106,6 +108,8 @@ No authorization required Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -188,6 +192,8 @@ No authorization required Get user by user name + + ### Example ```dart import 'package:openapi/api.dart'; @@ -229,6 +235,8 @@ No authorization required Logs user into the system + + ### Example ```dart import 'package:openapi/api.dart'; @@ -272,6 +280,8 @@ No authorization required Logs out current logged in user session + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md index a93f8fe393b3..d2db92a01c6c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md @@ -24,6 +24,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```dart import 'package:openapi/api.dart'; @@ -67,6 +69,8 @@ Name | Type | Description | Notes Deletes a pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -248,6 +252,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -291,6 +297,8 @@ Name | Type | Description | Notes Updates a pet in the store with form data + + ### Example ```dart import 'package:openapi/api.dart'; @@ -337,6 +345,8 @@ void (empty response body) uploads an image + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md index fb3dddd9fb3c..9d71beeb3b94 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md @@ -148,6 +148,8 @@ No authorization required Place an order for a pet + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md index efb3cf578df7..623eb15a7043 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md @@ -70,6 +70,8 @@ void (empty response body) Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -114,6 +116,8 @@ void (empty response body) Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -204,6 +208,8 @@ void (empty response body) Get user by user name + + ### Example ```dart import 'package:openapi/api.dart'; @@ -245,6 +251,8 @@ No authorization required Logs user into the system + + ### Example ```dart import 'package:openapi/api.dart'; @@ -288,6 +296,8 @@ No authorization required Logs out current logged in user session + + ### Example ```dart import 'package:openapi/api.dart'; 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 46b337cdc187..e740e1d35cae 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 @@ -683,6 +683,8 @@ void (empty response body) test inline additionalProperties + + ### Example ```dart import 'package:openapi/api.dart'; @@ -723,6 +725,8 @@ No authorization required test json serialization of form data + + ### Example ```dart import 'package:openapi/api.dart'; 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 1a13704db188..bf21aac358d1 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 @@ -25,6 +25,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```dart import 'package:openapi/api.dart'; @@ -67,6 +69,8 @@ void (empty response body) Deletes a pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -248,6 +252,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -290,6 +296,8 @@ void (empty response body) Updates a pet in the store with form data + + ### Example ```dart import 'package:openapi/api.dart'; @@ -336,6 +344,8 @@ void (empty response body) uploads an image + + ### Example ```dart import 'package:openapi/api.dart'; @@ -383,6 +393,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```dart import 'package:openapi/api.dart'; 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 d1cc77910a9e..2cc00ccba609 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 @@ -148,6 +148,8 @@ No authorization required Place an order for a pet + + ### Example ```dart import 'package:openapi/api.dart'; 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 0ef486c0809f..f194f7c33242 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 @@ -66,6 +66,8 @@ No authorization required Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -106,6 +108,8 @@ No authorization required Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -188,6 +192,8 @@ No authorization required Get user by user name + + ### Example ```dart import 'package:openapi/api.dart'; @@ -229,6 +235,8 @@ No authorization required Logs user into the system + + ### Example ```dart import 'package:openapi/api.dart'; @@ -272,6 +280,8 @@ No authorization required Logs out current logged in user session + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/PetApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/PetApi.md index 3100f670bc78..267b97755bef 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/PetApi.md @@ -24,6 +24,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```dart import 'package:openapi/api.dart'; @@ -67,6 +69,8 @@ Name | Type | Description | Notes Deletes a pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -248,6 +252,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -291,6 +297,8 @@ Name | Type | Description | Notes Updates a pet in the store with form data + + ### Example ```dart import 'package:openapi/api.dart'; @@ -337,6 +345,8 @@ void (empty response body) uploads an image + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md index 1f0790985794..60f1f4d6f205 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md @@ -148,6 +148,8 @@ No authorization required Place an order for a pet + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/UserApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/UserApi.md index 7907143ecaa6..40038f680898 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/UserApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/UserApi.md @@ -70,6 +70,8 @@ void (empty response body) Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -114,6 +116,8 @@ void (empty response body) Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -204,6 +208,8 @@ void (empty response body) Get user by user name + + ### Example ```dart import 'package:openapi/api.dart'; @@ -245,6 +251,8 @@ No authorization required Logs user into the system + + ### Example ```dart import 'package:openapi/api.dart'; @@ -288,6 +296,8 @@ No authorization required Logs out current logged in user session + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/pet_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/pet_api.dart index b4ee176a9262..22858e953afa 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/pet_api.dart @@ -18,6 +18,8 @@ class PetApi { /// Add a new pet to the store /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -53,6 +55,8 @@ class PetApi { /// Add a new pet to the store /// + /// + /// /// Parameters: /// /// * [Pet] pet (required): @@ -74,6 +78,8 @@ class PetApi { /// Deletes a pet /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -116,6 +122,8 @@ class PetApi { /// Deletes a pet /// + /// + /// /// Parameters: /// /// * [int] petId (required): @@ -322,6 +330,8 @@ class PetApi { /// Update an existing pet /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -357,6 +367,8 @@ class PetApi { /// Update an existing pet /// + /// + /// /// Parameters: /// /// * [Pet] pet (required): @@ -378,6 +390,8 @@ class PetApi { /// Updates a pet in the store with form data /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -426,6 +440,8 @@ class PetApi { /// Updates a pet in the store with form data /// + /// + /// /// Parameters: /// /// * [int] petId (required): @@ -445,6 +461,8 @@ class PetApi { /// uploads an image /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -501,6 +519,8 @@ class PetApi { /// uploads an image /// + /// + /// /// Parameters: /// /// * [int] petId (required): diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/store_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/store_api.dart index dff1442125db..51b4b81fb0f5 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/store_api.dart @@ -182,6 +182,8 @@ class StoreApi { /// Place an order for a pet /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -217,6 +219,8 @@ class StoreApi { /// Place an order for a pet /// + /// + /// /// Parameters: /// /// * [Order] order (required): diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart index a479e0b1dd32..46eef79d505a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart @@ -70,6 +70,8 @@ class UserApi { /// Creates list of users with given input array /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -105,6 +107,8 @@ class UserApi { /// Creates list of users with given input array /// + /// + /// /// Parameters: /// /// * [List] user (required): @@ -118,6 +122,8 @@ class UserApi { /// Creates list of users with given input array /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -153,6 +159,8 @@ class UserApi { /// Creates list of users with given input array /// + /// + /// /// Parameters: /// /// * [List] user (required): @@ -219,6 +227,8 @@ class UserApi { /// Get user by user name /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -255,6 +265,8 @@ class UserApi { /// Get user by user name /// + /// + /// /// Parameters: /// /// * [String] username (required): @@ -276,6 +288,8 @@ class UserApi { /// Logs user into the system /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -317,6 +331,8 @@ class UserApi { /// Logs user into the system /// + /// + /// /// Parameters: /// /// * [String] username (required): @@ -341,6 +357,8 @@ class UserApi { /// Logs out current logged in user session /// + /// + /// /// Note: This method returns the HTTP [Response]. Future logoutUserWithHttpInfo() async { // ignore: prefer_const_declarations @@ -370,6 +388,8 @@ class UserApi { } /// Logs out current logged in user session + /// + /// Future logoutUser() async { final response = await logoutUserWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md index 869c513b1f26..5650cc2a6ebb 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md @@ -683,6 +683,8 @@ void (empty response body) test inline additionalProperties + + ### Example ```dart import 'package:openapi/api.dart'; @@ -723,6 +725,8 @@ No authorization required test json serialization of form data + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetApi.md index 387717e3f917..3883a9e96a00 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetApi.md @@ -25,6 +25,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```dart import 'package:openapi/api.dart'; @@ -67,6 +69,8 @@ void (empty response body) Deletes a pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -248,6 +252,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```dart import 'package:openapi/api.dart'; @@ -290,6 +296,8 @@ void (empty response body) Updates a pet in the store with form data + + ### Example ```dart import 'package:openapi/api.dart'; @@ -336,6 +344,8 @@ void (empty response body) uploads an image + + ### Example ```dart import 'package:openapi/api.dart'; @@ -383,6 +393,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/StoreApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/StoreApi.md index f43230375e7b..925f08c72d0b 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/StoreApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/StoreApi.md @@ -148,6 +148,8 @@ No authorization required Place an order for a pet + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/UserApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/UserApi.md index f318f92ccefd..ee26762d9336 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/UserApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/UserApi.md @@ -66,6 +66,8 @@ No authorization required Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -106,6 +108,8 @@ No authorization required Creates list of users with given input array + + ### Example ```dart import 'package:openapi/api.dart'; @@ -188,6 +192,8 @@ No authorization required Get user by user name + + ### Example ```dart import 'package:openapi/api.dart'; @@ -229,6 +235,8 @@ No authorization required Logs user into the system + + ### Example ```dart import 'package:openapi/api.dart'; @@ -272,6 +280,8 @@ No authorization required Logs out current logged in user session + + ### Example ```dart import 'package:openapi/api.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart index 9d260e34f124..be64e0d230e9 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart @@ -998,6 +998,8 @@ class FakeApi { /// test inline additionalProperties /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -1033,6 +1035,8 @@ class FakeApi { /// test inline additionalProperties /// + /// + /// /// Parameters: /// /// * [Map] requestBody (required): @@ -1046,6 +1050,8 @@ class FakeApi { /// test json serialization of form data /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -1090,6 +1096,8 @@ class FakeApi { /// test json serialization of form data /// + /// + /// /// Parameters: /// /// * [String] param (required): diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/pet_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/pet_api.dart index a91754608983..74d8ab2b059d 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/pet_api.dart @@ -18,6 +18,8 @@ class PetApi { /// Add a new pet to the store /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -53,6 +55,8 @@ class PetApi { /// Add a new pet to the store /// + /// + /// /// Parameters: /// /// * [Pet] pet (required): @@ -66,6 +70,8 @@ class PetApi { /// Deletes a pet /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -108,6 +114,8 @@ class PetApi { /// Deletes a pet /// + /// + /// /// Parameters: /// /// * [int] petId (required): @@ -314,6 +322,8 @@ class PetApi { /// Update an existing pet /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -349,6 +359,8 @@ class PetApi { /// Update an existing pet /// + /// + /// /// Parameters: /// /// * [Pet] pet (required): @@ -362,6 +374,8 @@ class PetApi { /// Updates a pet in the store with form data /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -410,6 +424,8 @@ class PetApi { /// Updates a pet in the store with form data /// + /// + /// /// Parameters: /// /// * [int] petId (required): @@ -429,6 +445,8 @@ class PetApi { /// uploads an image /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -485,6 +503,8 @@ class PetApi { /// uploads an image /// + /// + /// /// Parameters: /// /// * [int] petId (required): @@ -512,6 +532,8 @@ class PetApi { /// uploads an image (required) /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -568,6 +590,8 @@ class PetApi { /// uploads an image (required) /// + /// + /// /// Parameters: /// /// * [int] petId (required): diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/store_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/store_api.dart index 3cb580f1e197..ee1756bea39b 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/store_api.dart @@ -182,6 +182,8 @@ class StoreApi { /// Place an order for a pet /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -217,6 +219,8 @@ class StoreApi { /// Place an order for a pet /// + /// + /// /// Parameters: /// /// * [Order] order (required): diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/user_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/user_api.dart index 7cc0b7e18224..dec46b87bd84 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/user_api.dart @@ -70,6 +70,8 @@ class UserApi { /// Creates list of users with given input array /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -105,6 +107,8 @@ class UserApi { /// Creates list of users with given input array /// + /// + /// /// Parameters: /// /// * [List] user (required): @@ -118,6 +122,8 @@ class UserApi { /// Creates list of users with given input array /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -153,6 +159,8 @@ class UserApi { /// Creates list of users with given input array /// + /// + /// /// Parameters: /// /// * [List] user (required): @@ -219,6 +227,8 @@ class UserApi { /// Get user by user name /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -255,6 +265,8 @@ class UserApi { /// Get user by user name /// + /// + /// /// Parameters: /// /// * [String] username (required): @@ -276,6 +288,8 @@ class UserApi { /// Logs user into the system /// + /// + /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: @@ -317,6 +331,8 @@ class UserApi { /// Logs user into the system /// + /// + /// /// Parameters: /// /// * [String] username (required): @@ -341,6 +357,8 @@ class UserApi { /// Logs out current logged in user session /// + /// + /// /// Note: This method returns the HTTP [Response]. Future logoutUserWithHttpInfo() async { // ignore: prefer_const_declarations @@ -370,6 +388,8 @@ class UserApi { } /// Logs out current logged in user session + /// + /// Future logoutUser() async { final response = await logoutUserWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index c9e81a15800f..46269e0ec1a9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -64,6 +64,7 @@ paths: description: not found /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -79,6 +80,7 @@ paths: tags: - pet put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -188,6 +190,7 @@ paths: - pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -249,6 +252,7 @@ paths: tags: - pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -285,6 +289,7 @@ paths: - pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -345,6 +350,7 @@ paths: - store /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -442,6 +448,7 @@ paths: - user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -453,6 +460,7 @@ paths: - user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -464,6 +472,7 @@ paths: - user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -514,6 +523,7 @@ paths: - user /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -543,6 +553,7 @@ paths: tags: - user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. @@ -983,6 +994,7 @@ paths: - fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: $ref: '#/components/requestBodies/inline_object_4' @@ -1008,6 +1020,7 @@ paths: - fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1172,6 +1185,7 @@ paths: - fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 3e92f36f24eb..dcef3ab3652b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -176,6 +176,8 @@ type FakeApi interface { /* TestInlineAdditionalProperties test inline additionalProperties + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestInlineAdditionalPropertiesRequest */ @@ -187,6 +189,8 @@ type FakeApi interface { /* TestJsonFormData test json serialization of form data + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestJsonFormDataRequest */ @@ -1680,6 +1684,8 @@ func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*http.Response, err /* TestInlineAdditionalProperties test inline additionalProperties + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestInlineAdditionalPropertiesRequest */ @@ -1785,6 +1791,8 @@ func (r ApiTestJsonFormDataRequest) Execute() (*http.Response, error) { /* TestJsonFormData test json serialization of form data + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestJsonFormDataRequest */ diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index dcd0fb584290..1d50da9d7b19 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -26,6 +26,8 @@ type PetApi interface { /* AddPet Add a new pet to the store + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAddPetRequest */ @@ -37,6 +39,8 @@ type PetApi interface { /* DeletePet Deletes a pet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId Pet id to delete @return ApiDeletePetRequest @@ -95,6 +99,8 @@ type PetApi interface { /* UpdatePet Update an existing pet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiUpdatePetRequest */ @@ -106,6 +112,8 @@ type PetApi interface { /* UpdatePetWithForm Updates a pet in the store with form data + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet that needs to be updated @return ApiUpdatePetWithFormRequest @@ -118,6 +126,8 @@ type PetApi interface { /* UploadFile uploads an image + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileRequest @@ -131,6 +141,8 @@ type PetApi interface { /* UploadFileWithRequiredFile uploads an image (required) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileWithRequiredFileRequest @@ -164,6 +176,8 @@ func (r ApiAddPetRequest) Execute() (*http.Response, error) { /* AddPet Add a new pet to the store + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAddPetRequest */ @@ -262,6 +276,8 @@ func (r ApiDeletePetRequest) Execute() (*http.Response, error) { /* DeletePet Deletes a pet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId Pet id to delete @return ApiDeletePetRequest @@ -702,6 +718,8 @@ func (r ApiUpdatePetRequest) Execute() (*http.Response, error) { /* UpdatePet Update an existing pet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiUpdatePetRequest */ @@ -808,6 +826,8 @@ func (r ApiUpdatePetWithFormRequest) Execute() (*http.Response, error) { /* UpdatePetWithForm Updates a pet in the store with form data + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet that needs to be updated @return ApiUpdatePetWithFormRequest @@ -918,6 +938,8 @@ func (r ApiUploadFileRequest) Execute() (*ApiResponse, *http.Response, error) { /* UploadFile uploads an image + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileRequest @@ -1053,6 +1075,8 @@ func (r ApiUploadFileWithRequiredFileRequest) Execute() (*ApiResponse, *http.Res /* UploadFileWithRequiredFile uploads an image (required) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileWithRequiredFileRequest diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index 5ff7698faa4a..a33165238663 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -68,6 +68,8 @@ type StoreApi interface { /* PlaceOrder Place an order for a pet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiPlaceOrderRequest */ @@ -414,6 +416,8 @@ func (r ApiPlaceOrderRequest) Execute() (*Order, *http.Response, error) { /* PlaceOrder Place an order for a pet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiPlaceOrderRequest */ diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index 0ea539c457e5..0ac28a9deefc 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -38,6 +38,8 @@ type UserApi interface { /* CreateUsersWithArrayInput Creates list of users with given input array + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithArrayInputRequest */ @@ -49,6 +51,8 @@ type UserApi interface { /* CreateUsersWithListInput Creates list of users with given input array + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithListInputRequest */ @@ -74,6 +78,8 @@ type UserApi interface { /* GetUserByName Get user by user name + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be fetched. Use user1 for testing. @return ApiGetUserByNameRequest @@ -87,6 +93,8 @@ type UserApi interface { /* LoginUser Logs user into the system + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLoginUserRequest */ @@ -99,6 +107,8 @@ type UserApi interface { /* LogoutUser Logs out current logged in user session + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLogoutUserRequest */ @@ -244,6 +254,8 @@ func (r ApiCreateUsersWithArrayInputRequest) Execute() (*http.Response, error) { /* CreateUsersWithArrayInput Creates list of users with given input array + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithArrayInputRequest */ @@ -342,6 +354,8 @@ func (r ApiCreateUsersWithListInputRequest) Execute() (*http.Response, error) { /* CreateUsersWithListInput Creates list of users with given input array + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithListInputRequest */ @@ -526,6 +540,8 @@ func (r ApiGetUserByNameRequest) Execute() (*User, *http.Response, error) { /* GetUserByName Get user by user name + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be fetched. Use user1 for testing. @return ApiGetUserByNameRequest @@ -640,6 +656,8 @@ func (r ApiLoginUserRequest) Execute() (string, *http.Response, error) { /* LoginUser Logs user into the system + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLoginUserRequest */ @@ -745,6 +763,8 @@ func (r ApiLogoutUserRequest) Execute() (*http.Response, error) { /* LogoutUser Logs out current logged in user session + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLogoutUserRequest */ diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md index 13ee6ee52efa..bc168c13b0e6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md @@ -788,6 +788,8 @@ Name | Type | Description | Notes test inline additionalProperties + + ### Example ```go @@ -850,6 +852,8 @@ No authorization required test json serialization of form data + + ### Example ```go diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md index c0522b43c9af..24b558097a74 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md @@ -22,6 +22,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```go @@ -84,6 +86,8 @@ Name | Type | Description | Notes Deletes a pet + + ### Example ```go @@ -354,6 +358,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```go @@ -416,6 +422,8 @@ Name | Type | Description | Notes Updates a pet in the store with form data + + ### Example ```go @@ -486,6 +494,8 @@ Name | Type | Description | Notes uploads an image + + ### Example ```go @@ -558,6 +568,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```go diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md index 70c0692ef118..6c983337f6d6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md @@ -216,6 +216,8 @@ No authorization required Place an order for a pet + + ### Example ```go diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md index 3176eadbd76a..28333793270e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md @@ -85,6 +85,8 @@ No authorization required Creates list of users with given input array + + ### Example ```go @@ -147,6 +149,8 @@ No authorization required Creates list of users with given input array + + ### Example ```go @@ -277,6 +281,8 @@ No authorization required Get user by user name + + ### Example ```go @@ -345,6 +351,8 @@ No authorization required Logs user into the system + + ### Example ```go @@ -411,6 +419,8 @@ No authorization required Logs out current logged in user session + + ### Example ```go diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml index 873b76e7c3a9..3511da6146dc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -53,6 +53,7 @@ paths: x-accepts: application/json /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -70,6 +71,7 @@ paths: x-contentType: application/json x-accepts: application/json put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -183,6 +185,7 @@ paths: x-accepts: application/json /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -246,6 +249,7 @@ paths: - pet x-accepts: application/json post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -284,6 +288,7 @@ paths: x-accepts: application/json /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -347,6 +352,7 @@ paths: x-accepts: application/json /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -450,6 +456,7 @@ paths: x-accepts: application/json /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -463,6 +470,7 @@ paths: x-accepts: application/json /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -476,6 +484,7 @@ paths: x-accepts: application/json /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -527,6 +536,7 @@ paths: x-accepts: application/json /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -558,6 +568,7 @@ paths: - user x-accepts: application/json get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. @@ -1020,6 +1031,7 @@ paths: x-accepts: '*/*' /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: $ref: '#/components/requestBodies/inline_object_4' @@ -1047,6 +1059,7 @@ paths: x-accepts: application/json /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1183,6 +1196,7 @@ paths: x-accepts: application/json /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md index ababec062295..f8e6c3b1dde6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -870,6 +870,8 @@ null (empty response body) test inline additionalProperties + + ### Example ```java @@ -932,6 +934,8 @@ No authorization required test json serialization of form data + + ### Example ```java diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md index b45e63a3a77f..618243bc0091 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md @@ -22,6 +22,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example ```java @@ -90,6 +92,8 @@ null (empty response body) Deletes a pet + + ### Example ```java @@ -377,6 +381,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example ```java @@ -447,6 +453,8 @@ null (empty response body) Updates a pet in the store with form data + + ### Example ```java @@ -518,6 +526,8 @@ null (empty response body) uploads an image + + ### Example ```java @@ -591,6 +601,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example ```java diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md index 5f95c2a8d37a..ba96d7f61a7e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md @@ -217,6 +217,8 @@ No authorization required Place an order for a pet + + ### Example ```java diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md index 49d31db2ee2c..a05412e98096 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md @@ -85,6 +85,8 @@ No authorization required Creates list of users with given input array + + ### Example ```java @@ -147,6 +149,8 @@ No authorization required Creates list of users with given input array + + ### Example ```java @@ -274,6 +278,8 @@ No authorization required Get user by user name + + ### Example ```java @@ -339,6 +345,8 @@ No authorization required Logs user into the system + + ### Example ```java @@ -405,6 +413,8 @@ No authorization required Logs out current logged in user session + + ### Example ```java diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md index 1419c735f3c2..4e676ae4d535 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md @@ -1,6 +1,6 @@ # NullableShape -The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. For a nullable composed schema to work, one of its chosen oneOf schemas must be type null +The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) #### Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index a219893fbaa1..9e7f7c3085d1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -71,19 +71,9 @@ class NullableShape( Do not edit the class manually. - The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. For a nullable composed schema to work, one of its chosen oneOf schemas must be type null + The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) """ - @classmethod - @property - def _discriminator(cls): - return { - 'shapeType': { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - } - @classmethod @property def _composed_schemas(cls): diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md index 0bf51adc9e55..64963e785160 100755 --- a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md @@ -1014,6 +1014,8 @@ void (empty response body) test inline additionalProperties + + ### Example ```python @@ -1073,6 +1075,8 @@ No authorization required test json serialization of form data + + ### Example ```python diff --git a/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md b/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md index 0472f7c000aa..ff644b76a8e6 100755 --- a/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md @@ -20,6 +20,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example * OAuth Authentication (petstore_auth): @@ -91,6 +93,8 @@ void (empty response body) Deletes a pet + + ### Example * OAuth Authentication (petstore_auth): @@ -387,6 +391,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example * OAuth Authentication (petstore_auth): @@ -460,6 +466,8 @@ void (empty response body) Updates a pet in the store with form data + + ### Example * OAuth Authentication (petstore_auth): @@ -535,6 +543,8 @@ void (empty response body) uploads an image + + ### Example * OAuth Authentication (petstore_auth): @@ -610,6 +620,8 @@ Name | Type | Description | Notes uploads an image (required) + + ### Example * OAuth Authentication (petstore_auth): diff --git a/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md b/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md index 6704d5844be7..90846d98d5af 100755 --- a/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-legacy/docs/StoreApi.md @@ -210,6 +210,8 @@ No authorization required Place an order for a pet + + ### Example ```python diff --git a/samples/openapi3/client/petstore/python-legacy/docs/UserApi.md b/samples/openapi3/client/petstore/python-legacy/docs/UserApi.md index 32a62c8add92..f5ad4ab78fb9 100755 --- a/samples/openapi3/client/petstore/python-legacy/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-legacy/docs/UserApi.md @@ -80,6 +80,8 @@ No authorization required Creates list of users with given input array + + ### Example ```python @@ -139,6 +141,8 @@ No authorization required Creates list of users with given input array + + ### Example ```python @@ -260,6 +264,8 @@ No authorization required Get user by user name + + ### Example ```python @@ -322,6 +328,8 @@ No authorization required Logs user into the system + + ### Example ```python @@ -385,6 +393,8 @@ No authorization required Logs out current logged in user session + + ### Example ```python diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py index 91d684ae47f3..fb9e0b370c14 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -2211,6 +2211,7 @@ def test_group_parameters_with_http_info(self, required_string_group, required_b def test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501 """test inline additionalProperties # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2240,6 +2241,7 @@ def test_inline_additional_properties(self, request_body, **kwargs): # noqa: E5 def test_inline_additional_properties_with_http_info(self, request_body, **kwargs): # noqa: E501 """test inline additionalProperties # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2347,6 +2349,7 @@ def test_inline_additional_properties_with_http_info(self, request_body, **kwarg def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 """test json serialization of form data # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2378,6 +2381,7 @@ def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 """test json serialization of form data # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py index 2fda30914a7f..fe2827a9f675 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py @@ -39,6 +39,7 @@ def __init__(self, api_client=None): def add_pet(self, pet, **kwargs): # noqa: E501 """Add a new pet to the store # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -68,6 +69,7 @@ def add_pet(self, pet, **kwargs): # noqa: E501 def add_pet_with_http_info(self, pet, **kwargs): # noqa: E501 """Add a new pet to the store # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -189,6 +191,7 @@ def add_pet_with_http_info(self, pet, **kwargs): # noqa: E501 def delete_pet(self, pet_id, **kwargs): # noqa: E501 """Deletes a pet # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -220,6 +223,7 @@ def delete_pet(self, pet_id, **kwargs): # noqa: E501 def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 """Deletes a pet # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -746,6 +750,7 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 def update_pet(self, pet, **kwargs): # noqa: E501 """Update an existing pet # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -775,6 +780,7 @@ def update_pet(self, pet, **kwargs): # noqa: E501 def update_pet_with_http_info(self, pet, **kwargs): # noqa: E501 """Update an existing pet # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -896,6 +902,7 @@ def update_pet_with_http_info(self, pet, **kwargs): # noqa: E501 def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 """Updates a pet in the store with form data # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -929,6 +936,7 @@ def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 """Updates a pet in the store with form data # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1046,6 +1054,7 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 def upload_file(self, pet_id, **kwargs): # noqa: E501 """uploads an image # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1079,6 +1088,7 @@ def upload_file(self, pet_id, **kwargs): # noqa: E501 def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 """uploads an image # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1202,6 +1212,7 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 """uploads an image (required) # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1235,6 +1246,7 @@ def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # no def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501 """uploads an image (required) # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py index 5b8296dfbeb0..c46b770c8244 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py @@ -442,6 +442,7 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 def place_order(self, order, **kwargs): # noqa: E501 """Place an order for a pet # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -471,6 +472,7 @@ def place_order(self, order, **kwargs): # noqa: E501 def place_order_with_http_info(self, order, **kwargs): # noqa: E501 """Place an order for a pet # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py index d634bad956b9..996d60a99141 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py @@ -177,6 +177,7 @@ def create_user_with_http_info(self, user, **kwargs): # noqa: E501 def create_users_with_array_input(self, user, **kwargs): # noqa: E501 """Creates list of users with given input array # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -206,6 +207,7 @@ def create_users_with_array_input(self, user, **kwargs): # noqa: E501 def create_users_with_array_input_with_http_info(self, user, **kwargs): # noqa: E501 """Creates list of users with given input array # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -313,6 +315,7 @@ def create_users_with_array_input_with_http_info(self, user, **kwargs): # noqa: def create_users_with_list_input(self, user, **kwargs): # noqa: E501 """Creates list of users with given input array # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -342,6 +345,7 @@ def create_users_with_list_input(self, user, **kwargs): # noqa: E501 def create_users_with_list_input_with_http_info(self, user, **kwargs): # noqa: E501 """Creates list of users with given input array # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -581,6 +585,7 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 def get_user_by_name(self, username, **kwargs): # noqa: E501 """Get user by user name # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -610,6 +615,7 @@ def get_user_by_name(self, username, **kwargs): # noqa: E501 def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 """Get user by user name # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -719,6 +725,7 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 def login_user(self, username, password, **kwargs): # noqa: E501 """Logs user into the system # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -750,6 +757,7 @@ def login_user(self, username, password, **kwargs): # noqa: E501 def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 """Logs user into the system # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -867,6 +875,7 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 def logout_user(self, **kwargs): # noqa: E501 """Logs out current logged in user session # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -894,6 +903,7 @@ def logout_user(self, **kwargs): # noqa: E501 def logout_user_with_http_info(self, **kwargs): # noqa: E501 """Logs out current logged in user session # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 57114615c444..17d46f8ba1c5 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -1583,6 +1583,8 @@ void (empty response body) test inline additionalProperties + + ### Example @@ -1648,6 +1650,8 @@ No authorization required test json serialization of form data + + ### Example @@ -1860,6 +1864,8 @@ No authorization required uploads a file and downloads a file using application/octet-stream + + ### Example @@ -1924,6 +1930,8 @@ No authorization required uploads a file using multipart/form-data + + ### Example @@ -2000,6 +2008,8 @@ No authorization required uploads files using multipart/form-data + + ### Example diff --git a/samples/openapi3/client/petstore/python/docs/InlineResponse200.md b/samples/openapi3/client/petstore/python/docs/InlineResponse200.md new file mode 100644 index 000000000000..659957b26ddc --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/InlineResponse200.md @@ -0,0 +1,13 @@ +# InlineResponse200 + +this payload is used for verification that some model_to_dict issues are fixed + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_data** | [**[FakePostInlineAdditionalPropertiesPayloadArrayData], none_type**](FakePostInlineAdditionalPropertiesPayloadArrayData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/docs/PetApi.md b/samples/openapi3/client/petstore/python/docs/PetApi.md index 007214141133..381626e89ded 100644 --- a/samples/openapi3/client/petstore/python/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python/docs/PetApi.md @@ -18,6 +18,8 @@ Method | HTTP request | Description Add a new pet to the store + + ### Example * OAuth Authentication (petstore_auth): @@ -170,6 +172,8 @@ void (empty response body) Deletes a pet + + ### Example * OAuth Authentication (petstore_auth): @@ -614,6 +618,8 @@ Name | Type | Description | Notes Update an existing pet + + ### Example * OAuth Authentication (petstore_auth): @@ -768,6 +774,8 @@ void (empty response body) Updates a pet in the store with form data + + ### Example * OAuth Authentication (petstore_auth): diff --git a/samples/openapi3/client/petstore/python/docs/StoreApi.md b/samples/openapi3/client/petstore/python/docs/StoreApi.md index 36d2367cd29e..13d1c6d2a5e1 100644 --- a/samples/openapi3/client/petstore/python/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python/docs/StoreApi.md @@ -223,6 +223,8 @@ No authorization required Place an order for a pet + + ### Example diff --git a/samples/openapi3/client/petstore/python/docs/UserApi.md b/samples/openapi3/client/petstore/python/docs/UserApi.md index 5411ecef2af2..a2e2325092c0 100644 --- a/samples/openapi3/client/petstore/python/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python/docs/UserApi.md @@ -98,6 +98,8 @@ No authorization required Creates list of users with given input array + + ### Example @@ -177,6 +179,8 @@ No authorization required Creates list of users with given input array + + ### Example @@ -322,6 +326,8 @@ No authorization required Get user by user name + + ### Example @@ -389,6 +395,8 @@ No authorization required Logs user into the system + + ### Example @@ -456,6 +464,8 @@ No authorization required Logs out current logged in user session + + ### Example diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 9ebd02954cfa..4067bbc9464c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -3314,6 +3314,7 @@ def test_inline_additional_properties( ): """test inline additionalProperties # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3392,6 +3393,7 @@ def test_json_form_data( ): """test json serialization of form data # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3639,6 +3641,7 @@ def upload_download_file( ): """uploads a file and downloads a file using application/octet-stream # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3716,6 +3719,7 @@ def upload_file( ): """uploads a file using multipart/form-data # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3793,6 +3797,7 @@ def upload_files( ): """uploads files using multipart/form-data # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index 2f87475abf7c..bb8bebf03839 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -447,6 +447,7 @@ def add_pet( ): """Add a new pet to the store # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -524,6 +525,7 @@ def delete_pet( ): """Deletes a pet # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -836,6 +838,7 @@ def update_pet( ): """Update an existing pet # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -913,6 +916,7 @@ def update_pet_with_form( ): """Updates a pet in the store with form data # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index f5f1d16cbeed..d31348f08596 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -470,6 +470,7 @@ def place_order( ): """Place an order for a pet # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 81bcdeb6d867..4f5b6e366272 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -512,6 +512,7 @@ def create_users_with_array_input( ): """Creates list of users with given input array # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -589,6 +590,7 @@ def create_users_with_list_input( ): """Creates list of users with given input array # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -744,6 +746,7 @@ def get_user_by_name( ): """Get user by user name # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -822,6 +825,7 @@ def login_user( ): """Logs user into the system # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -901,6 +905,7 @@ def logout_user( ): """Logs out current logged in user session # noqa: E501 + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index d1dec5e38788..53a4dbe30ad4 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -37,6 +37,7 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -70,6 +71,7 @@ ResponseEntity addPet( /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -200,6 +202,7 @@ ResponseEntity getPetById( /** * PUT /pet : Update an existing pet + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -237,6 +240,7 @@ ResponseEntity updatePet( /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -268,6 +272,7 @@ ResponseEntity updatePetWithForm( /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index f4bc1148a865..17e53e217f67 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -124,6 +124,7 @@ ResponseEntity getOrderById( /** * POST /store/order : Place an order for a pet + * * * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index d231b4116771..83552da50a15 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -66,6 +66,7 @@ ResponseEntity createUser( /** * POST /user/createWithArray : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -93,6 +94,7 @@ ResponseEntity createUsersWithArrayInput( /** * POST /user/createWithList : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -149,6 +151,7 @@ ResponseEntity deleteUser( /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -180,6 +183,7 @@ ResponseEntity getUserByName( /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -211,6 +215,7 @@ ResponseEntity loginUser( /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ diff --git a/samples/openapi3/client/petstore/typescript/builds/default/PetApi.md b/samples/openapi3/client/petstore/typescript/builds/default/PetApi.md index 2fe727d84fab..2aac946907bb 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/PetApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/default/PetApi.md @@ -18,6 +18,7 @@ Method | HTTP request | Description > Pet addPet(pet) + ### Example @@ -89,6 +90,7 @@ Name | Type | Description | Notes > deletePet() + ### Example @@ -315,6 +317,7 @@ Name | Type | Description | Notes > Pet updatePet(pet) + ### Example @@ -388,6 +391,7 @@ Name | Type | Description | Notes > updatePetWithForm() + ### Example @@ -447,6 +451,7 @@ void (empty response body) > ApiResponse uploadFile() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/default/StoreApi.md b/samples/openapi3/client/petstore/typescript/builds/default/StoreApi.md index b2a63f782194..9dfad28caff6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/StoreApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/default/StoreApi.md @@ -173,6 +173,7 @@ No authorization required > Order placeOrder(order) + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/default/UserApi.md b/samples/openapi3/client/petstore/typescript/builds/default/UserApi.md index 3aa75a41422c..c18f5d948960 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/UserApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/default/UserApi.md @@ -81,6 +81,7 @@ void (empty response body) > createUsersWithArrayInput(user) + ### Example @@ -145,6 +146,7 @@ void (empty response body) > createUsersWithListInput(user) + ### Example @@ -264,6 +266,7 @@ void (empty response body) > User getUserByName() + ### Example @@ -319,6 +322,7 @@ No authorization required > string loginUser() + ### Example @@ -376,6 +380,7 @@ No authorization required > logoutUser() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts index e85797baebc1..3dec522f6eea 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts @@ -19,6 +19,7 @@ import { Pet } from '../models/Pet'; export class PetApiRequestFactory extends BaseAPIRequestFactory { /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -68,6 +69,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -232,6 +234,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -281,6 +284,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -351,6 +355,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts index 821e181892ba..e26ee9a00b1c 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts @@ -112,6 +112,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts index 9a87f64e9c58..ede979aad465 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts @@ -66,6 +66,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -113,6 +114,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -198,6 +200,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -229,6 +232,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -276,6 +280,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs out current logged in user session */ public async logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts index a590e3ca4923..bad3c9fc25ff 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts @@ -122,6 +122,7 @@ export class ObjectPetApi { } /** + * * Add a new pet to the store * @param param the request object */ @@ -130,6 +131,7 @@ export class ObjectPetApi { } /** + * * Deletes a pet * @param param the request object */ @@ -165,6 +167,7 @@ export class ObjectPetApi { } /** + * * Update an existing pet * @param param the request object */ @@ -173,6 +176,7 @@ export class ObjectPetApi { } /** + * * Updates a pet in the store with form data * @param param the request object */ @@ -181,6 +185,7 @@ export class ObjectPetApi { } /** + * * uploads an image * @param param the request object */ @@ -258,6 +263,7 @@ export class ObjectStoreApi { } /** + * * Place an order for a pet * @param param the request object */ @@ -365,6 +371,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -373,6 +380,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -390,6 +398,7 @@ export class ObjectUserApi { } /** + * * Get user by user name * @param param the request object */ @@ -398,6 +407,7 @@ export class ObjectUserApi { } /** + * * Logs user into the system * @param param the request object */ @@ -406,6 +416,7 @@ export class ObjectUserApi { } /** + * * Logs out current logged in user session * @param param the request object */ diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts index 4207fd5102dc..74f57a7e1c7c 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts @@ -27,6 +27,7 @@ export class ObservablePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -50,6 +51,7 @@ export class ObservablePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -146,6 +148,7 @@ export class ObservablePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -169,6 +172,7 @@ export class ObservablePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -194,6 +198,7 @@ export class ObservablePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -308,6 +313,7 @@ export class ObservableStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -373,6 +379,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -396,6 +403,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -443,6 +451,7 @@ export class ObservableUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -466,6 +475,7 @@ export class ObservableUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -490,6 +500,7 @@ export class ObservableUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Observable { diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts index ac44ba7a13b2..92d57b673df0 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts @@ -23,6 +23,7 @@ export class PromisePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -32,6 +33,7 @@ export class PromisePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -72,6 +74,7 @@ export class PromisePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -81,6 +84,7 @@ export class PromisePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -92,6 +96,7 @@ export class PromisePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -151,6 +156,7 @@ export class PromiseStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -189,6 +195,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -198,6 +205,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -217,6 +225,7 @@ export class PromiseUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -226,6 +235,7 @@ export class PromiseUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -236,6 +246,7 @@ export class PromiseUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/PetApi.md b/samples/openapi3/client/petstore/typescript/builds/deno/PetApi.md index 2fe727d84fab..2aac946907bb 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/PetApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/deno/PetApi.md @@ -18,6 +18,7 @@ Method | HTTP request | Description > Pet addPet(pet) + ### Example @@ -89,6 +90,7 @@ Name | Type | Description | Notes > deletePet() + ### Example @@ -315,6 +317,7 @@ Name | Type | Description | Notes > Pet updatePet(pet) + ### Example @@ -388,6 +391,7 @@ Name | Type | Description | Notes > updatePetWithForm() + ### Example @@ -447,6 +451,7 @@ void (empty response body) > ApiResponse uploadFile() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/StoreApi.md b/samples/openapi3/client/petstore/typescript/builds/deno/StoreApi.md index b2a63f782194..9dfad28caff6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/StoreApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/deno/StoreApi.md @@ -173,6 +173,7 @@ No authorization required > Order placeOrder(order) + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/UserApi.md b/samples/openapi3/client/petstore/typescript/builds/deno/UserApi.md index 3aa75a41422c..c18f5d948960 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/UserApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/deno/UserApi.md @@ -81,6 +81,7 @@ void (empty response body) > createUsersWithArrayInput(user) + ### Example @@ -145,6 +146,7 @@ void (empty response body) > createUsersWithListInput(user) + ### Example @@ -264,6 +266,7 @@ void (empty response body) > User getUserByName() + ### Example @@ -319,6 +322,7 @@ No authorization required > string loginUser() + ### Example @@ -376,6 +380,7 @@ No authorization required > logoutUser() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts index f11b208baf24..87599b496251 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts @@ -17,6 +17,7 @@ import { Pet } from '../models/Pet.ts'; export class PetApiRequestFactory extends BaseAPIRequestFactory { /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -66,6 +67,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -230,6 +232,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -279,6 +282,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -349,6 +353,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts index f83700b35cfb..8dc5b78b09d2 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts @@ -110,6 +110,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts index f2de9aeb598a..a286e69e89ca 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts @@ -64,6 +64,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -111,6 +112,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -196,6 +198,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -227,6 +230,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -274,6 +278,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs out current logged in user session */ public async logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts index a6988e3ef191..02d096f08be4 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts @@ -122,6 +122,7 @@ export class ObjectPetApi { } /** + * * Add a new pet to the store * @param param the request object */ @@ -130,6 +131,7 @@ export class ObjectPetApi { } /** + * * Deletes a pet * @param param the request object */ @@ -165,6 +167,7 @@ export class ObjectPetApi { } /** + * * Update an existing pet * @param param the request object */ @@ -173,6 +176,7 @@ export class ObjectPetApi { } /** + * * Updates a pet in the store with form data * @param param the request object */ @@ -181,6 +185,7 @@ export class ObjectPetApi { } /** + * * uploads an image * @param param the request object */ @@ -258,6 +263,7 @@ export class ObjectStoreApi { } /** + * * Place an order for a pet * @param param the request object */ @@ -365,6 +371,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -373,6 +380,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -390,6 +398,7 @@ export class ObjectUserApi { } /** + * * Get user by user name * @param param the request object */ @@ -398,6 +407,7 @@ export class ObjectUserApi { } /** + * * Logs user into the system * @param param the request object */ @@ -406,6 +416,7 @@ export class ObjectUserApi { } /** + * * Logs out current logged in user session * @param param the request object */ diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts index ff6f2d0869bb..f89d38c2f213 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts @@ -27,6 +27,7 @@ export class ObservablePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -50,6 +51,7 @@ export class ObservablePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -146,6 +148,7 @@ export class ObservablePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -169,6 +172,7 @@ export class ObservablePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -194,6 +198,7 @@ export class ObservablePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -308,6 +313,7 @@ export class ObservableStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -373,6 +379,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -396,6 +403,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -443,6 +451,7 @@ export class ObservableUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -466,6 +475,7 @@ export class ObservableUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -490,6 +500,7 @@ export class ObservableUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Observable { diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts index 76db56cbc8bd..46e4a7844050 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts @@ -23,6 +23,7 @@ export class PromisePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -32,6 +33,7 @@ export class PromisePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -72,6 +74,7 @@ export class PromisePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -81,6 +84,7 @@ export class PromisePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -92,6 +96,7 @@ export class PromisePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -151,6 +156,7 @@ export class PromiseStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -189,6 +195,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -198,6 +205,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -217,6 +225,7 @@ export class PromiseUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -226,6 +235,7 @@ export class PromiseUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -236,6 +246,7 @@ export class PromiseUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/PetApi.md b/samples/openapi3/client/petstore/typescript/builds/inversify/PetApi.md index 2fe727d84fab..2aac946907bb 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/PetApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/PetApi.md @@ -18,6 +18,7 @@ Method | HTTP request | Description > Pet addPet(pet) + ### Example @@ -89,6 +90,7 @@ Name | Type | Description | Notes > deletePet() + ### Example @@ -315,6 +317,7 @@ Name | Type | Description | Notes > Pet updatePet(pet) + ### Example @@ -388,6 +391,7 @@ Name | Type | Description | Notes > updatePetWithForm() + ### Example @@ -447,6 +451,7 @@ void (empty response body) > ApiResponse uploadFile() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/StoreApi.md b/samples/openapi3/client/petstore/typescript/builds/inversify/StoreApi.md index b2a63f782194..9dfad28caff6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/StoreApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/StoreApi.md @@ -173,6 +173,7 @@ No authorization required > Order placeOrder(order) + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/UserApi.md b/samples/openapi3/client/petstore/typescript/builds/inversify/UserApi.md index 3aa75a41422c..c18f5d948960 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/UserApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/UserApi.md @@ -81,6 +81,7 @@ void (empty response body) > createUsersWithArrayInput(user) + ### Example @@ -145,6 +146,7 @@ void (empty response body) > createUsersWithListInput(user) + ### Example @@ -264,6 +266,7 @@ void (empty response body) > User getUserByName() + ### Example @@ -319,6 +322,7 @@ No authorization required > string loginUser() + ### Example @@ -376,6 +380,7 @@ No authorization required > logoutUser() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts index 81a75d96bcec..cb12d2bdd80e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts @@ -21,6 +21,7 @@ import { Pet } from '../models/Pet'; export class PetApiRequestFactory extends BaseAPIRequestFactory { /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -66,6 +67,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -214,6 +216,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -259,6 +262,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -325,6 +329,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts index 4115b9dc6d9e..b3273a793f2f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts @@ -102,6 +102,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts index 124034df9888..71c9ce26b5af 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts @@ -64,6 +64,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -107,6 +108,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -184,6 +186,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -211,6 +214,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -254,6 +258,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs out current logged in user session */ public async logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObjectParamAPI.ts index d0cdd02e78de..87e9efed41db 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObjectParamAPI.ts @@ -12,12 +12,14 @@ import type { User } from '../models/User'; export abstract class AbstractObjectPetApi { /** + * * Add a new pet to the store * @param param the request object */ public abstract addPet(param: req.PetApiAddPetRequest, options?: Configuration): Promise; /** + * * Deletes a pet * @param param the request object */ @@ -45,18 +47,21 @@ export abstract class AbstractObjectPetApi { public abstract getPetById(param: req.PetApiGetPetByIdRequest, options?: Configuration): Promise; /** + * * Update an existing pet * @param param the request object */ public abstract updatePet(param: req.PetApiUpdatePetRequest, options?: Configuration): Promise; /** + * * Updates a pet in the store with form data * @param param the request object */ public abstract updatePetWithForm(param: req.PetApiUpdatePetWithFormRequest, options?: Configuration): Promise; /** + * * uploads an image * @param param the request object */ @@ -88,6 +93,7 @@ export abstract class AbstractObjectStoreApi { public abstract getOrderById(param: req.StoreApiGetOrderByIdRequest, options?: Configuration): Promise; /** + * * Place an order for a pet * @param param the request object */ @@ -105,12 +111,14 @@ export abstract class AbstractObjectUserApi { public abstract createUser(param: req.UserApiCreateUserRequest, options?: Configuration): Promise; /** + * * Creates list of users with given input array * @param param the request object */ public abstract createUsersWithArrayInput(param: req.UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise; /** + * * Creates list of users with given input array * @param param the request object */ @@ -124,18 +132,21 @@ export abstract class AbstractObjectUserApi { public abstract deleteUser(param: req.UserApiDeleteUserRequest, options?: Configuration): Promise; /** + * * Get user by user name * @param param the request object */ public abstract getUserByName(param: req.UserApiGetUserByNameRequest, options?: Configuration): Promise; /** + * * Logs user into the system * @param param the request object */ public abstract loginUser(param: req.UserApiLoginUserRequest, options?: Configuration): Promise; /** + * * Logs out current logged in user session * @param param the request object */ diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts index a590e3ca4923..bad3c9fc25ff 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts @@ -122,6 +122,7 @@ export class ObjectPetApi { } /** + * * Add a new pet to the store * @param param the request object */ @@ -130,6 +131,7 @@ export class ObjectPetApi { } /** + * * Deletes a pet * @param param the request object */ @@ -165,6 +167,7 @@ export class ObjectPetApi { } /** + * * Update an existing pet * @param param the request object */ @@ -173,6 +176,7 @@ export class ObjectPetApi { } /** + * * Updates a pet in the store with form data * @param param the request object */ @@ -181,6 +185,7 @@ export class ObjectPetApi { } /** + * * uploads an image * @param param the request object */ @@ -258,6 +263,7 @@ export class ObjectStoreApi { } /** + * * Place an order for a pet * @param param the request object */ @@ -365,6 +371,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -373,6 +380,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -390,6 +398,7 @@ export class ObjectUserApi { } /** + * * Get user by user name * @param param the request object */ @@ -398,6 +407,7 @@ export class ObjectUserApi { } /** + * * Logs user into the system * @param param the request object */ @@ -406,6 +416,7 @@ export class ObjectUserApi { } /** + * * Logs out current logged in user session * @param param the request object */ diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts index 98cbc9f37402..678d21b81aab 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts @@ -32,6 +32,7 @@ export class ObservablePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -55,6 +56,7 @@ export class ObservablePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -151,6 +153,7 @@ export class ObservablePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -174,6 +177,7 @@ export class ObservablePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -199,6 +203,7 @@ export class ObservablePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -316,6 +321,7 @@ export class ObservableStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -384,6 +390,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -407,6 +414,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -454,6 +462,7 @@ export class ObservableUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -477,6 +486,7 @@ export class ObservableUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -501,6 +511,7 @@ export class ObservableUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Observable { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts index a6135ddbd244..072f18762816 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts @@ -28,6 +28,7 @@ export class PromisePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -37,6 +38,7 @@ export class PromisePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -77,6 +79,7 @@ export class PromisePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -86,6 +89,7 @@ export class PromisePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -97,6 +101,7 @@ export class PromisePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -159,6 +164,7 @@ export class PromiseStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -200,6 +206,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -209,6 +216,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -228,6 +236,7 @@ export class PromiseUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -237,6 +246,7 @@ export class PromiseUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -247,6 +257,7 @@ export class PromiseUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/PetApi.md b/samples/openapi3/client/petstore/typescript/builds/jquery/PetApi.md index 2fe727d84fab..2aac946907bb 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/PetApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/PetApi.md @@ -18,6 +18,7 @@ Method | HTTP request | Description > Pet addPet(pet) + ### Example @@ -89,6 +90,7 @@ Name | Type | Description | Notes > deletePet() + ### Example @@ -315,6 +317,7 @@ Name | Type | Description | Notes > Pet updatePet(pet) + ### Example @@ -388,6 +391,7 @@ Name | Type | Description | Notes > updatePetWithForm() + ### Example @@ -447,6 +451,7 @@ void (empty response body) > ApiResponse uploadFile() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/StoreApi.md b/samples/openapi3/client/petstore/typescript/builds/jquery/StoreApi.md index b2a63f782194..9dfad28caff6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/StoreApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/StoreApi.md @@ -173,6 +173,7 @@ No authorization required > Order placeOrder(order) + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/UserApi.md b/samples/openapi3/client/petstore/typescript/builds/jquery/UserApi.md index 3aa75a41422c..c18f5d948960 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/UserApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/UserApi.md @@ -81,6 +81,7 @@ void (empty response body) > createUsersWithArrayInput(user) + ### Example @@ -145,6 +146,7 @@ void (empty response body) > createUsersWithListInput(user) + ### Example @@ -264,6 +266,7 @@ void (empty response body) > User getUserByName() + ### Example @@ -319,6 +322,7 @@ No authorization required > string loginUser() + ### Example @@ -376,6 +380,7 @@ No authorization required > logoutUser() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts index fe20e750a839..273352e4f6d9 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts @@ -17,6 +17,7 @@ import { Pet } from '../models/Pet'; export class PetApiRequestFactory extends BaseAPIRequestFactory { /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -66,6 +67,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -230,6 +232,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -279,6 +282,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -349,6 +353,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts index 020bb0407068..1eead2922748 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts @@ -110,6 +110,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts index 75cb0453992e..9784393c7a40 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts @@ -64,6 +64,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -111,6 +112,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -196,6 +198,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -227,6 +230,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -274,6 +278,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs out current logged in user session */ public async logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts index a590e3ca4923..bad3c9fc25ff 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts @@ -122,6 +122,7 @@ export class ObjectPetApi { } /** + * * Add a new pet to the store * @param param the request object */ @@ -130,6 +131,7 @@ export class ObjectPetApi { } /** + * * Deletes a pet * @param param the request object */ @@ -165,6 +167,7 @@ export class ObjectPetApi { } /** + * * Update an existing pet * @param param the request object */ @@ -173,6 +176,7 @@ export class ObjectPetApi { } /** + * * Updates a pet in the store with form data * @param param the request object */ @@ -181,6 +185,7 @@ export class ObjectPetApi { } /** + * * uploads an image * @param param the request object */ @@ -258,6 +263,7 @@ export class ObjectStoreApi { } /** + * * Place an order for a pet * @param param the request object */ @@ -365,6 +371,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -373,6 +380,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -390,6 +398,7 @@ export class ObjectUserApi { } /** + * * Get user by user name * @param param the request object */ @@ -398,6 +407,7 @@ export class ObjectUserApi { } /** + * * Logs user into the system * @param param the request object */ @@ -406,6 +416,7 @@ export class ObjectUserApi { } /** + * * Logs out current logged in user session * @param param the request object */ diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObservableAPI.ts index 4207fd5102dc..74f57a7e1c7c 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObservableAPI.ts @@ -27,6 +27,7 @@ export class ObservablePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -50,6 +51,7 @@ export class ObservablePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -146,6 +148,7 @@ export class ObservablePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -169,6 +172,7 @@ export class ObservablePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -194,6 +198,7 @@ export class ObservablePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -308,6 +313,7 @@ export class ObservableStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -373,6 +379,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -396,6 +403,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -443,6 +451,7 @@ export class ObservableUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -466,6 +475,7 @@ export class ObservableUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -490,6 +500,7 @@ export class ObservableUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Observable { diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts index ac44ba7a13b2..92d57b673df0 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts @@ -23,6 +23,7 @@ export class PromisePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -32,6 +33,7 @@ export class PromisePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -72,6 +74,7 @@ export class PromisePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -81,6 +84,7 @@ export class PromisePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -92,6 +96,7 @@ export class PromisePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -151,6 +156,7 @@ export class PromiseStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -189,6 +195,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -198,6 +205,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -217,6 +225,7 @@ export class PromiseUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -226,6 +235,7 @@ export class PromiseUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -236,6 +246,7 @@ export class PromiseUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/PetApi.md b/samples/openapi3/client/petstore/typescript/builds/object_params/PetApi.md index 2fe727d84fab..2aac946907bb 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/PetApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/PetApi.md @@ -18,6 +18,7 @@ Method | HTTP request | Description > Pet addPet(pet) + ### Example @@ -89,6 +90,7 @@ Name | Type | Description | Notes > deletePet() + ### Example @@ -315,6 +317,7 @@ Name | Type | Description | Notes > Pet updatePet(pet) + ### Example @@ -388,6 +391,7 @@ Name | Type | Description | Notes > updatePetWithForm() + ### Example @@ -447,6 +451,7 @@ void (empty response body) > ApiResponse uploadFile() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/StoreApi.md b/samples/openapi3/client/petstore/typescript/builds/object_params/StoreApi.md index b2a63f782194..9dfad28caff6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/StoreApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/StoreApi.md @@ -173,6 +173,7 @@ No authorization required > Order placeOrder(order) + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/UserApi.md b/samples/openapi3/client/petstore/typescript/builds/object_params/UserApi.md index 3aa75a41422c..c18f5d948960 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/UserApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/UserApi.md @@ -81,6 +81,7 @@ void (empty response body) > createUsersWithArrayInput(user) + ### Example @@ -145,6 +146,7 @@ void (empty response body) > createUsersWithListInput(user) + ### Example @@ -264,6 +266,7 @@ void (empty response body) > User getUserByName() + ### Example @@ -319,6 +322,7 @@ No authorization required > string loginUser() + ### Example @@ -376,6 +380,7 @@ No authorization required > logoutUser() + ### Example diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts index e85797baebc1..3dec522f6eea 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts @@ -19,6 +19,7 @@ import { Pet } from '../models/Pet'; export class PetApiRequestFactory extends BaseAPIRequestFactory { /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -68,6 +69,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -232,6 +234,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -281,6 +284,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -351,6 +355,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts index 821e181892ba..e26ee9a00b1c 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts @@ -112,6 +112,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts index 9a87f64e9c58..ede979aad465 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts @@ -66,6 +66,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -113,6 +114,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -198,6 +200,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -229,6 +232,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -276,6 +280,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } /** + * * Logs out current logged in user session */ public async logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts index a590e3ca4923..bad3c9fc25ff 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts @@ -122,6 +122,7 @@ export class ObjectPetApi { } /** + * * Add a new pet to the store * @param param the request object */ @@ -130,6 +131,7 @@ export class ObjectPetApi { } /** + * * Deletes a pet * @param param the request object */ @@ -165,6 +167,7 @@ export class ObjectPetApi { } /** + * * Update an existing pet * @param param the request object */ @@ -173,6 +176,7 @@ export class ObjectPetApi { } /** + * * Updates a pet in the store with form data * @param param the request object */ @@ -181,6 +185,7 @@ export class ObjectPetApi { } /** + * * uploads an image * @param param the request object */ @@ -258,6 +263,7 @@ export class ObjectStoreApi { } /** + * * Place an order for a pet * @param param the request object */ @@ -365,6 +371,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -373,6 +380,7 @@ export class ObjectUserApi { } /** + * * Creates list of users with given input array * @param param the request object */ @@ -390,6 +398,7 @@ export class ObjectUserApi { } /** + * * Get user by user name * @param param the request object */ @@ -398,6 +407,7 @@ export class ObjectUserApi { } /** + * * Logs user into the system * @param param the request object */ @@ -406,6 +416,7 @@ export class ObjectUserApi { } /** + * * Logs out current logged in user session * @param param the request object */ diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts index 4207fd5102dc..74f57a7e1c7c 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts @@ -27,6 +27,7 @@ export class ObservablePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -50,6 +51,7 @@ export class ObservablePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -146,6 +148,7 @@ export class ObservablePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -169,6 +172,7 @@ export class ObservablePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -194,6 +198,7 @@ export class ObservablePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -308,6 +313,7 @@ export class ObservableStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -373,6 +379,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -396,6 +403,7 @@ export class ObservableUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -443,6 +451,7 @@ export class ObservableUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -466,6 +475,7 @@ export class ObservableUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -490,6 +500,7 @@ export class ObservableUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Observable { diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts index ac44ba7a13b2..92d57b673df0 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts @@ -23,6 +23,7 @@ export class PromisePetApi { } /** + * * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ @@ -32,6 +33,7 @@ export class PromisePetApi { } /** + * * Deletes a pet * @param petId Pet id to delete * @param apiKey @@ -72,6 +74,7 @@ export class PromisePetApi { } /** + * * Update an existing pet * @param pet Pet object that needs to be added to the store */ @@ -81,6 +84,7 @@ export class PromisePetApi { } /** + * * Updates a pet in the store with form data * @param petId ID of pet that needs to be updated * @param name Updated name of the pet @@ -92,6 +96,7 @@ export class PromisePetApi { } /** + * * uploads an image * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server @@ -151,6 +156,7 @@ export class PromiseStoreApi { } /** + * * Place an order for a pet * @param order order placed for purchasing the pet */ @@ -189,6 +195,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -198,6 +205,7 @@ export class PromiseUserApi { } /** + * * Creates list of users with given input array * @param user List of user object */ @@ -217,6 +225,7 @@ export class PromiseUserApi { } /** + * * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -226,6 +235,7 @@ export class PromiseUserApi { } /** + * * Logs user into the system * @param username The user name for login * @param password The password for login in clear text @@ -236,6 +246,7 @@ export class PromiseUserApi { } /** + * * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Promise { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java index 16a553b637bf..3e741e3c0465 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java @@ -41,6 +41,7 @@ default Optional getRequest() { /** * POST /pet : Add a new pet to the store + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -91,6 +92,7 @@ default ResponseEntity addPet( /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -275,6 +277,7 @@ default ResponseEntity getPetById( /** * PUT /pet : Update an existing pet + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -329,6 +332,7 @@ default ResponseEntity updatePet( /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -363,6 +367,7 @@ default ResponseEntity updatePetWithForm( /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java index 794da5c8373d..2cb677705b6c 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java @@ -151,6 +151,7 @@ default ResponseEntity getOrderById( /** * POST /store/order : Place an order for a pet + * * * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java index 29ac437379b9..1186f235271d 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java @@ -73,6 +73,7 @@ default ResponseEntity createUser( /** * POST /user/createWithArray : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -103,6 +104,7 @@ default ResponseEntity createUsersWithArrayInput( /** * POST /user/createWithList : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -165,6 +167,7 @@ default ResponseEntity deleteUser( /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -213,6 +216,7 @@ default ResponseEntity getUserByName( /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -247,6 +251,7 @@ default ResponseEntity loginUser( /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml index 5fc39a2ce2a4..68ee366c83d4 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml @@ -22,6 +22,7 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -49,6 +50,7 @@ paths: x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -169,6 +171,7 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -236,6 +239,7 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -276,6 +280,7 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -343,6 +348,7 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -456,6 +462,7 @@ paths: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -473,6 +480,7 @@ paths: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -490,6 +498,7 @@ paths: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -552,6 +561,7 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -591,6 +601,7 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java index c29de936952a..f268c3e71d61 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { /** * POST /pet : Add a new pet to the store + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -67,6 +68,7 @@ default ResponseEntity addPet( /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -194,6 +196,7 @@ default ResponseEntity getPetById( /** * PUT /pet : Update an existing pet + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -231,6 +234,7 @@ default ResponseEntity updatePet( /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -254,6 +258,7 @@ default ResponseEntity updatePetWithForm( /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java index 577b14c1ad5d..235426e8876a 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java @@ -107,6 +107,7 @@ default ResponseEntity getOrderById( /** * POST /store/order : Place an order for a pet + * * * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java index d8c777c16eb2..714e8bdf821d 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java @@ -53,6 +53,7 @@ default ResponseEntity createUser( /** * POST /user/createWithArray : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -72,6 +73,7 @@ default ResponseEntity createUsersWithArrayInput( /** * POST /user/createWithList : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -111,6 +113,7 @@ default ResponseEntity deleteUser( /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -146,6 +149,7 @@ default ResponseEntity getUserByName( /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -168,6 +172,7 @@ default ResponseEntity loginUser( /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml index 5fc39a2ce2a4..68ee366c83d4 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml @@ -22,6 +22,7 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -49,6 +50,7 @@ paths: x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -169,6 +171,7 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -236,6 +239,7 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -276,6 +280,7 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -343,6 +348,7 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -456,6 +462,7 @@ paths: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -473,6 +480,7 @@ paths: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -490,6 +498,7 @@ paths: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -552,6 +561,7 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -591,6 +601,7 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 16a553b637bf..3e741e3c0465 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -41,6 +41,7 @@ default Optional getRequest() { /** * POST /pet : Add a new pet to the store + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -91,6 +92,7 @@ default ResponseEntity addPet( /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -275,6 +277,7 @@ default ResponseEntity getPetById( /** * PUT /pet : Update an existing pet + * * * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) @@ -329,6 +332,7 @@ default ResponseEntity updatePet( /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -363,6 +367,7 @@ default ResponseEntity updatePetWithForm( /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 794da5c8373d..2cb677705b6c 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -151,6 +151,7 @@ default ResponseEntity getOrderById( /** * POST /store/order : Place an order for a pet + * * * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 29ac437379b9..1186f235271d 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -73,6 +73,7 @@ default ResponseEntity createUser( /** * POST /user/createWithArray : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -103,6 +104,7 @@ default ResponseEntity createUsersWithArrayInput( /** * POST /user/createWithList : Creates list of users with given input array + * * * @param user List of user object (required) * @return successful operation (status code 200) @@ -165,6 +167,7 @@ default ResponseEntity deleteUser( /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -213,6 +216,7 @@ default ResponseEntity getUserByName( /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -247,6 +251,7 @@ default ResponseEntity loginUser( /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ diff --git a/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml index 5fc39a2ce2a4..68ee366c83d4 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml @@ -22,6 +22,7 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -49,6 +50,7 @@ paths: x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -169,6 +171,7 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -236,6 +239,7 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -276,6 +280,7 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -343,6 +348,7 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -456,6 +462,7 @@ paths: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -473,6 +480,7 @@ paths: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -490,6 +498,7 @@ paths: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -552,6 +561,7 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -591,6 +601,7 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index 1f99af1b294d..d9963cb894de 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -29,6 +29,7 @@ "paths" : { "/pet" : { "post" : { + "description" : "", "operationId" : "addPet", "requestBody" : { "$ref" : "#/components/requestBodies/Pet" @@ -60,6 +61,7 @@ "tags" : [ "pet" ] }, "put" : { + "description" : "", "operationId" : "updatePet", "requestBody" : { "$ref" : "#/components/requestBodies/Pet" @@ -205,6 +207,7 @@ }, "/pet/{petId}" : { "delete" : { + "description" : "", "operationId" : "deletePet", "parameters" : [ { "explode" : false, @@ -283,6 +286,7 @@ "tags" : [ "pet" ] }, "post" : { + "description" : "", "operationId" : "updatePetWithForm", "parameters" : [ { "description" : "ID of pet that needs to be updated", @@ -330,6 +334,7 @@ }, "/pet/{petId}/uploadImage" : { "post" : { + "description" : "", "operationId" : "uploadFile", "parameters" : [ { "description" : "ID of pet to update", @@ -412,6 +417,7 @@ }, "/store/order" : { "post" : { + "description" : "", "operationId" : "placeOrder", "requestBody" : { "content" : { @@ -547,6 +553,7 @@ }, "/user/createWithArray" : { "post" : { + "description" : "", "operationId" : "createUsersWithArrayInput", "requestBody" : { "$ref" : "#/components/requestBodies/UserArray" @@ -565,6 +572,7 @@ }, "/user/createWithList" : { "post" : { + "description" : "", "operationId" : "createUsersWithListInput", "requestBody" : { "$ref" : "#/components/requestBodies/UserArray" @@ -583,6 +591,7 @@ }, "/user/login" : { "get" : { + "description" : "", "operationId" : "loginUser", "parameters" : [ { "description" : "The user name for login", @@ -661,6 +670,7 @@ }, "/user/logout" : { "get" : { + "description" : "", "operationId" : "logoutUser", "responses" : { "default" : { @@ -704,6 +714,7 @@ "tags" : [ "user" ] }, "get" : { + "description" : "", "operationId" : "getUserByName", "parameters" : [ { "description" : "The name that needs to be fetched. Use user1 for testing.", diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index 1f99af1b294d..d9963cb894de 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -29,6 +29,7 @@ "paths" : { "/pet" : { "post" : { + "description" : "", "operationId" : "addPet", "requestBody" : { "$ref" : "#/components/requestBodies/Pet" @@ -60,6 +61,7 @@ "tags" : [ "pet" ] }, "put" : { + "description" : "", "operationId" : "updatePet", "requestBody" : { "$ref" : "#/components/requestBodies/Pet" @@ -205,6 +207,7 @@ }, "/pet/{petId}" : { "delete" : { + "description" : "", "operationId" : "deletePet", "parameters" : [ { "explode" : false, @@ -283,6 +286,7 @@ "tags" : [ "pet" ] }, "post" : { + "description" : "", "operationId" : "updatePetWithForm", "parameters" : [ { "description" : "ID of pet that needs to be updated", @@ -330,6 +334,7 @@ }, "/pet/{petId}/uploadImage" : { "post" : { + "description" : "", "operationId" : "uploadFile", "parameters" : [ { "description" : "ID of pet to update", @@ -412,6 +417,7 @@ }, "/store/order" : { "post" : { + "description" : "", "operationId" : "placeOrder", "requestBody" : { "content" : { @@ -547,6 +553,7 @@ }, "/user/createWithArray" : { "post" : { + "description" : "", "operationId" : "createUsersWithArrayInput", "requestBody" : { "$ref" : "#/components/requestBodies/UserArray" @@ -565,6 +572,7 @@ }, "/user/createWithList" : { "post" : { + "description" : "", "operationId" : "createUsersWithListInput", "requestBody" : { "$ref" : "#/components/requestBodies/UserArray" @@ -583,6 +591,7 @@ }, "/user/login" : { "get" : { + "description" : "", "operationId" : "loginUser", "parameters" : [ { "description" : "The user name for login", @@ -661,6 +670,7 @@ }, "/user/logout" : { "get" : { + "description" : "", "operationId" : "logoutUser", "responses" : { "default" : { @@ -704,6 +714,7 @@ "tags" : [ "user" ] }, "get" : { + "description" : "", "operationId" : "getUserByName", "parameters" : [ { "description" : "The name that needs to be fetched. Use user1 for testing.", diff --git a/samples/server/petstore/erlang-server/priv/openapi.json b/samples/server/petstore/erlang-server/priv/openapi.json index 1f99af1b294d..d9963cb894de 100644 --- a/samples/server/petstore/erlang-server/priv/openapi.json +++ b/samples/server/petstore/erlang-server/priv/openapi.json @@ -29,6 +29,7 @@ "paths" : { "/pet" : { "post" : { + "description" : "", "operationId" : "addPet", "requestBody" : { "$ref" : "#/components/requestBodies/Pet" @@ -60,6 +61,7 @@ "tags" : [ "pet" ] }, "put" : { + "description" : "", "operationId" : "updatePet", "requestBody" : { "$ref" : "#/components/requestBodies/Pet" @@ -205,6 +207,7 @@ }, "/pet/{petId}" : { "delete" : { + "description" : "", "operationId" : "deletePet", "parameters" : [ { "explode" : false, @@ -283,6 +286,7 @@ "tags" : [ "pet" ] }, "post" : { + "description" : "", "operationId" : "updatePetWithForm", "parameters" : [ { "description" : "ID of pet that needs to be updated", @@ -330,6 +334,7 @@ }, "/pet/{petId}/uploadImage" : { "post" : { + "description" : "", "operationId" : "uploadFile", "parameters" : [ { "description" : "ID of pet to update", @@ -412,6 +417,7 @@ }, "/store/order" : { "post" : { + "description" : "", "operationId" : "placeOrder", "requestBody" : { "content" : { @@ -547,6 +553,7 @@ }, "/user/createWithArray" : { "post" : { + "description" : "", "operationId" : "createUsersWithArrayInput", "requestBody" : { "$ref" : "#/components/requestBodies/UserArray" @@ -565,6 +572,7 @@ }, "/user/createWithList" : { "post" : { + "description" : "", "operationId" : "createUsersWithListInput", "requestBody" : { "$ref" : "#/components/requestBodies/UserArray" @@ -583,6 +591,7 @@ }, "/user/login" : { "get" : { + "description" : "", "operationId" : "loginUser", "parameters" : [ { "description" : "The user name for login", @@ -661,6 +670,7 @@ }, "/user/logout" : { "get" : { + "description" : "", "operationId" : "logoutUser", "responses" : { "default" : { @@ -704,6 +714,7 @@ "tags" : [ "user" ] }, "get" : { + "description" : "", "operationId" : "getUserByName", "parameters" : [ { "description" : "The name that needs to be fetched. Use user1 for testing.", diff --git a/samples/server/petstore/go-api-server/api/openapi.yaml b/samples/server/petstore/go-api-server/api/openapi.yaml index a5d58611b42b..da52949d044b 100644 --- a/samples/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-api-server/api/openapi.yaml @@ -22,6 +22,7 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -45,6 +46,7 @@ paths: tags: - pet put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -155,6 +157,7 @@ paths: - pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -216,6 +219,7 @@ paths: tags: - pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -252,6 +256,7 @@ paths: - pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -312,6 +317,7 @@ paths: - store /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -411,6 +417,7 @@ paths: - user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -424,6 +431,7 @@ paths: - user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -437,6 +445,7 @@ paths: - user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -496,6 +505,7 @@ paths: - user /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -529,6 +539,7 @@ paths: tags: - user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. diff --git a/samples/server/petstore/go-chi-server/api/openapi.yaml b/samples/server/petstore/go-chi-server/api/openapi.yaml index a5d58611b42b..da52949d044b 100644 --- a/samples/server/petstore/go-chi-server/api/openapi.yaml +++ b/samples/server/petstore/go-chi-server/api/openapi.yaml @@ -22,6 +22,7 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -45,6 +46,7 @@ paths: tags: - pet put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -155,6 +157,7 @@ paths: - pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -216,6 +219,7 @@ paths: tags: - pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -252,6 +256,7 @@ paths: - pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -312,6 +317,7 @@ paths: - store /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -411,6 +417,7 @@ paths: - user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -424,6 +431,7 @@ paths: - user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -437,6 +445,7 @@ paths: - user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -496,6 +505,7 @@ paths: - user /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -529,6 +539,7 @@ paths: tags: - user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. diff --git a/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml b/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml index a5d58611b42b..da52949d044b 100644 --- a/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml +++ b/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml @@ -22,6 +22,7 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -45,6 +46,7 @@ paths: tags: - pet put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -155,6 +157,7 @@ paths: - pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -216,6 +219,7 @@ paths: tags: - pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -252,6 +256,7 @@ paths: - pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -312,6 +317,7 @@ paths: - store /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -411,6 +417,7 @@ paths: - user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -424,6 +431,7 @@ paths: - user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -437,6 +445,7 @@ paths: - user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -496,6 +505,7 @@ paths: - user /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -529,6 +539,7 @@ paths: tags: - user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. diff --git a/samples/server/petstore/go-gin-api-server/api/openapi.yaml b/samples/server/petstore/go-gin-api-server/api/openapi.yaml index a5d58611b42b..da52949d044b 100644 --- a/samples/server/petstore/go-gin-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-gin-api-server/api/openapi.yaml @@ -22,6 +22,7 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -45,6 +46,7 @@ paths: tags: - pet put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -155,6 +157,7 @@ paths: - pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -216,6 +219,7 @@ paths: tags: - pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -252,6 +256,7 @@ paths: - pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -312,6 +317,7 @@ paths: - store /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -411,6 +417,7 @@ paths: - user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -424,6 +431,7 @@ paths: - user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -437,6 +445,7 @@ paths: - user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -496,6 +505,7 @@ paths: - user /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -529,6 +539,7 @@ paths: tags: - user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. diff --git a/samples/server/petstore/go-server-required/api/openapi.yaml b/samples/server/petstore/go-server-required/api/openapi.yaml index c53982d7f05e..b9b1cc704685 100644 --- a/samples/server/petstore/go-server-required/api/openapi.yaml +++ b/samples/server/petstore/go-server-required/api/openapi.yaml @@ -22,6 +22,7 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -45,6 +46,7 @@ paths: tags: - pet put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -154,6 +156,7 @@ paths: - pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -215,6 +218,7 @@ paths: tags: - pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -251,6 +255,7 @@ paths: - pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -311,6 +316,7 @@ paths: - store /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -410,6 +416,7 @@ paths: - user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -423,6 +430,7 @@ paths: - user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -436,6 +444,7 @@ paths: - user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -495,6 +504,7 @@ paths: - user /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -528,6 +538,7 @@ paths: tags: - user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. diff --git a/samples/server/petstore/haskell-yesod/src/Handler/Pet.hs b/samples/server/petstore/haskell-yesod/src/Handler/Pet.hs index d96b391f0cf5..75dbdf31a10d 100644 --- a/samples/server/petstore/haskell-yesod/src/Handler/Pet.hs +++ b/samples/server/petstore/haskell-yesod/src/Handler/Pet.hs @@ -7,12 +7,14 @@ import Import -- | Add a new pet to the store -- +-- -- operationId: addPet postPetR :: Handler Value postPetR = notImplemented -- | Deletes a pet -- +-- -- operationId: deletePet deletePetByInt64R :: Int64 -- ^ Pet id to delete -> Handler Value @@ -42,12 +44,14 @@ getPetByInt64R petId = notImplemented -- | Update an existing pet -- +-- -- operationId: updatePet putPetR :: Handler Value putPetR = notImplemented -- | Updates a pet in the store with form data -- +-- -- operationId: updatePetWithForm postPetByInt64R :: Int64 -- ^ ID of pet that needs to be updated -> Handler Value @@ -55,6 +59,7 @@ postPetByInt64R petId = notImplemented -- | uploads an image -- +-- -- operationId: uploadFile postPetByInt64UploadImageR :: Int64 -- ^ ID of pet to update -> Handler Value diff --git a/samples/server/petstore/haskell-yesod/src/Handler/Store.hs b/samples/server/petstore/haskell-yesod/src/Handler/Store.hs index 66cbc157555c..e359631ea28e 100644 --- a/samples/server/petstore/haskell-yesod/src/Handler/Store.hs +++ b/samples/server/petstore/haskell-yesod/src/Handler/Store.hs @@ -30,6 +30,7 @@ getStoreOrderByInt64R orderId = notImplemented -- | Place an order for a pet -- +-- -- operationId: placeOrder postStoreOrderR :: Handler Value postStoreOrderR = notImplemented diff --git a/samples/server/petstore/haskell-yesod/src/Handler/User.hs b/samples/server/petstore/haskell-yesod/src/Handler/User.hs index 142d051b4295..8371730dba5f 100644 --- a/samples/server/petstore/haskell-yesod/src/Handler/User.hs +++ b/samples/server/petstore/haskell-yesod/src/Handler/User.hs @@ -14,12 +14,14 @@ postUserR = notImplemented -- | Creates list of users with given input array -- +-- -- operationId: createUsersWithArrayInput postUserCreateWithArrayR :: Handler Value postUserCreateWithArrayR = notImplemented -- | Creates list of users with given input array -- +-- -- operationId: createUsersWithListInput postUserCreateWithListR :: Handler Value postUserCreateWithListR = notImplemented @@ -34,6 +36,7 @@ deleteUserByTextR username = notImplemented -- | Get user by user name -- +-- -- operationId: getUserByName getUserByTextR :: Text -- ^ The name that needs to be fetched. Use user1 for testing. -> Handler Value @@ -41,12 +44,14 @@ getUserByTextR username = notImplemented -- | Logs user into the system -- +-- -- operationId: loginUser getUserLoginR :: Handler Value getUserLoginR = notImplemented -- | Logs out current logged in user session -- +-- -- operationId: logoutUser getUserLogoutR :: Handler Value getUserLogoutR = notImplemented diff --git a/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md b/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md index da831a4f13b7..de79610457ff 100644 --- a/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md +++ b/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md @@ -23,6 +23,8 @@ Mono PetController.addPet(pet) Add a new pet to the store + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -46,6 +48,8 @@ Mono PetController.deletePet(petIdapiKey) Deletes a pet + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -143,6 +147,8 @@ Mono PetController.updatePet(pet) Update an existing pet + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -166,6 +172,8 @@ Mono PetController.updatePetWithForm(petIdnamestatus) Updates a pet in the store with form data + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -189,6 +197,8 @@ Mono PetController.uploadFile(petIdadditionalMetadata_file) uploads an image + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- diff --git a/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md b/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md index 0cc9c7f0a207..f8e82ff30e76 100644 --- a/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md +++ b/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md @@ -84,6 +84,8 @@ Mono StoreController.placeOrder(order) Place an order for a pet + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- diff --git a/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md b/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md index 31012f2b441f..75e930ab7fa1 100644 --- a/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md +++ b/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md @@ -46,6 +46,8 @@ Mono UserController.createUsersWithArrayInput(user) Creates list of users with given input array + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -67,6 +69,8 @@ Mono UserController.createUsersWithListInput(user) Creates list of users with given input array + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -111,6 +115,8 @@ Mono UserController.getUserByName(username) Get user by user name + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -132,6 +138,8 @@ Mono UserController.loginUser(usernamepassword) Logs user into the system + + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -156,6 +164,8 @@ Logs out current logged in user session + + ### Authorization * **api_key** diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java index 330ee3b70747..ed7a35b7f37a 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java @@ -33,6 +33,7 @@ public class PetController { /** * Add a new pet to the store + * * * @param pet Pet object that needs to be added to the store (required) * @return Pet @@ -40,6 +41,7 @@ public class PetController { @ApiOperation( value = "Add a new pet to the store", nickname = "addPet", + notes = "", response = Pet.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @@ -64,6 +66,7 @@ public Mono addPet( /** * Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -71,6 +74,7 @@ public Mono addPet( @ApiOperation( value = "Deletes a pet", nickname = "deletePet", + notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -187,6 +191,7 @@ public Mono getPetById( /** * Update an existing pet + * * * @param pet Pet object that needs to be added to the store (required) * @return Pet @@ -194,6 +199,7 @@ public Mono getPetById( @ApiOperation( value = "Update an existing pet", nickname = "updatePet", + notes = "", response = Pet.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @@ -220,6 +226,7 @@ public Mono updatePet( /** * Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -228,6 +235,7 @@ public Mono updatePet( @ApiOperation( value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", + notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -252,6 +260,7 @@ public Mono updatePetWithForm( /** * uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -261,6 +270,7 @@ public Mono updatePetWithForm( @ApiOperation( value = "uploads an image", nickname = "uploadFile", + notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java index 3ae60165ca03..f80e06ed121f 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java @@ -110,6 +110,7 @@ public Mono getOrderById( /** * Place an order for a pet + * * * @param order order placed for purchasing the pet (required) * @return Order @@ -117,6 +118,7 @@ public Mono getOrderById( @ApiOperation( value = "Place an order for a pet", nickname = "placeOrder", + notes = "", response = Order.class, authorizations = {}, tags={}) diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java index 78adec91467b..3b29717f3eea 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java @@ -59,12 +59,14 @@ public Mono createUser( /** * Creates list of users with given input array + * * * @param user List of user object (required) */ @ApiOperation( value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", + notes = "", authorizations = { @Authorization(value = "api_key") }, @@ -84,12 +86,14 @@ public Mono createUsersWithArrayInput( /** * Creates list of users with given input array + * * * @param user List of user object (required) */ @ApiOperation( value = "Creates list of users with given input array", nickname = "createUsersWithListInput", + notes = "", authorizations = { @Authorization(value = "api_key") }, @@ -136,6 +140,7 @@ public Mono deleteUser( /** * Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return User @@ -143,6 +148,7 @@ public Mono deleteUser( @ApiOperation( value = "Get user by user name", nickname = "getUserByName", + notes = "", response = User.class, authorizations = {}, tags={}) @@ -162,6 +168,7 @@ public Mono getUserByName( /** * Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -170,6 +177,7 @@ public Mono getUserByName( @ApiOperation( value = "Logs user into the system", nickname = "loginUser", + notes = "", response = String.class, authorizations = {}, tags={}) @@ -189,11 +197,13 @@ public Mono loginUser( /** * Logs out current logged in user session + * * */ @ApiOperation( value = "Logs out current logged in user session", nickname = "logoutUser", + notes = "", authorizations = { @Authorization(value = "api_key") }, diff --git a/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml b/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml index e8a30a332bce..182e45c28c2d 100644 --- a/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml +++ b/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml @@ -22,6 +22,7 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: $ref: '#/components/requestBodies/Pet' @@ -47,6 +48,7 @@ paths: x-contentType: application/json x-accepts: application/json put: + description: "" operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet' @@ -161,6 +163,7 @@ paths: x-accepts: application/json /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - explode: false @@ -224,6 +227,7 @@ paths: - pet x-accepts: application/json post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated @@ -262,6 +266,7 @@ paths: x-accepts: application/json /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update @@ -325,6 +330,7 @@ paths: x-accepts: application/json /store/order: post: + description: "" operationId: placeOrder requestBody: content: @@ -430,6 +436,7 @@ paths: x-accepts: application/json /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -445,6 +452,7 @@ paths: x-accepts: application/json /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: $ref: '#/components/requestBodies/UserArray' @@ -460,6 +468,7 @@ paths: x-accepts: application/json /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login @@ -520,6 +529,7 @@ paths: x-accepts: application/json /user/logout: get: + description: "" operationId: logoutUser responses: default: @@ -555,6 +565,7 @@ paths: - user x-accepts: application/json get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. diff --git a/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php b/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php index 7975aabc6fe4..f7d620141c56 100644 --- a/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php +++ b/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php @@ -40,6 +40,7 @@ abstract class AbstractPetApi /** * POST addPet * Summary: Add a new pet to the store + * Notes: * Output-Formats: [application/xml, application/json] * * @param ServerRequestInterface $request Request @@ -60,6 +61,7 @@ public function addPet( /** * DELETE deletePet * Summary: Deletes a pet + * Notes: * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response @@ -149,6 +151,7 @@ public function getPetById( /** * PUT updatePet * Summary: Update an existing pet + * Notes: * Output-Formats: [application/xml, application/json] * * @param ServerRequestInterface $request Request @@ -169,6 +172,7 @@ public function updatePet( /** * POST updatePetWithForm * Summary: Updates a pet in the store with form data + * Notes: * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response @@ -192,6 +196,7 @@ public function updatePetWithForm( /** * POST uploadFile * Summary: uploads an image + * Notes: * Output-Formats: [application/json] * * @param ServerRequestInterface $request Request diff --git a/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php b/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php index 0c153911aac9..226f58c35a14 100644 --- a/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php +++ b/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php @@ -103,6 +103,7 @@ public function getOrderById( /** * POST placeOrder * Summary: Place an order for a pet + * Notes: * Output-Formats: [application/xml, application/json] * * @param ServerRequestInterface $request Request diff --git a/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php b/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php index fb9b1e5c7b45..461df8690620 100644 --- a/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php +++ b/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php @@ -60,6 +60,7 @@ public function createUser( /** * POST createUsersWithArrayInput * Summary: Creates list of users with given input array + * Notes: * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response @@ -79,6 +80,7 @@ public function createUsersWithArrayInput( /** * POST createUsersWithListInput * Summary: Creates list of users with given input array + * Notes: * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response @@ -119,6 +121,7 @@ public function deleteUser( /** * GET getUserByName * Summary: Get user by user name + * Notes: * Output-Formats: [application/xml, application/json] * * @param ServerRequestInterface $request Request @@ -140,6 +143,7 @@ public function getUserByName( /** * GET loginUser * Summary: Logs user into the system + * Notes: * Output-Formats: [application/xml, application/json] * * @param ServerRequestInterface $request Request @@ -162,6 +166,7 @@ public function loginUser( /** * GET logoutUser * Summary: Logs out current logged in user session + * Notes: * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md index 01bd0ee88ae7..b79ef7322497 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md @@ -31,6 +31,8 @@ services: Add a new pet to the store + + ### Example Implementation ```php Pet: + """""" ... @@ -57,6 +58,7 @@ async def delete_pet( get_token_petstore_auth, scopes=["write:pets", "read:pets"] ), ) -> None: + """""" ... @@ -135,6 +137,7 @@ async def update_pet( get_token_petstore_auth, scopes=["write:pets", "read:pets"] ), ) -> Pet: + """""" ... @@ -154,6 +157,7 @@ async def update_pet_with_form( get_token_petstore_auth, scopes=["write:pets", "read:pets"] ), ) -> None: + """""" ... @@ -173,4 +177,5 @@ async def upload_file( get_token_petstore_auth, scopes=["write:pets", "read:pets"] ), ) -> ApiResponse: + """""" ... diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py index 208cacab6325..f280beb76030 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py @@ -85,4 +85,5 @@ async def get_order_by_id( async def place_order( order: Order = Body(None, description="order placed for purchasing the pet"), ) -> Order: + """""" ... diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py index 8609be647d11..ff1990bb7bf6 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py @@ -55,6 +55,7 @@ async def create_users_with_array_input( get_token_api_key ), ) -> None: + """""" ... @@ -72,6 +73,7 @@ async def create_users_with_list_input( get_token_api_key ), ) -> None: + """""" ... @@ -107,6 +109,7 @@ async def delete_user( async def get_user_by_name( username: str = Path(None, description="The name that needs to be fetched. Use user1 for testing."), ) -> User: + """""" ... @@ -123,6 +126,7 @@ async def login_user( username: str = Query(None, description="The user name for login", regex=r"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$"), password: str = Query(None, description="The password for login in clear text"), ) -> str: + """""" ... @@ -139,6 +143,7 @@ async def logout_user( get_token_api_key ), ) -> None: + """""" ... diff --git a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml index fab686f0ebf7..e4fe38e5d431 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml @@ -8,6 +8,7 @@ servers: paths: /xml: post: + description: "" requestBody: content: application/xml: @@ -640,7 +641,6 @@ components: nullable: true type: string nullableWithNullDefault: - default: "null" nullable: true type: string nullableWithPresentDefault: diff --git a/samples/server/petstore/rust-server/output/openapi-v3/docs/NullableTest.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/NullableTest.md index fb981a81b467..3644435f2e58 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/docs/NullableTest.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/NullableTest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **nullable** | **String** | | -**nullable_with_null_default** | **String** | | [optional] [default to Some(swagger::Nullable::Null)] +**nullable_with_null_default** | **String** | | [optional] [default to None] **nullable_with_present_default** | **String** | | [optional] [default to Some(swagger::Nullable::Present("default".to_string()))] **nullable_with_no_default** | **String** | | [optional] [default to None] **nullable_array** | **Vec** | | [optional] [default to None] diff --git a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md index 1358c8fb1b82..3bcab0647b3f 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md @@ -615,6 +615,8 @@ No authorization required > (optional) Post an array + + ### Required Parameters Name | Type | Description | Notes diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs index 68647720d26d..7d9aa159a1f4 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs @@ -1478,7 +1478,7 @@ impl NullableTest { pub fn new(nullable: swagger::Nullable, ) -> NullableTest { NullableTest { nullable: nullable, - nullable_with_null_default: Some(swagger::Nullable::Null), + nullable_with_null_default: None, nullable_with_present_default: Some(swagger::Nullable::Present("default".to_string())), nullable_with_no_default: None, nullable_array: None, From 735dae41a554787910da1cb5d62fda7b3debd978 Mon Sep 17 00:00:00 2001 From: Karsten Thoms Date: Mon, 21 Feb 2022 16:19:08 +0100 Subject: [PATCH 103/111] [#11323] Fixed wrong clearing of CodegenModel#hasEnum field (#11653) A CodegenModel's hasEnum property is set in addVars: cm.hasEnums = true; This state was cleared afterwards again. As one of its results the import for @JsonValue was not added for the model class in the Spring code generator, where 'model.hasEnums' was evaluated to false where it should be true. --- .../openapitools/codegen/DefaultCodegen.java | 3 +- .../java/spring/SpringCodegenTest.java | 28 +++++++++++++ .../test/resources/3_0/spring/issue_11323.yml | 41 +++++++++++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/issue_11323.yml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index ce8b3243795b..76ec33626275 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -5181,7 +5181,6 @@ protected void addVars(CodegenModel m, Map properties, List mandatory = required == null ? Collections.emptySet() : new TreeSet<>(required); @@ -5192,7 +5191,7 @@ protected void addVars(CodegenModel m, Map properties, List Date: Tue, 22 Feb 2022 00:11:01 +0800 Subject: [PATCH 104/111] add java spring technical committee --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 41f1d02b1fef..c3adc1b57d9e 100644 --- a/README.md +++ b/README.md @@ -1065,6 +1065,7 @@ If you want to join the committee, please kindly apply by sending an email to te | Groovy | | | Haskell | | | Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) | +| Java Spring | @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) | | JMeter | @kannkyo (2021/01) | | Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) | | Lua | @daurnimator (2017/08) | From 79970228e63be8d243bd29b682b80353050e6c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=A7=84=EC=98=81?= Date: Tue, 22 Feb 2022 17:27:34 +0900 Subject: [PATCH 105/111] rollback curl_list_free keyword (#11677) --- .../resources/C-libcurl/apiClient.c.mustache | 2 +- .../resources/cpp-tizen-client/api-body.mustache | 2 +- .../cpp-tizen-client/requestinfo.mustache | 2 +- samples/client/petstore/c/src/apiClient.c | 2 +- .../client/petstore/cpp-tizen/src/PetManager.cpp | 16 ++++++++-------- .../client/petstore/cpp-tizen/src/RequestInfo.h | 2 +- .../petstore/cpp-tizen/src/StoreManager.cpp | 8 ++++---- .../petstore/cpp-tizen/src/UserManager.cpp | 16 ++++++++-------- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache index e324c5f966cf..8303f998e0a7 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache @@ -530,7 +530,7 @@ void apiClient_invoke(apiClient_t *apiClient, res = curl_easy_perform(handle); - curl_slist_freeList_all(headers); + curl_slist_free_all(headers); free(targetUrl); diff --git a/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache index 9239b3762f06..a9b960e76eb9 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache @@ -299,7 +299,7 @@ static bool {{nickname}}Helper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = {{nickname}}Processor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); diff --git a/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache index 5966669be454..eb47133b853d 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache @@ -45,7 +45,7 @@ public: ~RequestInfo() { - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (this->p_chunk) { if((this->p_chunk)->memory) { free((this->p_chunk)->memory); diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index 4ecf10c2b8ea..ae58422a9b7c 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -447,7 +447,7 @@ void apiClient_invoke(apiClient_t *apiClient, res = curl_easy_perform(handle); - curl_slist_freeList_all(headers); + curl_slist_free_all(headers); free(targetUrl); diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.cpp b/samples/client/petstore/cpp-tizen/src/PetManager.cpp index 01695962eebe..2f273a21e10d 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/PetManager.cpp @@ -138,7 +138,7 @@ static bool addPetHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = addPetProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -274,7 +274,7 @@ static bool deletePetHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = deletePetProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -418,7 +418,7 @@ static bool findPetsByStatusHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = findPetsByStatusProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -562,7 +562,7 @@ static bool findPetsByTagsHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = findPetsByTagsProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -714,7 +714,7 @@ static bool getPetByIdHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getPetByIdProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -852,7 +852,7 @@ static bool updatePetHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = updatePetProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -982,7 +982,7 @@ static bool updatePetWithFormHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = updatePetWithFormProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -1134,7 +1134,7 @@ static bool uploadFileHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = uploadFileProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); diff --git a/samples/client/petstore/cpp-tizen/src/RequestInfo.h b/samples/client/petstore/cpp-tizen/src/RequestInfo.h index 02b1f59df747..6424d6c856de 100644 --- a/samples/client/petstore/cpp-tizen/src/RequestInfo.h +++ b/samples/client/petstore/cpp-tizen/src/RequestInfo.h @@ -45,7 +45,7 @@ class RequestInfo { ~RequestInfo() { - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (this->p_chunk) { if((this->p_chunk)->memory) { free((this->p_chunk)->memory); diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp index 0ae59157af1f..e107ff844349 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp @@ -130,7 +130,7 @@ static bool deleteOrderHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = deleteOrderProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -254,7 +254,7 @@ static bool getInventoryHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getInventoryProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -406,7 +406,7 @@ static bool getOrderByIdHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getOrderByIdProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -565,7 +565,7 @@ static bool placeOrderHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = placeOrderProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.cpp b/samples/client/petstore/cpp-tizen/src/UserManager.cpp index 12b3633f5d48..ab3a7e40964f 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/UserManager.cpp @@ -137,7 +137,7 @@ static bool createUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = createUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -286,7 +286,7 @@ static bool createUsersWithArrayInputHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = createUsersWithArrayInputProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -435,7 +435,7 @@ static bool createUsersWithListInputHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = createUsersWithListInputProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -565,7 +565,7 @@ static bool deleteUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = deleteUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -717,7 +717,7 @@ static bool getUserByNameHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getUserByNameProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -866,7 +866,7 @@ static bool loginUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = loginUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -990,7 +990,7 @@ static bool logoutUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = logoutUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -1133,7 +1133,7 @@ static bool updateUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = updateUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_freeList_all(headerList); + curl_slist_free_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); From 7dcfe62dee3cca5c7f9ca6569a779172670f500d Mon Sep 17 00:00:00 2001 From: Sorin Florea <30589784+sorin-florea@users.noreply.github.com> Date: Tue, 22 Feb 2022 10:33:36 +0200 Subject: [PATCH 106/111] Properly encode exploded query params in url (#11682) --- .../Java/libraries/native/api.mustache | 12 +++++ .../codegen/java/JavaClientCodegenTest.java | 33 ++++++++++++++ .../src/test/resources/3_0/issue4808.yaml | 45 +++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 modules/openapi-generator/src/test/resources/3_0/issue4808.yaml diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index ede8e5b9566b..d4891d1cd6b1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -318,7 +318,19 @@ public class {{classname}} { } {{/isDeepObject}} {{^isDeepObject}} + {{#isExplode}} + {{#hasVars}} + {{#vars}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}} + {{/hasVars}} + {{^hasVars}} localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/hasVars}} + {{/isExplode}} + {{^isExplode}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/isExplode}} {{/isDeepObject}} {{/collectionFormat}} {{/queryParams}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index c62cbdd5616c..ce1e65289122 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -1276,4 +1276,37 @@ public void testNativeClientWhiteSpacePathParamEncoding() throws IOException { TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"), "public static String urlEncode(String s) { return URLEncoder.encode(s, UTF_8).replaceAll(\"\\\\+\", \"%20\"); }"); } + + /** + * See https://github.com/OpenAPITools/openapi-generator/issues/4808 + */ + @Test + public void testNativeClientExplodedQueryParamObject() throws IOException { + Map properties = new HashMap<>(); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.NATIVE) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/issue4808.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + Assert.assertEquals(files.size(), 38); + validateJavaSourceFiles(files); + + TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), + "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"since\", queryObject.getSince()));", + "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"sinceBuild\", queryObject.getSinceBuild()));", + "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"maxBuilds\", queryObject.getMaxBuilds()));", + "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"maxWaitSecs\", queryObject.getMaxWaitSecs()));" + ); + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/issue4808.yaml b/modules/openapi-generator/src/test/resources/3_0/issue4808.yaml new file mode 100644 index 000000000000..b2d16592f616 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue4808.yaml @@ -0,0 +1,45 @@ +openapi: 3.0.3 +info: + title: Issue 11242 - exploded query params + description: "Exploded query params" + version: "1.0.0" +servers: + - url: localhost:8080 +paths: + /api: + get: + operationId: GetSomeValue + parameters: + - in: query + name: QueryObject + explode: true + style: form + schema: + type: object + properties: + since: + type: string + sinceBuild: + type: string + maxBuilds: + type: integer + maxWaitSecs: + type: integer + responses: + '200': + description: Some return value + content: + application/json: + schema: + $ref: '#/components/schemas/SomeReturnValue' + example: + someValue: value +components: + schemas: + SomeReturnValue: + type: object + required: + - someValue + properties: + someValue: + type: string From f59c07b24a8ae806212ddedca87f69ac4c27c3cd Mon Sep 17 00:00:00 2001 From: Gustavo De Micheli Date: Tue, 22 Feb 2022 09:38:36 +0100 Subject: [PATCH 107/111] Add Model Docs to scala-akka generator as defined in its README (#11684) Co-authored-by: Gustavo De Micheli --- .../languages/ScalaAkkaClientCodegen.java | 8 +++++ .../scala-akka-client/class_doc.mustache | 32 +++++++++++++++++++ .../scala-akka-client/enum_doc.mustache | 7 ++++ .../scala-akka-client/model_doc.mustache | 9 ++++++ .../scala-akka/.openapi-generator/FILES | 6 ++++ samples/client/petstore/scala-akka/README.md | 12 +++---- .../petstore/scala-akka/docs/ApiResponse.md | 16 ++++++++++ .../petstore/scala-akka/docs/Category.md | 15 +++++++++ .../client/petstore/scala-akka/docs/Order.md | 24 ++++++++++++++ .../client/petstore/scala-akka/docs/Pet.md | 24 ++++++++++++++ .../client/petstore/scala-akka/docs/Tag.md | 15 +++++++++ .../client/petstore/scala-akka/docs/User.md | 21 ++++++++++++ 12 files changed, 183 insertions(+), 6 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/scala-akka-client/class_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/scala-akka-client/enum_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/scala-akka-client/model_doc.mustache create mode 100644 samples/client/petstore/scala-akka/docs/ApiResponse.md create mode 100644 samples/client/petstore/scala-akka/docs/Category.md create mode 100644 samples/client/petstore/scala-akka/docs/Order.md create mode 100644 samples/client/petstore/scala-akka/docs/Pet.md create mode 100644 samples/client/petstore/scala-akka/docs/Tag.md create mode 100644 samples/client/petstore/scala-akka/docs/User.md diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java index e646f0127bb2..021603e448b1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java @@ -43,6 +43,7 @@ public class ScalaAkkaClientCodegen extends AbstractScalaCodegen implements Code protected String artifactId = "openapi-client"; protected String artifactVersion = "1.0.0"; protected String resourcesFolder = "src/main/resources"; + protected String modelDocPath = "docs/"; protected String configKey = "apiRequest"; protected int defaultTimeoutInMs = 5000; protected String configKeyPath = mainPackage; @@ -85,6 +86,7 @@ public ScalaAkkaClientCodegen() { outputFolder = "generated-code/scala-akka"; modelTemplateFiles.put("model.mustache", ".scala"); apiTemplateFiles.put("api.mustache", ".scala"); + modelDocTemplateFiles.put("model_doc.mustache", ".md"); embeddedTemplateDir = templateDir = "scala-akka-client"; apiPackage = mainPackage + ".api"; modelPackage = mainPackage + ".model"; @@ -164,6 +166,7 @@ public void processOpts() { } } additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); + additionalProperties.put("modelDocPath", modelDocPath); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("build.sbt.mustache", "", "build.sbt")); @@ -360,4 +363,9 @@ public String escapeQuotationMark(String input) { public void setMainPackage(String mainPackage) { this.configKeyPath = this.mainPackage = mainPackage; } + + @Override + public String modelDocFileFolder() { + return (outputFolder + File.separator + modelDocPath).replace('/', File.separatorChar); + } } diff --git a/modules/openapi-generator/src/main/resources/scala-akka-client/class_doc.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/class_doc.mustache new file mode 100644 index 000000000000..0cb62ce8fe5b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/scala-akka-client/class_doc.mustache @@ -0,0 +1,32 @@ +# {{#vendorExtensions.x-is-one-of-interface}}Trait {{/vendorExtensions.x-is-one-of-interface}}{{classname}} + +{{#description}}{{&description}} +{{/description}} + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} +{{/vars}} +{{#vars}}{{#isEnum}} + +## Enum: {{datatypeWithEnum}} +Allowed values: {{#allowableValues}}[{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} + +{{/isEnum}}{{/vars}} +{{#vendorExtensions.x-implements.0}} + +## Implemented Interfaces + +{{#vendorExtensions.x-implements}} +* {{{.}}} +{{/vendorExtensions.x-implements}} +{{/vendorExtensions.x-implements.0}} +{{#vendorExtensions.x-is-one-of-interface}} +## Implementing Classes + +{{#oneOf}} +* {{{.}}} +{{/oneOf}} +{{/vendorExtensions.x-is-one-of-interface}} diff --git a/modules/openapi-generator/src/main/resources/scala-akka-client/enum_doc.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/enum_doc.mustache new file mode 100644 index 000000000000..20c512aaeae4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/scala-akka-client/enum_doc.mustache @@ -0,0 +1,7 @@ +# {{classname}} + +## Enum + +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/scala-akka-client/model_doc.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/model_doc.mustache new file mode 100644 index 000000000000..e1025787793c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/scala-akka-client/model_doc.mustache @@ -0,0 +1,9 @@ +{{#models}}{{#model}} + +{{#isEnum}} +{{>enum_doc}} +{{/isEnum}} +{{^isEnum}} +{{>class_doc}} +{{/isEnum}} +{{/model}}{{/models}} diff --git a/samples/client/petstore/scala-akka/.openapi-generator/FILES b/samples/client/petstore/scala-akka/.openapi-generator/FILES index 2cd9737cf183..a6dd935c232f 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator/FILES +++ b/samples/client/petstore/scala-akka/.openapi-generator/FILES @@ -1,5 +1,11 @@ README.md build.sbt +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/Tag.md +docs/User.md project/build.properties src/main/resources/reference.conf src/main/scala/org/openapitools/client/api/EnumsSerializers.scala diff --git a/samples/client/petstore/scala-akka/README.md b/samples/client/petstore/scala-akka/README.md index cc830a260e35..ce96f93b1887 100644 --- a/samples/client/petstore/scala-akka/README.md +++ b/samples/client/petstore/scala-akka/README.md @@ -89,12 +89,12 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [ApiResponse](ApiResponse.md) - - [Category](Category.md) - - [Order](Order.md) - - [Pet](Pet.md) - - [Tag](Tag.md) - - [User](User.md) + - [ApiResponse](docs/ApiResponse.md) + - [Category](docs/Category.md) + - [Order](docs/Order.md) + - [Pet](docs/Pet.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) ## Documentation for Authorization diff --git a/samples/client/petstore/scala-akka/docs/ApiResponse.md b/samples/client/petstore/scala-akka/docs/ApiResponse.md new file mode 100644 index 000000000000..bd174989f6f0 --- /dev/null +++ b/samples/client/petstore/scala-akka/docs/ApiResponse.md @@ -0,0 +1,16 @@ + + +# ApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Int** | | [optional] +**`type`** | **String** | | [optional] +**message** | **String** | | [optional] + + + diff --git a/samples/client/petstore/scala-akka/docs/Category.md b/samples/client/petstore/scala-akka/docs/Category.md new file mode 100644 index 000000000000..6f5421307d51 --- /dev/null +++ b/samples/client/petstore/scala-akka/docs/Category.md @@ -0,0 +1,15 @@ + + +# Category + +A category for a pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/scala-akka/docs/Order.md b/samples/client/petstore/scala-akka/docs/Order.md new file mode 100644 index 000000000000..2b9b49297531 --- /dev/null +++ b/samples/client/petstore/scala-akka/docs/Order.md @@ -0,0 +1,24 @@ + + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**petId** | **Long** | | [optional] +**quantity** | **Int** | | [optional] +**shipDate** | **OffsetDateTime** | | [optional] +**status** | [**Status**](#Status) | Order Status | [optional] +**complete** | **Boolean** | | [optional] + + +## Enum: Status +Allowed values: [placed, approved, delivered] + + + + diff --git a/samples/client/petstore/scala-akka/docs/Pet.md b/samples/client/petstore/scala-akka/docs/Pet.md new file mode 100644 index 000000000000..2c65c5440df0 --- /dev/null +++ b/samples/client/petstore/scala-akka/docs/Pet.md @@ -0,0 +1,24 @@ + + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **Seq<String>** | | +**tags** | [**Seq<Tag>**](Tag.md) | | [optional] +**status** | [**Status**](#Status) | pet status in the store | [optional] + + +## Enum: Status +Allowed values: [available, pending, sold] + + + + diff --git a/samples/client/petstore/scala-akka/docs/Tag.md b/samples/client/petstore/scala-akka/docs/Tag.md new file mode 100644 index 000000000000..ae6756ef3935 --- /dev/null +++ b/samples/client/petstore/scala-akka/docs/Tag.md @@ -0,0 +1,15 @@ + + +# Tag + +A tag for a pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/scala-akka/docs/User.md b/samples/client/petstore/scala-akka/docs/User.md new file mode 100644 index 000000000000..44bea4103d0d --- /dev/null +++ b/samples/client/petstore/scala-akka/docs/User.md @@ -0,0 +1,21 @@ + + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **Int** | User Status | [optional] + + + From df398755026d358fae901ae1d504190c07578609 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 22 Feb 2022 17:04:14 +0800 Subject: [PATCH 108/111] fix buils warning in java native client (#11688) --- .../resources/Java/libraries/native/ApiClient.mustache | 8 ++++++-- .../main/resources/Java/libraries/native/JSON.mustache | 8 ++++++++ .../src/main/java/org/openapitools/client/ApiClient.java | 8 ++++++-- .../src/main/java/org/openapitools/client/JSON.java | 8 ++++++++ .../src/main/java/org/openapitools/client/ApiClient.java | 8 ++++++-- .../src/main/java/org/openapitools/client/JSON.java | 8 ++++++++ 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index 8b5d8e75cb43..62016b135bcd 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -150,7 +150,7 @@ public class ApiClient { } /** - * Ctor. + * Create an instance of ApiClient. */ public ApiClient() { this.builder = createDefaultHttpClientBuilder(); @@ -163,7 +163,11 @@ public class ApiClient { } /** - * Ctor. + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI */ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { this.builder = builder; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache index 8cd616c15c14..a13bf2fdf3ec 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache @@ -45,6 +45,7 @@ public class JSON { /** * Set the date format for JSON (de)serialization with Date properties. + * * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { @@ -64,6 +65,8 @@ public class JSON { * * @param node The input data. * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. */ public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); @@ -123,6 +126,8 @@ public class JSON { * * @param node The input data. * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. */ Class getClassForElement(JsonNode node, Set> visitedClasses) { if (visitedClasses.contains(modelClass)) { @@ -169,6 +174,9 @@ public class JSON { * * @param modelClass A OpenAPI model class. * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java index f39fd0a344b6..df94845d590c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java @@ -159,7 +159,7 @@ public static List parameterToPairs( } /** - * Ctor. + * Create an instance of ApiClient. */ public ApiClient() { this.builder = createDefaultHttpClientBuilder(); @@ -172,7 +172,11 @@ public ApiClient() { } /** - * Ctor. + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI */ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { this.builder = builder; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/JSON.java index 04d3f7c17996..7a69ba9d61d5 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/JSON.java @@ -33,6 +33,7 @@ public JSON() { /** * Set the date format for JSON (de)serialization with Date properties. + * * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { @@ -52,6 +53,8 @@ public void setDateFormat(DateFormat dateFormat) { * * @param node The input data. * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. */ public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); @@ -111,6 +114,8 @@ String getDiscriminatorValue(JsonNode node) { * * @param node The input data. * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. */ Class getClassForElement(JsonNode node, Set> visitedClasses) { if (visitedClasses.contains(modelClass)) { @@ -157,6 +162,9 @@ Class getClassForElement(JsonNode node, Set> visitedClasses) { * * @param modelClass A OpenAPI model class. * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java index f39fd0a344b6..df94845d590c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -159,7 +159,7 @@ public static List parameterToPairs( } /** - * Ctor. + * Create an instance of ApiClient. */ public ApiClient() { this.builder = createDefaultHttpClientBuilder(); @@ -172,7 +172,11 @@ public ApiClient() { } /** - * Ctor. + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI */ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { this.builder = builder; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/JSON.java index 04d3f7c17996..7a69ba9d61d5 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/JSON.java @@ -33,6 +33,7 @@ public JSON() { /** * Set the date format for JSON (de)serialization with Date properties. + * * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { @@ -52,6 +53,8 @@ public void setDateFormat(DateFormat dateFormat) { * * @param node The input data. * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. */ public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); @@ -111,6 +114,8 @@ String getDiscriminatorValue(JsonNode node) { * * @param node The input data. * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. */ Class getClassForElement(JsonNode node, Set> visitedClasses) { if (visitedClasses.contains(modelClass)) { @@ -157,6 +162,9 @@ Class getClassForElement(JsonNode node, Set> visitedClasses) { * * @param modelClass A OpenAPI model class. * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { From 182fe9370e7519689c13e86b5713893f36b8b16b Mon Sep 17 00:00:00 2001 From: Bernhard Danecker Date: Wed, 23 Feb 2022 09:11:18 +0100 Subject: [PATCH 109/111] =?UTF-8?q?=20[Java][Spring]=20fix=20unhandledExce?= =?UTF-8?q?ption=20not=20working=20in=20combination=20with=E2=80=A6=20(#98?= =?UTF-8?q?79)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #4393 fix unhandledException not working in combination with skipDefaultInterface * generate samples --- ...t-defaultInterface-unhandledException.yaml | 11 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 57 ++ .../.openapi-generator/VERSION | 1 + .../README.md | 27 + .../pom.xml | 72 ++ .../org/openapitools/api/AnotherFakeApi.java | 64 ++ .../java/org/openapitools/api/ApiUtil.java | 19 + .../java/org/openapitools/api/FakeApi.java | 498 +++++++++++ .../api/FakeClassnameTestApi.java | 67 ++ .../java/org/openapitools/api/PetApi.java | 297 +++++++ .../java/org/openapitools/api/StoreApi.java | 153 ++++ .../java/org/openapitools/api/UserApi.java | 246 +++++ .../model/AdditionalPropertiesAnyType.java | 87 ++ .../model/AdditionalPropertiesArray.java | 88 ++ .../model/AdditionalPropertiesBoolean.java | 87 ++ .../model/AdditionalPropertiesClass.java | 399 +++++++++ .../model/AdditionalPropertiesInteger.java | 87 ++ .../model/AdditionalPropertiesNumber.java | 88 ++ .../model/AdditionalPropertiesObject.java | 87 ++ .../model/AdditionalPropertiesString.java | 87 ++ .../java/org/openapitools/model/Animal.java | 115 +++ .../model/ArrayOfArrayOfNumberOnly.java | 95 ++ .../openapitools/model/ArrayOfNumberOnly.java | 95 ++ .../org/openapitools/model/ArrayTest.java | 161 ++++ .../java/org/openapitools/model/BigCat.java | 127 +++ .../org/openapitools/model/BigCatAllOf.java | 125 +++ .../openapitools/model/Capitalization.java | 203 +++++ .../main/java/org/openapitools/model/Cat.java | 87 ++ .../java/org/openapitools/model/CatAllOf.java | 85 ++ .../java/org/openapitools/model/Category.java | 107 +++ .../org/openapitools/model/ClassModel.java | 84 ++ .../java/org/openapitools/model/Client.java | 83 ++ .../main/java/org/openapitools/model/Dog.java | 87 ++ .../java/org/openapitools/model/DogAllOf.java | 85 ++ .../org/openapitools/model/EnumArrays.java | 189 ++++ .../org/openapitools/model/EnumClass.java | 58 ++ .../java/org/openapitools/model/EnumTest.java | 327 +++++++ .../java/org/openapitools/model/File.java | 84 ++ .../model/FileSchemaTestClass.java | 119 +++ .../org/openapitools/model/FormatTest.java | 415 +++++++++ .../openapitools/model/HasOnlyReadOnly.java | 109 +++ .../java/org/openapitools/model/MapTest.java | 230 +++++ ...ropertiesAndAdditionalPropertiesClass.java | 148 +++ .../openapitools/model/Model200Response.java | 110 +++ .../openapitools/model/ModelApiResponse.java | 133 +++ .../org/openapitools/model/ModelList.java | 85 ++ .../org/openapitools/model/ModelReturn.java | 86 ++ .../java/org/openapitools/model/Name.java | 156 ++++ .../org/openapitools/model/NumberOnly.java | 84 ++ .../java/org/openapitools/model/Order.java | 244 +++++ .../openapitools/model/OuterComposite.java | 132 +++ .../org/openapitools/model/OuterEnum.java | 58 ++ .../main/java/org/openapitools/model/Pet.java | 264 ++++++ .../org/openapitools/model/ReadOnlyFirst.java | 107 +++ .../openapitools/model/SpecialModelName.java | 85 ++ .../main/java/org/openapitools/model/Tag.java | 107 +++ .../openapitools/model/TypeHolderDefault.java | 188 ++++ .../openapitools/model/TypeHolderExample.java | 212 +++++ .../java/org/openapitools/model/User.java | 251 ++++++ .../java/org/openapitools/model/XmlItem.java | 839 ++++++++++++++++++ 61 files changed, 8904 insertions(+) create mode 100644 bin/configs/spring-boot-defaultInterface-unhandledException.yaml create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator-ignore create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/VERSION create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/README.md create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/ApiUtil.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/CatAllOf.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/DogAllOf.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumClass.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterEnum.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java create mode 100644 samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java diff --git a/bin/configs/spring-boot-defaultInterface-unhandledException.yaml b/bin/configs/spring-boot-defaultInterface-unhandledException.yaml new file mode 100644 index 000000000000..3d492c12f767 --- /dev/null +++ b/bin/configs/spring-boot-defaultInterface-unhandledException.yaml @@ -0,0 +1,11 @@ +generatorName: spring +outputDir: samples/server/petstore/spring-boot-defaultInterface-unhandledException +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: spring-boot-defaultInterface-unhandledException + hideGenerationTimestamp: true + java8: true + interfaceOnly: true + skipDefaultInterface: true + unhandledException: true diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator-ignore b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.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/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES new file mode 100644 index 000000000000..8bf287f9b1fe --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES @@ -0,0 +1,57 @@ +README.md +pom.xml +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/File.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelList.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/VERSION b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/VERSION new file mode 100644 index 000000000000..5f68295fc196 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/README.md b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/README.md new file mode 100644 index 000000000000..d43a1de307df --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/README.md @@ -0,0 +1,27 @@ + +# OpenAPI generated API stub + +Spring Framework stub + + +## Overview +This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub. +This is an example of building API stub interfaces in Java using the Spring framework. + +The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints +by adding ```@Controller``` classes that implement the interface. Eg: +```java +@Controller +public class PetController implements PetApi { +// implement all PetApi methods +} +``` + +You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg: +```java +@FeignClient(name="pet", url="http://petstore.swagger.io/v2") +public interface PetClient extends PetApi { + +} +``` diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml new file mode 100644 index 000000000000..05f2488b9e9e --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + org.openapitools + spring-boot-defaultInterface-unhandledException + jar + spring-boot-defaultInterface-unhandledException + 1.0.0 + + 1.8 + ${java.version} + ${java.version} + 1.6.4 + 4.4.1-1 + + + org.springframework.boot + spring-boot-starter-parent + 2.6.3 + + + src/main/java + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.data + spring-data-commons + + + + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.2 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java new file mode 100644 index 000000000000..cd1077275bdb --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -0,0 +1,64 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.Client; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "another-fake", description = "the another-fake API") +public interface AnotherFakeApi { + + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param body client model (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "call123testSpecialTags", + summary = "To test special tags", + tags = { "$another-fake?" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" } + ) + ResponseEntity call123testSpecialTags( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) throws Exception; + +} diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/ApiUtil.java new file mode 100644 index 000000000000..1245b1dd0ccf --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/ApiUtil.java @@ -0,0 +1,19 @@ +package org.openapitools.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java new file mode 100644 index 000000000000..ade63d344bd2 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java @@ -0,0 +1,498 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.math.BigDecimal; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "fake", description = "the fake API") +public interface FakeApi { + + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createXmlItem", + summary = "creates an XmlItem", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/create_xml_item", + consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } + ) + ResponseEntity createXmlItem( + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + ) throws Exception; + + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + */ + @Operation( + operationId = "fakeOuterBooleanSerialize", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/outer/boolean", + produces = { "*/*" } + ) + ResponseEntity fakeOuterBooleanSerialize( + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body + ) throws Exception; + + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param body Input composite as post body (optional) + * @return Output composite (status code 200) + */ + @Operation( + operationId = "fakeOuterCompositeSerialize", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/outer/composite", + produces = { "*/*" } + ) + ResponseEntity fakeOuterCompositeSerialize( + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + ) throws Exception; + + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + */ + @Operation( + operationId = "fakeOuterNumberSerialize", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/outer/number", + produces = { "*/*" } + ) + ResponseEntity fakeOuterNumberSerialize( + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body + ) throws Exception; + + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + */ + @Operation( + operationId = "fakeOuterStringSerialize", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/outer/string", + produces = { "*/*" } + ) + ResponseEntity fakeOuterStringSerialize( + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body + ) throws Exception; + + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param body (required) + * @return Success (status code 200) + */ + @Operation( + operationId = "testBodyWithFileSchema", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "Success") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/fake/body-with-file-schema", + consumes = { "application/json" } + ) + ResponseEntity testBodyWithFileSchema( + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + ) throws Exception; + + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param body (required) + * @return Success (status code 200) + */ + @Operation( + operationId = "testBodyWithQueryParams", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "Success") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/fake/body-with-query-params", + consumes = { "application/json" } + ) + ResponseEntity testBodyWithQueryParams( + @NotNull @Parameter(name = "query", description = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + ) throws Exception; + + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param body client model (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "testClientModel", + summary = "To test \"client\" model", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/fake", + produces = { "application/json" }, + consumes = { "application/json" } + ) + ResponseEntity testClientModel( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) throws Exception; + + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "testEndpointParameters", + summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "http_basic_test") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake", + consumes = { "application/x-www-form-urlencoded" } + ) + ResponseEntity testEndpointParameters( + @Parameter(name = "number", description = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + ) throws Exception; + + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + */ + @Operation( + operationId = "testEnumParameters", + summary = "To test enum parameters", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request"), + @ApiResponse(responseCode = "404", description = "Not found") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake", + consumes = { "application/x-www-form-urlencoded" } + ) + ResponseEntity testEnumParameters( + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString + ) throws Exception; + + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Someting wrong (status code 400) + */ + @Operation( + operationId = "testGroupParameters", + summary = "Fake endpoint to test group parameters (optional)", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/fake" + ) + ResponseEntity testGroupParameters( + @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @Parameter(name = "string_group", description = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group + ) throws Exception; + + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * @param param request body (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "testInlineAdditionalProperties", + summary = "test inline additionalProperties", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/inline-additionalProperties", + consumes = { "application/json" } + ) + ResponseEntity testInlineAdditionalProperties( + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + ) throws Exception; + + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "testJsonFormData", + summary = "test json serialization of form data", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/jsonFormData", + consumes = { "application/x-www-form-urlencoded" } + ) + ResponseEntity testJsonFormData( + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + ) throws Exception; + + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + */ + @Operation( + operationId = "testQueryParameterCollectionFormat", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "Success") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/fake/test-query-parameters" + ) + ResponseEntity testQueryParameterCollectionFormat( + @NotNull @Parameter(name = "pipe", description = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @Parameter(name = "http", description = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @Parameter(name = "url", description = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @Parameter(name = "context", description = "", required = true) @Valid @RequestParam(value = "context", required = true) List context + ) throws Exception; + + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "uploadFileWithRequiredFile", + summary = "uploads an image (required)", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/{petId}/uploadImageWithRequiredFile", + produces = { "application/json" }, + consumes = { "multipart/form-data" } + ) + ResponseEntity uploadFileWithRequiredFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + ) throws Exception; + +} diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java new file mode 100644 index 000000000000..df22180bde30 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -0,0 +1,67 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.Client; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") +public interface FakeClassnameTestApi { + + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param body client model (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "testClassname", + summary = "To test class name in snake case", + tags = { "fake_classname_tags 123#$%^" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) + }) + }, + security = { + @SecurityRequirement(name = "api_key_query") + } + ) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/fake_classname_test", + produces = { "application/json" }, + consumes = { "application/json" } + ) + ResponseEntity testClassname( + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + ) throws Exception; + +} diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 000000000000..391f37fabd83 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,297 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "pet", description = "the pet API") +public interface PetApi { + + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + */ + @Operation( + operationId = "addPet", + summary = "Add a new pet to the store", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation"), + @ApiResponse(responseCode = "405", description = "Invalid input") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet", + consumes = { "application/json", "application/xml" } + ) + ResponseEntity addPet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) throws Exception; + + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + */ + @Operation( + operationId = "deletePet", + summary = "Deletes a pet", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation"), + @ApiResponse(responseCode = "400", description = "Invalid pet value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/pet/{petId}" + ) + ResponseEntity deletePet( + @Parameter(name = "petId", description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "") @RequestHeader(value = "api_key", required = false) String apiKey + ) throws Exception; + + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + */ + @Operation( + operationId = "findPetsByStatus", + summary = "Finds Pets by status", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid status value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByStatus", + produces = { "application/xml", "application/json" } + ) + ResponseEntity> findPetsByStatus( + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status + ) throws Exception; + + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + */ + @Operation( + operationId = "findPetsByTags", + summary = "Finds Pets by tags", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid tag value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByTags", + produces = { "application/xml", "application/json" } + ) + ResponseEntity> findPetsByTags( + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) throws Exception; + + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + */ + @Operation( + operationId = "getPetById", + summary = "Find pet by ID", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/{petId}", + produces = { "application/xml", "application/json" } + ) + ResponseEntity getPetById( + @Parameter(name = "petId", description = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) throws Exception; + + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + */ + @Operation( + operationId = "updatePet", + summary = "Update an existing pet", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation"), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/pet", + consumes = { "application/json", "application/xml" } + ) + ResponseEntity updatePet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ) throws Exception; + + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + */ + @Operation( + operationId = "updatePetWithForm", + summary = "Updates a pet in the store with form data", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}", + consumes = { "application/x-www-form-urlencoded" } + ) + ResponseEntity updatePetWithForm( + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status + ) throws Exception; + + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "uploadFile", + summary = "uploads an image", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) + }) + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}/uploadImage", + produces = { "application/json" }, + consumes = { "multipart/form-data" } + ) + ResponseEntity uploadFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) throws Exception; + +} diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 000000000000..0ff28ee8d7e2 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,153 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.Order; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @Operation( + operationId = "deleteOrder", + summary = "Delete purchase order by ID", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/store/order/{order_id}" + ) + ResponseEntity deleteOrder( + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) throws Exception; + + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "getInventory", + summary = "Returns pet inventories by status", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/inventory", + produces = { "application/json" } + ) + ResponseEntity> getInventory( + + ) throws Exception; + + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @Operation( + operationId = "getOrderById", + summary = "Find purchase order by ID", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/order/{order_id}", + produces = { "application/xml", "application/json" } + ) + ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) throws Exception; + + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + */ + @Operation( + operationId = "placeOrder", + summary = "Place an order for a pet", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid Order") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/store/order", + produces = { "application/xml", "application/json" } + ) + ResponseEntity placeOrder( + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + ) throws Exception; + +} diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 000000000000..84983c404187 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,246 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "user", description = "the user API") +public interface UserApi { + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUser", + summary = "Create user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user" + ) + ResponseEntity createUser( + @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + ) throws Exception; + + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUsersWithArrayInput", + summary = "Creates list of users with given input array", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithArray" + ) + ResponseEntity createUsersWithArrayInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) throws Exception; + + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUsersWithListInput", + summary = "Creates list of users with given input array", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithList" + ) + ResponseEntity createUsersWithListInput( + @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + ) throws Exception; + + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "deleteUser", + summary = "Delete user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/user/{username}" + ) + ResponseEntity deleteUser( + @Parameter(name = "username", description = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) throws Exception; + + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "getUserByName", + summary = "Get user by user name", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/{username}", + produces = { "application/xml", "application/json" } + ) + ResponseEntity getUserByName( + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) throws Exception; + + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + */ + @Operation( + operationId = "loginUser", + summary = "Logs user into the system", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/login", + produces = { "application/xml", "application/json" } + ) + ResponseEntity loginUser( + @NotNull @Parameter(name = "username", description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) throws Exception; + + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "logoutUser", + summary = "Logs out current logged in user session", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/logout" + ) + ResponseEntity logoutUser( + + ) throws Exception; + + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "updateUser", + summary = "Updated user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/user/{username}" + ) + ResponseEntity updateUser( + @Parameter(name = "username", description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + ) throws Exception; + +} diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java new file mode 100644 index 000000000000..88ea058c0c51 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesAnyType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesAnyType extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; + return Objects.equals(this.name, additionalPropertiesAnyType.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java new file mode 100644 index 000000000000..0d4d67f1a9e9 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -0,0 +1,88 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesArray + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesArray extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; + return Objects.equals(this.name, additionalPropertiesArray.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java new file mode 100644 index 000000000000..219d797ee642 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesBoolean + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesBoolean extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; + return Objects.equals(this.name, additionalPropertiesBoolean.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBoolean {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..b2245551ad3e --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -0,0 +1,399 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesClass { + + @JsonProperty("map_string") + @Valid + private Map mapString = null; + + @JsonProperty("map_number") + @Valid + private Map mapNumber = null; + + @JsonProperty("map_integer") + @Valid + private Map mapInteger = null; + + @JsonProperty("map_boolean") + @Valid + private Map mapBoolean = null; + + @JsonProperty("map_array_integer") + @Valid + private Map> mapArrayInteger = null; + + @JsonProperty("map_array_anytype") + @Valid + private Map> mapArrayAnytype = null; + + @JsonProperty("map_map_string") + @Valid + private Map> mapMapString = null; + + @JsonProperty("map_map_anytype") + @Valid + private Map> mapMapAnytype = null; + + @JsonProperty("anytype_1") + private Object anytype1; + + @JsonProperty("anytype_2") + private Object anytype2; + + @JsonProperty("anytype_3") + private Object anytype3; + + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; + return this; + } + + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap<>(); + } + this.mapString.put(key, mapStringItem); + return this; + } + + /** + * Get mapString + * @return mapString + */ + + @Schema(name = "map_string", required = false) + public Map getMapString() { + return mapString; + } + + public void setMapString(Map mapString) { + this.mapString = mapString; + } + + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + return this; + } + + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap<>(); + } + this.mapNumber.put(key, mapNumberItem); + return this; + } + + /** + * Get mapNumber + * @return mapNumber + */ + @Valid + @Schema(name = "map_number", required = false) + public Map getMapNumber() { + return mapNumber; + } + + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap<>(); + } + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + /** + * Get mapInteger + * @return mapInteger + */ + + @Schema(name = "map_integer", required = false) + public Map getMapInteger() { + return mapInteger; + } + + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap<>(); + } + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + /** + * Get mapBoolean + * @return mapBoolean + */ + + @Schema(name = "map_boolean", required = false) + public Map getMapBoolean() { + return mapBoolean; + } + + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap<>(); + } + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + /** + * Get mapArrayInteger + * @return mapArrayInteger + */ + @Valid + @Schema(name = "map_array_integer", required = false) + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap<>(); + } + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + /** + * Get mapArrayAnytype + * @return mapArrayAnytype + */ + @Valid + @Schema(name = "map_array_anytype", required = false) + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap<>(); + } + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + /** + * Get mapMapString + * @return mapMapString + */ + @Valid + @Schema(name = "map_map_string", required = false) + public Map> getMapMapString() { + return mapMapString; + } + + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap<>(); + } + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + /** + * Get mapMapAnytype + * @return mapMapAnytype + */ + @Valid + @Schema(name = "map_map_anytype", required = false) + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + */ + + @Schema(name = "anytype_1", required = false) + public Object getAnytype1() { + return anytype1; + } + + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; + return this; + } + + /** + * Get anytype2 + * @return anytype2 + */ + + @Schema(name = "anytype_2", required = false) + public Object getAnytype2() { + return anytype2; + } + + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; + return this; + } + + /** + * Get anytype3 + * @return anytype3 + */ + + @Schema(name = "anytype_3", required = false) + public Object getAnytype3() { + return anytype3; + } + + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && + Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); + } + + @Override + public int hashCode() { + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java new file mode 100644 index 000000000000..ea102c40ed2e --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesInteger + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesInteger extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(this.name, additionalPropertiesInteger.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesInteger {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java new file mode 100644 index 000000000000..7a3a5d839f8a --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -0,0 +1,88 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesNumber + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesNumber extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(this.name, additionalPropertiesNumber.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumber {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java new file mode 100644 index 000000000000..22e47f1bc1cb --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesObject + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesObject extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(this.name, additionalPropertiesObject.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObject {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java new file mode 100644 index 000000000000..91f47a9e83ee --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesString + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesString extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(this.name, additionalPropertiesString.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesString {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java new file mode 100644 index 000000000000..ef0fc61b5b6a --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java @@ -0,0 +1,115 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Animal + */ + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), +}) +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Animal { + + @JsonProperty("className") + private String className; + + @JsonProperty("color") + private String color = "red"; + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @NotNull + @Schema(name = "className", required = true) + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + */ + + @Schema(name = "color", required = false) + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..ad560c9d8344 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,95 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayOfArrayOfNumberOnly + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ArrayOfArrayOfNumberOnly { + + @JsonProperty("ArrayArrayNumber") + @Valid + private List> arrayArrayNumber = null; + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + */ + @Valid + @Schema(name = "ArrayArrayNumber", required = false) + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..4409856d5a37 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -0,0 +1,95 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayOfNumberOnly + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ArrayOfNumberOnly { + + @JsonProperty("ArrayNumber") + @Valid + private List arrayNumber = null; + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + */ + @Valid + @Schema(name = "ArrayNumber", required = false) + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java new file mode 100644 index 000000000000..fd25397b6b67 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java @@ -0,0 +1,161 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.ReadOnlyFirst; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayTest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ArrayTest { + + @JsonProperty("array_of_string") + @Valid + private List arrayOfString = null; + + @JsonProperty("array_array_of_integer") + @Valid + private List> arrayArrayOfInteger = null; + + @JsonProperty("array_array_of_model") + @Valid + private List> arrayArrayOfModel = null; + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + */ + + @Schema(name = "array_of_string", required = false) + public List getArrayOfString() { + return arrayOfString; + } + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + */ + @Valid + @Schema(name = "array_array_of_integer", required = false) + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + */ + @Valid + @Schema(name = "array_array_of_model", required = false) + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..275a075f527d --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java @@ -0,0 +1,127 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * BigCat + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class BigCat extends Cat { + + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + */ + + @Schema(name = "kind", required = false) + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..843e46a1f6cd --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,125 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * BigCatAllOf + */ + +@JsonTypeName("BigCat_allOf") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class BigCatAllOf { + + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + */ + + @Schema(name = "kind", required = false) + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java new file mode 100644 index 000000000000..80d6c5b28514 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java @@ -0,0 +1,203 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Capitalization + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Capitalization { + + @JsonProperty("smallCamel") + private String smallCamel; + + @JsonProperty("CapitalCamel") + private String capitalCamel; + + @JsonProperty("small_Snake") + private String smallSnake; + + @JsonProperty("Capital_Snake") + private String capitalSnake; + + @JsonProperty("SCA_ETH_Flow_Points") + private String scAETHFlowPoints; + + @JsonProperty("ATT_NAME") + private String ATT_NAME; + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + */ + + @Schema(name = "smallCamel", required = false) + public String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + */ + + @Schema(name = "CapitalCamel", required = false) + public String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + */ + + @Schema(name = "small_Snake", required = false) + public String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + */ + + @Schema(name = "Capital_Snake", required = false) + public String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + */ + + @Schema(name = "SCA_ETH_Flow_Points", required = false) + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + */ + + @Schema(name = "ATT_NAME", description = "Name of the pet ", required = false) + public String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java new file mode 100644 index 000000000000..0b3c8b8759b2 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Cat + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Cat extends Animal { + + @JsonProperty("declawed") + private Boolean declawed; + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + */ + + @Schema(name = "declawed", required = false) + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/CatAllOf.java new file mode 100644 index 000000000000..88bc8c3d6492 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/CatAllOf.java @@ -0,0 +1,85 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CatAllOf + */ + +@JsonTypeName("Cat_allOf") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class CatAllOf { + + @JsonProperty("declawed") + private Boolean declawed; + + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + */ + + @Schema(name = "declawed", required = false) + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(this.declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 000000000000..66dd429525dd --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,107 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Category + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Category { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name = "default-name"; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", required = true) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java new file mode 100644 index 000000000000..13a83893e619 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java @@ -0,0 +1,84 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model with \"_class\" property + */ + +@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ClassModel { + + @JsonProperty("_class") + private String propertyClass; + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @Schema(name = "_class", required = false) + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java new file mode 100644 index 000000000000..9fbd7e3b4338 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java @@ -0,0 +1,83 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Client + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Client { + + @JsonProperty("client") + private String client; + + public Client client(String client) { + this.client = client; + return this; + } + + /** + * Get client + * @return client + */ + + @Schema(name = "client", required = false) + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java new file mode 100644 index 000000000000..36f36600dafa --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Dog + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Dog extends Animal { + + @JsonProperty("breed") + private String breed; + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + */ + + @Schema(name = "breed", required = false) + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/DogAllOf.java new file mode 100644 index 000000000000..1a4f50f5bcd4 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/DogAllOf.java @@ -0,0 +1,85 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * DogAllOf + */ + +@JsonTypeName("Dog_allOf") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class DogAllOf { + + @JsonProperty("breed") + private String breed; + + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + */ + + @Schema(name = "breed", required = false) + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(this.breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java new file mode 100644 index 000000000000..c3e82d4c0282 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java @@ -0,0 +1,189 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EnumArrays + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class EnumArrays { + + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("just_symbol") + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("array_enum") + @Valid + private List arrayEnum = null; + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + */ + + @Schema(name = "just_symbol", required = false) + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + */ + + @Schema(name = "array_enum", required = false) + public List getArrayEnum() { + return arrayEnum; + } + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumClass.java new file mode 100644 index 000000000000..4e6027d16c4e --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumClass.java @@ -0,0 +1,58 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java new file mode 100644 index 000000000000..fb2ee5373fbf --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java @@ -0,0 +1,327 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.model.OuterEnum; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EnumTest + */ + +@JsonTypeName("Enum_Test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class EnumTest { + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("enum_string") + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("enum_integer") + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("enum_number") + private EnumNumberEnum enumNumber; + + @JsonProperty("outerEnum") + private OuterEnum outerEnum; + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + */ + + @Schema(name = "enum_string", required = false) + public EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + */ + @NotNull + @Schema(name = "enum_string_required", required = true) + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + */ + + @Schema(name = "enum_integer", required = false) + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + */ + + @Schema(name = "enum_number", required = false) + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + */ + @Valid + @Schema(name = "outerEnum", required = false) + public OuterEnum getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java new file mode 100644 index 000000000000..a2ee29fbfd69 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java @@ -0,0 +1,84 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Must be named `File` for test. + */ + +@Schema(name = "File", description = "Must be named `File` for test.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class File { + + @JsonProperty("sourceURI") + private String sourceURI; + + public File sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + */ + + @Schema(name = "sourceURI", description = "Test capitalization", required = false) + public String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + File file = (File) o; + return Objects.equals(this.sourceURI, file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class File {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..77868e774104 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -0,0 +1,119 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FileSchemaTestClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class FileSchemaTestClass { + + @JsonProperty("file") + private File file; + + @JsonProperty("files") + @Valid + private List files = null; + + public FileSchemaTestClass file(File file) { + this.file = file; + return this; + } + + /** + * Get file + * @return file + */ + @Valid + @Schema(name = "file", required = false) + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + */ + @Valid + @Schema(name = "files", required = false) + public List getFiles() { + return files; + } + + public void setFiles(List files) { + this.files = files; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this.file, fileSchemaTestClass.file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java new file mode 100644 index 000000000000..05abfd1c26ef --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java @@ -0,0 +1,415 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FormatTest + */ + +@JsonTypeName("format_test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class FormatTest { + + @JsonProperty("integer") + private Integer integer; + + @JsonProperty("int32") + private Integer int32; + + @JsonProperty("int64") + private Long int64; + + @JsonProperty("number") + private BigDecimal number; + + @JsonProperty("float") + private Float _float; + + @JsonProperty("double") + private Double _double; + + @JsonProperty("string") + private String string; + + @JsonProperty("byte") + private byte[] _byte; + + @JsonProperty("binary") + private org.springframework.core.io.Resource binary; + + @JsonProperty("date") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate date; + + @JsonProperty("dateTime") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime dateTime; + + @JsonProperty("uuid") + private UUID uuid; + + @JsonProperty("password") + private String password; + + @JsonProperty("BigDecimal") + private BigDecimal bigDecimal; + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + */ + @Min(10) @Max(100) + @Schema(name = "integer", required = false) + public Integer getInteger() { + return integer; + } + + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + */ + @Min(20) @Max(200) + @Schema(name = "int32", required = false) + public Integer getInt32() { + return int32; + } + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + */ + + @Schema(name = "int64", required = false) + public Long getInt64() { + return int64; + } + + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") + @Schema(name = "number", required = true) + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + */ + @DecimalMin("54.3") @DecimalMax("987.6") + @Schema(name = "float", required = false) + public Float getFloat() { + return _float; + } + + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + */ + @DecimalMin("67.8") @DecimalMax("123.4") + @Schema(name = "double", required = false) + public Double getDouble() { + return _double; + } + + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + @Pattern(regexp = "/[a-z]/i") + @Schema(name = "string", required = false) + public String getString() { + return string; + } + + public void setString(String string) { + this.string = string; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + */ + @NotNull + @Schema(name = "byte", required = true) + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest binary(org.springframework.core.io.Resource binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + */ + @Valid + @Schema(name = "binary", required = false) + public org.springframework.core.io.Resource getBinary() { + return binary; + } + + public void setBinary(org.springframework.core.io.Resource binary) { + this.binary = binary; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @NotNull @Valid + @Schema(name = "date", required = true) + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @Valid + @Schema(name = "dateTime", required = false) + public OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @Valid + @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", required = false) + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @NotNull @Size(min = 10, max = 64) + @Schema(name = "password", required = true) + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + + /** + * Get bigDecimal + * @return bigDecimal + */ + @Valid + @Schema(name = "BigDecimal", required = false) + public BigDecimal getBigDecimal() { + return bigDecimal; + } + + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.bigDecimal, formatTest.bigDecimal); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..768e7277a703 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -0,0 +1,109 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * HasOnlyReadOnly + */ + +@JsonTypeName("hasOnlyReadOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class HasOnlyReadOnly { + + @JsonProperty("bar") + private String bar; + + @JsonProperty("foo") + private String foo; + + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + /** + * Get foo + * @return foo + */ + + @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, required = false) + public String getFoo() { + return foo; + } + + public void setFoo(String foo) { + this.foo = foo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java new file mode 100644 index 000000000000..2da2a81ac823 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java @@ -0,0 +1,230 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * MapTest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class MapTest { + + @JsonProperty("map_map_of_string") + @Valid + private Map> mapMapOfString = null; + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("map_of_enum_string") + @Valid + private Map mapOfEnumString = null; + + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + @Valid + private Map indirectMap = null; + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + */ + @Valid + @Schema(name = "map_map_of_string", required = false) + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + */ + + @Schema(name = "map_of_enum_string", required = false) + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + */ + + @Schema(name = "direct_map", required = false) + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + */ + + @Schema(name = "indirect_map", required = false) + public Map getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..9681c13f29d4 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,148 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class MixedPropertiesAndAdditionalPropertiesClass { + + @JsonProperty("uuid") + private UUID uuid; + + @JsonProperty("dateTime") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime dateTime; + + @JsonProperty("map") + @Valid + private Map map = null; + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @Valid + @Schema(name = "uuid", required = false) + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @Valid + @Schema(name = "dateTime", required = false) + public OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + */ + @Valid + @Schema(name = "map", required = false) + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java new file mode 100644 index 000000000000..95f81f418d28 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java @@ -0,0 +1,110 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model name starting with number + */ + +@Schema(name = "200_response", description = "Model for testing model name starting with number") +@JsonTypeName("200_response") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Model200Response { + + @JsonProperty("name") + private Integer name; + + @JsonProperty("class") + private String propertyClass; + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @Schema(name = "class", required = false) + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 000000000000..474ed54662f7 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,133 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ModelApiResponse + */ + +@JsonTypeName("ApiResponse") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ModelApiResponse { + + @JsonProperty("code") + private Integer code; + + @JsonProperty("type") + private String type; + + @JsonProperty("message") + private String message; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + + @Schema(name = "code", required = false) + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @Schema(name = "type", required = false) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + + @Schema(name = "message", required = false) + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java new file mode 100644 index 000000000000..7615d501057e --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java @@ -0,0 +1,85 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ModelList + */ + +@JsonTypeName("List") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ModelList { + + @JsonProperty("123-list") + private String _123list; + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + */ + + @Schema(name = "123-list", required = false) + public String get123list() { + return _123list; + } + + public void set123list(String _123list) { + this._123list = _123list; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java new file mode 100644 index 000000000000..eef02c8ade31 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java @@ -0,0 +1,86 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing reserved words + */ + +@Schema(name = "Return", description = "Model for testing reserved words") +@JsonTypeName("Return") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ModelReturn { + + @JsonProperty("return") + private Integer _return; + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + */ + + @Schema(name = "return", required = false) + public Integer getReturn() { + return _return; + } + + public void setReturn(Integer _return) { + this._return = _return; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java new file mode 100644 index 000000000000..2876e64e9917 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java @@ -0,0 +1,156 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model name same as property name + */ + +@Schema(name = "Name", description = "Model for testing model name same as property name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Name { + + @JsonProperty("name") + private Integer name; + + @JsonProperty("snake_case") + private Integer snakeCase; + + @JsonProperty("property") + private String property; + + @JsonProperty("123Number") + private Integer _123number; + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", required = true) + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + */ + + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, required = false) + public Integer getSnakeCase() { + return snakeCase; + } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + */ + + @Schema(name = "property", required = false) + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public Name _123number(Integer _123number) { + this._123number = _123number; + return this; + } + + /** + * Get _123number + * @return _123number + */ + + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, required = false) + public Integer get123number() { + return _123number; + } + + public void set123number(Integer _123number) { + this._123number = _123number; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java new file mode 100644 index 000000000000..05c9f0a77856 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java @@ -0,0 +1,84 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * NumberOnly + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class NumberOnly { + + @JsonProperty("JustNumber") + private BigDecimal justNumber; + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + */ + @Valid + @Schema(name = "JustNumber", required = false) + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 000000000000..90b0d2957184 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,244 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Order + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Order { + + @JsonProperty("id") + private Long id; + + @JsonProperty("petId") + private Long petId; + + @JsonProperty("quantity") + private Integer quantity; + + @JsonProperty("shipDate") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + */ + + @Schema(name = "petId", required = false) + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + */ + + @Schema(name = "quantity", required = false) + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + */ + @Valid + @Schema(name = "shipDate", required = false) + public OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + */ + + @Schema(name = "status", description = "Order Status", required = false) + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + + @Schema(name = "complete", required = false) + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java new file mode 100644 index 000000000000..14ff8ff8a9f4 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java @@ -0,0 +1,132 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * OuterComposite + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OuterComposite { + + @JsonProperty("my_number") + private BigDecimal myNumber; + + @JsonProperty("my_string") + private String myString; + + @JsonProperty("my_boolean") + private Boolean myBoolean; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + */ + @Valid + @Schema(name = "my_number", required = false) + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + */ + + @Schema(name = "my_string", required = false) + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + */ + + @Schema(name = "my_boolean", required = false) + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterEnum.java new file mode 100644 index 000000000000..7fdf6f47de31 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterEnum.java @@ -0,0 +1,58 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 000000000000..51d583a02e55 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,264 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Pet + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Pet { + + @JsonProperty("id") + private Long id; + + @JsonProperty("category") + private Category category; + + @JsonProperty("name") + private String name; + + @JsonProperty("photoUrls") + @Valid + private Set photoUrls = new LinkedHashSet<>(); + + @JsonProperty("tags") + @Valid + private List tags = null; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @Valid + @Schema(name = "category", required = false) + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", example = "doggie", required = true) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + */ + @NotNull + @Schema(name = "photoUrls", required = true) + public Set getPhotoUrls() { + return photoUrls; + } + + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @Valid + @Schema(name = "tags", required = false) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + */ + + @Schema(name = "status", description = "pet status in the store", required = false) + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..1d95448aeefe --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -0,0 +1,107 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ReadOnlyFirst + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ReadOnlyFirst { + + @JsonProperty("bar") + private String bar; + + @JsonProperty("baz") + private String baz; + + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + */ + + @Schema(name = "baz", required = false) + public String getBaz() { + return baz; + } + + public void setBaz(String baz) { + this.baz = baz; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java new file mode 100644 index 000000000000..1eac86e9ebca --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java @@ -0,0 +1,85 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * SpecialModelName + */ + +@JsonTypeName("$special[model.name]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class SpecialModelName { + + @JsonProperty("$special[property.name]") + private Long $specialPropertyName; + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + /** + * Get $specialPropertyName + * @return $specialPropertyName + */ + + @Schema(name = "$special[property.name]", required = false) + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 000000000000..6b24df204718 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,107 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Tag + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Tag { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java new file mode 100644 index 000000000000..66695c3e8478 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -0,0 +1,188 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TypeHolderDefault + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class TypeHolderDefault { + + @JsonProperty("string_item") + private String stringItem = "what"; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem = true; + + @JsonProperty("array_item") + @Valid + private List arrayItem = new ArrayList<>(); + + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + */ + @NotNull + @Schema(name = "string_item", required = true) + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + */ + @NotNull @Valid + @Schema(name = "number_item", required = true) + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + */ + @NotNull + @Schema(name = "integer_item", required = true) + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + */ + @NotNull + @Schema(name = "bool_item", required = true) + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + */ + @NotNull + @Schema(name = "array_item", required = true) + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && + Objects.equals(this.numberItem, typeHolderDefault.numberItem) && + Objects.equals(this.integerItem, typeHolderDefault.integerItem) && + Objects.equals(this.boolItem, typeHolderDefault.boolItem) && + Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java new file mode 100644 index 000000000000..fdc9a0960759 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -0,0 +1,212 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TypeHolderExample + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class TypeHolderExample { + + @JsonProperty("string_item") + private String stringItem; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("float_item") + private Float floatItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem; + + @JsonProperty("array_item") + @Valid + private List arrayItem = new ArrayList<>(); + + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + */ + @NotNull + @Schema(name = "string_item", example = "what", required = true) + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + */ + @NotNull @Valid + @Schema(name = "number_item", example = "1.234", required = true) + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @NotNull + @Schema(name = "float_item", example = "1.234", required = true) + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + */ + @NotNull + @Schema(name = "integer_item", example = "-2", required = true) + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + */ + @NotNull + @Schema(name = "bool_item", example = "true", required = true) + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + */ + @NotNull + @Schema(name = "array_item", example = "[0, 1, 2, 3]", required = true) + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(this.stringItem, typeHolderExample.stringItem) && + Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && + Objects.equals(this.integerItem, typeHolderExample.integerItem) && + Objects.equals(this.boolItem, typeHolderExample.boolItem) && + Objects.equals(this.arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java new file mode 100644 index 000000000000..9aae48b0ceb2 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,251 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * User + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class User { + + @JsonProperty("id") + private Long id; + + @JsonProperty("username") + private String username; + + @JsonProperty("firstName") + private String firstName; + + @JsonProperty("lastName") + private String lastName; + + @JsonProperty("email") + private String email; + + @JsonProperty("password") + private String password; + + @JsonProperty("phone") + private String phone; + + @JsonProperty("userStatus") + private Integer userStatus; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + + @Schema(name = "username", required = false) + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + + @Schema(name = "firstName", required = false) + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + + @Schema(name = "lastName", required = false) + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + + @Schema(name = "email", required = false) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + + @Schema(name = "password", required = false) + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + */ + + @Schema(name = "phone", required = false) + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + */ + + @Schema(name = "userStatus", description = "User Status", required = false) + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java new file mode 100644 index 000000000000..b886d9d3f61e --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java @@ -0,0 +1,839 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * XmlItem + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class XmlItem { + + @JsonProperty("attribute_string") + private String attributeString; + + @JsonProperty("attribute_number") + private BigDecimal attributeNumber; + + @JsonProperty("attribute_integer") + private Integer attributeInteger; + + @JsonProperty("attribute_boolean") + private Boolean attributeBoolean; + + @JsonProperty("wrapped_array") + @Valid + private List wrappedArray = null; + + @JsonProperty("name_string") + private String nameString; + + @JsonProperty("name_number") + private BigDecimal nameNumber; + + @JsonProperty("name_integer") + private Integer nameInteger; + + @JsonProperty("name_boolean") + private Boolean nameBoolean; + + @JsonProperty("name_array") + @Valid + private List nameArray = null; + + @JsonProperty("name_wrapped_array") + @Valid + private List nameWrappedArray = null; + + @JsonProperty("prefix_string") + private String prefixString; + + @JsonProperty("prefix_number") + private BigDecimal prefixNumber; + + @JsonProperty("prefix_integer") + private Integer prefixInteger; + + @JsonProperty("prefix_boolean") + private Boolean prefixBoolean; + + @JsonProperty("prefix_array") + @Valid + private List prefixArray = null; + + @JsonProperty("prefix_wrapped_array") + @Valid + private List prefixWrappedArray = null; + + @JsonProperty("namespace_string") + private String namespaceString; + + @JsonProperty("namespace_number") + private BigDecimal namespaceNumber; + + @JsonProperty("namespace_integer") + private Integer namespaceInteger; + + @JsonProperty("namespace_boolean") + private Boolean namespaceBoolean; + + @JsonProperty("namespace_array") + @Valid + private List namespaceArray = null; + + @JsonProperty("namespace_wrapped_array") + @Valid + private List namespaceWrappedArray = null; + + @JsonProperty("prefix_ns_string") + private String prefixNsString; + + @JsonProperty("prefix_ns_number") + private BigDecimal prefixNsNumber; + + @JsonProperty("prefix_ns_integer") + private Integer prefixNsInteger; + + @JsonProperty("prefix_ns_boolean") + private Boolean prefixNsBoolean; + + @JsonProperty("prefix_ns_array") + @Valid + private List prefixNsArray = null; + + @JsonProperty("prefix_ns_wrapped_array") + @Valid + private List prefixNsWrappedArray = null; + + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; + } + + /** + * Get attributeString + * @return attributeString + */ + + @Schema(name = "attribute_string", example = "string", required = false) + public String getAttributeString() { + return attributeString; + } + + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + /** + * Get attributeNumber + * @return attributeNumber + */ + @Valid + @Schema(name = "attribute_number", example = "1.234", required = false) + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + /** + * Get attributeInteger + * @return attributeInteger + */ + + @Schema(name = "attribute_integer", example = "-2", required = false) + public Integer getAttributeInteger() { + return attributeInteger; + } + + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + /** + * Get attributeBoolean + * @return attributeBoolean + */ + + @Schema(name = "attribute_boolean", example = "true", required = false) + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList<>(); + } + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + /** + * Get wrappedArray + * @return wrappedArray + */ + + @Schema(name = "wrapped_array", required = false) + public List getWrappedArray() { + return wrappedArray; + } + + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + */ + + @Schema(name = "name_string", example = "string", required = false) + public String getNameString() { + return nameString; + } + + public void setNameString(String nameString) { + this.nameString = nameString; + } + + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + */ + @Valid + @Schema(name = "name_number", example = "1.234", required = false) + public BigDecimal getNameNumber() { + return nameNumber; + } + + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + */ + + @Schema(name = "name_integer", example = "-2", required = false) + public Integer getNameInteger() { + return nameInteger; + } + + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + */ + + @Schema(name = "name_boolean", example = "true", required = false) + public Boolean getNameBoolean() { + return nameBoolean; + } + + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList<>(); + } + this.nameArray.add(nameArrayItem); + return this; + } + + /** + * Get nameArray + * @return nameArray + */ + + @Schema(name = "name_array", required = false) + public List getNameArray() { + return nameArray; + } + + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList<>(); + } + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + /** + * Get nameWrappedArray + * @return nameWrappedArray + */ + + @Schema(name = "name_wrapped_array", required = false) + public List getNameWrappedArray() { + return nameWrappedArray; + } + + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + */ + + @Schema(name = "prefix_string", example = "string", required = false) + public String getPrefixString() { + return prefixString; + } + + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + */ + @Valid + @Schema(name = "prefix_number", example = "1.234", required = false) + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + */ + + @Schema(name = "prefix_integer", example = "-2", required = false) + public Integer getPrefixInteger() { + return prefixInteger; + } + + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + */ + + @Schema(name = "prefix_boolean", example = "true", required = false) + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList<>(); + } + this.prefixArray.add(prefixArrayItem); + return this; + } + + /** + * Get prefixArray + * @return prefixArray + */ + + @Schema(name = "prefix_array", required = false) + public List getPrefixArray() { + return prefixArray; + } + + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList<>(); + } + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + /** + * Get prefixWrappedArray + * @return prefixWrappedArray + */ + + @Schema(name = "prefix_wrapped_array", required = false) + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + */ + + @Schema(name = "namespace_string", example = "string", required = false) + public String getNamespaceString() { + return namespaceString; + } + + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + */ + @Valid + @Schema(name = "namespace_number", example = "1.234", required = false) + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + */ + + @Schema(name = "namespace_integer", example = "-2", required = false) + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + */ + + @Schema(name = "namespace_boolean", example = "true", required = false) + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList<>(); + } + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + /** + * Get namespaceArray + * @return namespaceArray + */ + + @Schema(name = "namespace_array", required = false) + public List getNamespaceArray() { + return namespaceArray; + } + + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList<>(); + } + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + /** + * Get namespaceWrappedArray + * @return namespaceWrappedArray + */ + + @Schema(name = "namespace_wrapped_array", required = false) + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + */ + + @Schema(name = "prefix_ns_string", example = "string", required = false) + public String getPrefixNsString() { + return prefixNsString; + } + + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + */ + @Valid + @Schema(name = "prefix_ns_number", example = "1.234", required = false) + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + */ + + @Schema(name = "prefix_ns_integer", example = "-2", required = false) + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + */ + + @Schema(name = "prefix_ns_boolean", example = "true", required = false) + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList<>(); + } + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + /** + * Get prefixNsArray + * @return prefixNsArray + */ + + @Schema(name = "prefix_ns_array", required = false) + public List getPrefixNsArray() { + return prefixNsArray; + } + + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList<>(); + } + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + /** + * Get prefixNsWrappedArray + * @return prefixNsWrappedArray + */ + + @Schema(name = "prefix_ns_wrapped_array", required = false) + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(this.attributeString, xmlItem.attributeString) && + Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && + Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && + Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && + Objects.equals(this.nameString, xmlItem.nameString) && + Objects.equals(this.nameNumber, xmlItem.nameNumber) && + Objects.equals(this.nameInteger, xmlItem.nameInteger) && + Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && + Objects.equals(this.nameArray, xmlItem.nameArray) && + Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(this.prefixString, xmlItem.prefixString) && + Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && + Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && + Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(this.prefixArray, xmlItem.prefixArray) && + Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(this.namespaceString, xmlItem.namespaceString) && + Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && + Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && + Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + From 16457d0921d687203ff31286ee167b5a114c89be Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 23 Feb 2022 16:19:37 +0800 Subject: [PATCH 110/111] test spring-boot-defaultInterface-unhandledException in github workflow --- .github/workflows/samples-spring.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index 328052970b31..e72746a10c5b 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -38,6 +38,7 @@ jobs: - samples/server/petstore/springboot-delegate - samples/openapi3/server/petstore/springboot-delegate - samples/server/petstore/spring-boot-nullable-set + - samples/server/petstore/spring-boot-defaultInterface-unhandledException steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 From 6e7c39e64fff094866cc8ee424ad871bf19b465e Mon Sep 17 00:00:00 2001 From: sullis Date: Wed, 23 Feb 2022 00:38:25 -0800 Subject: [PATCH 111/111] validate pom.xml files (#11672) --- modules/openapi-generator/pom.xml | 10 +++++ .../org/openapitools/codegen/TestUtils.java | 41 +++++++++++++++++++ .../jaxrs/JavaJerseyServerCodegenTest.java | 1 + pom.xml | 7 ++++ 4 files changed, 59 insertions(+) diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index fd565603dcb3..39a3310fb2ba 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -341,6 +341,11 @@ 3.24.0 test + + org.openrewrite + rewrite-maven + test + org.reflections reflections @@ -374,6 +379,11 @@ rgxgen ${rxgen.version} + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + com.fasterxml.jackson.datatype jackson-datatype-joda diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java index 337f0c73a824..35de2c3ce210 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java @@ -18,12 +18,16 @@ import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.core.models.ParseOptions; +import org.apache.commons.io.IOUtils; import org.openapitools.codegen.MockDefaultGenerator.WrittenTemplateBasedFile; import org.openapitools.codegen.utils.ModelUtils; +import org.openrewrite.maven.internal.RawPom; import org.testng.Assert; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -125,6 +129,43 @@ public static void ensureDoesNotContainsFile(List generatedFiles, File roo assertFalse(generatedFiles.contains(path.toFile()), "File '" + path.toAbsolutePath() + "' was found in the list of generated files"); } + public static void validatePomXmlFiles(final Map fileMap) { + fileMap.forEach( (fileName, fileContents) -> { + if ("pom.xml".equals(fileName)) { + assertValidPomXml(fileContents); + } + }); + } + + public static void validatePomXmlFiles(final List files) { + files.forEach( f -> { + String fileName = f.getName(); + if ("pom.xml".equals(fileName)) { + try { + String fileContents = new String(Files.readAllBytes(f.toPath()), StandardCharsets.UTF_8); + assertValidPomXml(fileContents); + } catch (IOException exception) { + throw new RuntimeException(exception); + } + } + } + ); + } + + private static void assertValidPomXml(final String fileContents) { + final InputStream input = new ByteArrayInputStream(fileContents.getBytes(StandardCharsets.UTF_8)); + try { + RawPom pom = RawPom.parse(input, null); + assertTrue(pom.getDependencies().getDependencies().size() > 0); + assertNotNull(pom.getName()); + assertNotNull(pom.getArtifactId()); + assertNotNull(pom.getGroupId()); + assertNotNull(pom.getVersion()); + } finally { + IOUtils.closeQuietly(input); + } + } + public static void validateJavaSourceFiles(Map fileMap) { fileMap.forEach( (fileName, fileContents) -> { if (fileName.endsWith(".java")) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java index 7cfb0c23c00e..df50cfcace3c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java @@ -126,6 +126,7 @@ static private Map generateFiles(DefaultCodegen codegen, String fi Assert.assertTrue(files.size() > 0); TestUtils.validateJavaSourceFiles(files); + TestUtils.validatePomXmlFiles(files); return files.stream().collect(Collectors.toMap(e -> e.getName().replace(outputPath, ""), i -> i)); } diff --git a/pom.xml b/pom.xml index b9cd286012c0..0658e9cd153e 100644 --- a/pom.xml +++ b/pom.xml @@ -1436,6 +1436,12 @@ ${testng.version} test + + org.openrewrite + rewrite-maven + ${openrewrite.version} + test + @@ -1483,6 +1489,7 @@ 1.7.32 3.1.12.2 3.0.0-M5 + 7.18.2 2.1.12 io.swagger.parser.v3 2.0.29